From 847a2c04adf9db400795a44198ee87a9ed45a2fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E6=8C=AF=E5=AE=87?= <> Date: Sat, 11 Jan 2025 19:06:42 +0800 Subject: [PATCH] feat(inventory): add inventory template and update existing entries MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 孙振宇 <> --- .gitignore | 3 ++- cluster/ansible/manifests/inventory.ini | 4 ++-- cluster/ansible/manifests/inventory.ini.tpl | 16 ++++++++++++++++ 3 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 cluster/ansible/manifests/inventory.ini.tpl diff --git a/.gitignore b/.gitignore index 1e66a0ca..f983274c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -cluster/ansible/venv \ No newline at end of file +cluster/ansible/venv +cluster/ansible/manifests/inventory.ini \ No newline at end of file diff --git a/cluster/ansible/manifests/inventory.ini b/cluster/ansible/manifests/inventory.ini index 5fcee658..d41b28c9 100644 --- a/cluster/ansible/manifests/inventory.ini +++ b/cluster/ansible/manifests/inventory.ini @@ -6,11 +6,11 @@ prod-usw2-k8s-freeleaps-master-03 ansible_host=prod-usw2-k8s-freeleaps-master-03 [etcd:children] kube_control_plane +; If you want to add more nodes to the cluster, you can add them to the [kube_node] group [kube_node] prod-usw2-k8s-freeleaps-worker-01 ansible_host=prod-usw2-k8s-freeleaps-worker-01.mathmast.com ansible_user=zhenyus@mathmast.com prod-usw2-k8s-freeleaps-worker-02 ansible_host=prod-usw2-k8s-freeleaps-worker-02.mathmast.com ansible_user=zhenyus@mathmast.com prod-usw2-k8s-freeleaps-worker-03 ansible_host=prod-usw2-k8s-freeleaps-worker-03.mathmast.com ansible_user=zhenyus@mathmast.com -prod-usw2-k8s-freeleaps-worker-04 ansible_host=prod-usw2-k8s-freeleaps-worker-04.mathmast.com ansible_user=zhenyus@mathmast.com prod-usw2-k8s-freeleaps-ingress-worker-01 ansible_host=prod-usw2-k8s-freeleaps-worker-ingress-01.mathmast.com ansible_user=zhenyus@mathmast.com prod-usw2-k8s-freeleaps-ingress-worker-02 ansible_host=prod-usw2-k8s-freeleaps-worker-ingress-02.mathmast.com ansible_user=zhenyus@mathmast.com -prod-usw2-k8s-freeleaps-ingress-worker-03 ansible_host=prod-usw2-k8s-freeleaps-worker-ingress-03.mathmast.com ansible_user=zhenyus@mathmast.com +prod-usw2-k8s-freeleaps-ingress-worker-03 ansible_host=prod-usw2-k8s-freeleaps-worker-ingress-03.mathmast.com ansible_user=zhenyus@mathmast.com \ No newline at end of file diff --git a/cluster/ansible/manifests/inventory.ini.tpl b/cluster/ansible/manifests/inventory.ini.tpl new file mode 100644 index 00000000..5eb17baa --- /dev/null +++ b/cluster/ansible/manifests/inventory.ini.tpl @@ -0,0 +1,16 @@ +[kube_control_plane] +prod-usw2-k8s-freeleaps-master-01 ansible_host=prod-usw2-k8s-freeleaps-master-01.mathmast.com ansible_user= etcd_member_name=freeleaps-etcd-01 +prod-usw2-k8s-freeleaps-master-02 ansible_host=prod-usw2-k8s-freeleaps-master-02.mathmast.com ansible_user= etcd_member_name=freeleaps-etcd-02 +prod-usw2-k8s-freeleaps-master-03 ansible_host=prod-usw2-k8s-freeleaps-master-03.mathmast.com ansible_user= etcd_member_name=freeleaps-etcd-03 + +[etcd:children] +kube_control_plane + +; If you want to add more nodes to the cluster, you can add them to the [kube_node] group +[kube_node] +prod-usw2-k8s-freeleaps-worker-01 ansible_host=prod-usw2-k8s-freeleaps-worker-01.mathmast.com ansible_user= +prod-usw2-k8s-freeleaps-worker-02 ansible_host=prod-usw2-k8s-freeleaps-worker-02.mathmast.com ansible_user= +prod-usw2-k8s-freeleaps-worker-03 ansible_host=prod-usw2-k8s-freeleaps-worker-03.mathmast.com ansible_user= +prod-usw2-k8s-freeleaps-ingress-worker-01 ansible_host=prod-usw2-k8s-freeleaps-worker-ingress-01.mathmast.com ansible_user= +prod-usw2-k8s-freeleaps-ingress-worker-02 ansible_host=prod-usw2-k8s-freeleaps-worker-ingress-02.mathmast.com ansible_user= +prod-usw2-k8s-freeleaps-ingress-worker-03 ansible_host=prod-usw2-k8s-freeleaps-worker-ingress-03.mathmast.com ansible_user= \ No newline at end of file