From 268973b85fe0baeab3573a53b2bccba3ca3768ff Mon Sep 17 00:00:00 2001 From: Vico Chu Date: Wed, 1 Feb 2023 20:39:19 +0800 Subject: [PATCH] Docs: add k8s network configurations documentations --- docs/commands/kk-delete-cluster.md | 4 ++-- docs/commands/kk-delete-node.md | 2 +- docs/network-configurations.md | 25 +++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 docs/network-configurations.md diff --git a/docs/commands/kk-delete-cluster.md b/docs/commands/kk-delete-cluster.md index fa705378..6370ba3e 100644 --- a/docs/commands/kk-delete-cluster.md +++ b/docs/commands/kk-delete-cluster.md @@ -2,7 +2,7 @@ **kk delete cluster**: Delete a cluster. # DESCRIPTION -Delete a cluster. This command will use the `kubeadm reset` to reset all the nodes. Then, reset network policy, stop `etcd`, remove cluster directory and uninstall Kubernetes certs-auto-renew script. +Delete a cluster. This command will use the `kubeadm reset` to reset all the nodes. Then, reset network policy, stop `etcd`, remove cluster directory, uninstall Kubernetes certs-auto-renew script and remove internal Loadbalancer module. And [network configurations](../network-configurations.md) on each node will be cleaned up. # OPTIONS @@ -24,7 +24,7 @@ Delete a cluster from a specified configuration file. ``` $ kk delete cluster -f config-example.yaml ``` -Delete a cluster included CRI related files and directories from a specified configuraion file. +Delete a cluster included CRI related files and directories from a specified configuration file. ``` $ kk delete cluster -f config-example.yaml --all $ kk delete cluster -f config-example.yaml -A diff --git a/docs/commands/kk-delete-node.md b/docs/commands/kk-delete-node.md index c6494343..d0835c0e 100644 --- a/docs/commands/kk-delete-node.md +++ b/docs/commands/kk-delete-node.md @@ -2,7 +2,7 @@ **kk delete node**: Delete a node. # DESCRIPTION -Delete a node. This command will use the `kubectl drain` to safely evict all pods, and then use `kubectl delete node` to delete the specified node. +Delete and cleanup a node. This command will use the `kubectl drain` to safely evict all pods, then use `kubectl delete node` to delete the specified node. And [network configurations](../network-configurations.md) on the node will be cleaned up. # OPTIONS diff --git a/docs/network-configurations.md b/docs/network-configurations.md new file mode 100644 index 00000000..f47c3d22 --- /dev/null +++ b/docs/network-configurations.md @@ -0,0 +1,25 @@ +### Network Configurations + +#### IPVS + +If your cluster's kubeProxy mode is `ipvs` which is default value in `kk`, kubernetes will add some ipvs records on each node. You can use `ipvsadm` command to get more information. + +#### Iptables + +If your cluster's kubeProxy mode is `iptables`, kubernetes will add some iptables records on each node. You can use `iptables` command to get more information. + +#### Virtual Device + +Most of CNI Plugins will create some virtual devices on each node, such as `cni0`. You can use `ip link` command to inspect them in details. + +As for `flannel`, virtual devices named with `flannel` prefix will be created. +As for `calico`, virtual devices named in `cali[a-f0-9]*` regexp format will be created. +As for `cilium`, virtual devices named with `cilium_` prefix will be created. + +If your cluster's kubeProxy mode is `ipvs`, additional virtual device `kube-ipvs0` will be created. + +If your cluster enables `nodelocaldns` feature for DNS caching purpose, additional virtual device `nodelocaldns` will be created. + +#### Network Namespace + +CNI plugins may create some network namespaces named with `cni-` prefix depends on which CNI plugin you choose to use. You can use `ip netns show 2>/dev/null | grep cni-` command to get CNI network namespace list.