kubeadm 创建的集群的 kube-controller-manager 和 kube-apiserver 问题

kube-controller-manager & kube-apiserver questions for a kubeadm created cluster

我使用 kubeadm 创建了一个 k8s 集群,有几个关于 kube-controller-manager 和 kuber-apiserver 组件的问题。

您描述的功能称为静态 Pods。这是描述他们行为的 documentation 的一部分。

Static pods are managed directly by kubelet daemon on a specific node, without the API server observing it. It does not have an associated replication controller, and kubelet daemon itself watches it and restarts it when it crashes. There is no health check. Static pods are always bound to one kubelet daemon and always run on the same node with it.

Kubelet automatically tries to create a mirror pod on the Kubernetes API server for each static pod. This means that the pods are visible on the API server but cannot be controlled from there.

The configuration files are just standard pod definitions in json or yaml format in a specific directory. Use kubelet --pod-manifest-path=<the directory> to start kubelet daemon, which periodically scans the directory and creates/deletes static pods as yaml/json files appear/disappear there. Note that kubelet will ignore files starting with dots when scanning the specified directory.

When kubelet starts, it automatically starts all pods defined in directory specified in --pod-manifest-path= or --manifest-url= arguments, i.e. our static-web.

通常,这些清单存储在目录 /etc/kubernetes/manifests.
中 如果您对这些清单中的任何一个进行任何更改,该资源将被调整,就像您 运行 kubectl apply -f something.yaml 命令一样。