The Kubespray hosts.yaml inventory file is composed of 3 groups:
- kube_node: list of Kubernetes nodes where the pods will run.
- kube_control_plane: list of servers where Kubernetes control plane components (apiserver, scheduler, controller) will run.
- etcd: list of servers to compose the etcd server. You should have at least 3 servers for failover purpose.
Please following these links for YAML examples and depending on your preferred topology:
- All-In-One Node
- One Control Plane Node with Multiple Worker Nodes
- Multiple Control Plane Nodes with Multiple Work Nodes
- node1 - is a single control plane + etcd node
- node1 - is also running the pods
- Easy to manage
- Single point of failure for K8s/etcd/pods;
- Thinner security barrier since pods are running on control plane / etcd nodes;
children:
kube_control_plane:
hosts:
node1:
kube_node:
hosts:
node1:
etcd:
hosts:
node1:
k8s_cluster:
children:
kube_control_plane:
kube_node:
calico_rr:
hosts: {}
- node1 - single control plane + etcd node
- node2..N - kube nodes where the pods will run
- Better security barrier since pods aren't running on control plane / etcd nodes
- Can scale by adding either more control plane nodes or worker nodes
- Single point of failure only for K8s/etcd but not the pods
children:
kube_control_plane:
hosts:
node1:
kube_node:
hosts:
node2:
node3:
etcd:
hosts:
node1:
k8s_cluster:
children:
kube_control_plane:
kube_node:
calico_rr:
hosts: {}
- Nodes 1.-3 - the control plane + etcd nodes; (This makes K8s High Available)
- Node 4.-N - the kube nodes on which the Pods will run
- Highly available control plane / etcd
- Better security barrier since pods aren't running on control plane / etcd nodes
- Can scale by adding either more control plane nodes or worker nodes
- More complex environment makes its configuration & management more difficult
children:
kube_control_plane:
hosts:
node1:
node2:
node3:
kube_node:
hosts:
node4:
node5:
node6:
etcd:
hosts:
node1:
node2:
node3:
k8s_cluster:
children:
kube_control_plane:
kube_node:
calico_rr:
hosts: {}