From 88b6f08e26f842f3e56e124139d8a1f310a3fd9d Mon Sep 17 00:00:00 2001 From: Max Gautier Date: Sat, 21 Sep 2024 14:33:45 +0200 Subject: [PATCH] Documentation of k8s_cluster auto-defined Also remove the group from the example inventory, since it should not be needed anymore. --- docs/CNI/calico.md | 8 +------- docs/ansible/ansible.md | 15 +++------------ docs/operations/integration.md | 6 ------ inventory/local/hosts.ini | 4 ---- inventory/sample/inventory.ini | 7 ------- 5 files changed, 4 insertions(+), 36 deletions(-) diff --git a/docs/CNI/calico.md b/docs/CNI/calico.md index 916426827..24c646b2f 100644 --- a/docs/CNI/calico.md +++ b/docs/CNI/calico.md @@ -127,8 +127,7 @@ recommended here: You need to edit your inventory and add: * `calico_rr` group with nodes in it. `calico_rr` can be combined with - `kube_node` and/or `kube_control_plane`. `calico_rr` group also must be a child - group of `k8s_cluster` group. + `kube_node` and/or `kube_control_plane`. * `cluster_id` by route reflector node/group (see details [here](https://hub.docker.com/r/calico/routereflector/)) Here's an example of Kubespray inventory with standalone route reflectors: @@ -157,11 +156,6 @@ node3 node4 node5 -[k8s_cluster:children] -kube_node -kube_control_plane -calico_rr - [calico_rr] rr0 rr1 diff --git a/docs/ansible/ansible.md b/docs/ansible/ansible.md index 7871300ff..5e79d966d 100644 --- a/docs/ansible/ansible.md +++ b/docs/ansible/ansible.md @@ -42,14 +42,6 @@ The inventory is composed of 3 groups: * **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. -Note: do not modify the children of _k8s_cluster_, like putting -the _etcd_ group into the _k8s_cluster_, unless you are certain -to do that and you have it fully contained in the latter: - -```ShellSession -etcd ⊂ k8s_cluster => kube_node ∩ etcd = etcd -``` - When _kube_node_ contains _etcd_, you define your etcd cluster to be as well schedulable for Kubernetes workloads. If you want it a standalone, make sure those groups do not intersect. If you want the server to act both as control-plane and node, the server must be defined @@ -62,6 +54,9 @@ There are also two special groups: * **calico_rr** : explained for [advanced Calico networking cases](/docs/CNI/calico.md) * **bastion** : configure a bastion host if your nodes are not directly reachable +Lastly, the **k8s_cluster** is dynamically defined as the union of **kube_node**, **kube_control_plane** and **calico_rr**. +This is used internally and for the purpose of defining whole cluster variables (`/group_vars/k8s_cluster/*.yml`) + Below is a complete inventory example: ```ini @@ -89,10 +84,6 @@ node3 node4 node5 node6 - -[k8s_cluster:children] -kube_node -kube_control_plane ``` ## Group vars and overriding variables precedence diff --git a/docs/operations/integration.md b/docs/operations/integration.md index 1060fbc6c..7764b882f 100644 --- a/docs/operations/integration.md +++ b/docs/operations/integration.md @@ -71,9 +71,6 @@ [kube_node:children] kubenode - [k8s_cluster:children] - kubernetes - [etcd:children] kubemaster kubemaster-ha @@ -81,9 +78,6 @@ [kube_control_plane:children] kubemaster kubemaster-ha - - [kubespray:children] - kubernetes ``` * Last entry here needed to apply kubespray.yml config file, renamed from all.yml of kubespray project. diff --git a/inventory/local/hosts.ini b/inventory/local/hosts.ini index 4a6197e49..6506b9696 100644 --- a/inventory/local/hosts.ini +++ b/inventory/local/hosts.ini @@ -8,7 +8,3 @@ node1 [kube_node] node1 - -[k8s_cluster:children] -kube_node -kube_control_plane diff --git a/inventory/sample/inventory.ini b/inventory/sample/inventory.ini index 99a630922..3c87df93d 100644 --- a/inventory/sample/inventory.ini +++ b/inventory/sample/inventory.ini @@ -29,10 +29,3 @@ # node4 # node5 # node6 - -[calico_rr] - -[k8s_cluster:children] -kube_control_plane -kube_node -calico_rr