summaryrefslogtreecommitdiffstats
path: root/ansible
diff options
context:
space:
mode:
authorMichal Zegan <m.zegan@samsung.com>2019-05-28 17:05:01 +0200
committerMichal Zegan <m.zegan@samsung.com>2019-06-03 14:49:32 +0200
commit81a5673727746e4975ff77bde3503ac0319a95a4 (patch)
tree5dfeee6cfa047d461b06d6998fefdaf8ceb81b7f /ansible
parent1ec19b0598382aa45258ed630ee26cba4fb3a7e5 (diff)
Add kubernetes-node group for workers
Moved all kubernetes nodes from the kubernetes to kubernetes-node group, and made the kubernetes group a parent of both kubernetes-node and kubernetes-control-plane. The reason is that we still need to have separate groups for control planes and for nodes, but some operations are performed equally on any kind of kubernetes cluster member, and currently one would need to separately include all related groups one by one. Example of such common operation is installation of docker, that was not performed for kubernetes-control-plane group, so that docker was not installed on control planes that were neither infra nor nodes. The side effect of this change is that if infrastructure server is also a cluster member, it lands in a kubernetes group by default, and node specific setup would be performed on it. For that reason, playbook is modified to perform this setup on all kubernetes cluster members except the infra server. Change-Id: Ic827002d28e535334dbab7e5ad4aed8aa95c97a9 Issue-ID: OOM-1778 Signed-off-by: Michal Zegan <m.zegan@samsung.com>
Diffstat (limited to 'ansible')
-rw-r--r--ansible/infrastructure.yml2
-rw-r--r--ansible/inventory/hosts.yml29
2 files changed, 17 insertions, 14 deletions
diff --git a/ansible/infrastructure.yml b/ansible/infrastructure.yml
index ce4d4d72..7fdbd2e1 100644
--- a/ansible/infrastructure.yml
+++ b/ansible/infrastructure.yml
@@ -18,7 +18,7 @@
- nexus
- name: Setup base for Kubernetes nodes
- hosts: kubernetes
+ hosts: kubernetes:!infrastructure
roles:
- chrony
- package-repository-check
diff --git a/ansible/inventory/hosts.yml b/ansible/inventory/hosts.yml
index 37ae4e39..11825500 100644
--- a/ansible/inventory/hosts.yml
+++ b/ansible/inventory/hosts.yml
@@ -25,20 +25,23 @@ all:
# This is group of hosts which are/will be part of Kubernetes cluster.
kubernetes:
- hosts:
- kubernetes-node-1:
- ansible_host: 10.8.8.19
- #ip of the node that it uses for communication with k8s cluster.
- cluster_ip: 10.8.8.19
+ children:
+ # This is a group of hosts containing kubernetes worker nodes.
+ kubernetes-node:
+ hosts:
+ kubernetes-node-1:
+ ansible_host: 10.8.8.19
+ #ip of the node that it uses for communication with k8s cluster.
+ cluster_ip: 10.8.8.19
- # This is a group of hosts that are to be used as kubernetes control plane nodes.
- # This means they host kubernetes api server, controller manager and scheduler.
- # This example uses infra for this purpose, however note that any
- # other host could be used including kubernetes nodes.
- # cluster_ip needs to be set for hosts used as control planes.
- kubernetes-control-plane:
- hosts:
- infrastructure-server
+ # This is a group of hosts that are to be used as kubernetes control plane nodes.
+ # This means they host kubernetes api server, controller manager and scheduler.
+ # This example uses infra for this purpose, however note that any
+ # other host could be used including kubernetes nodes.
+ # cluster_ip needs to be set for hosts used as control planes.
+ kubernetes-control-plane:
+ hosts:
+ infrastructure-server
nfs-server:
hosts: