kubeadm 创建的集群的 kube-controller-manager 和 kube-apiserver 问题
kube-controller-manager & kube-apiserver questions for a kubeadm created cluster
我使用 kubeadm 创建了一个 k8s 集群,有几个关于 kube-controller-manager 和 kuber-apiserver 组件的问题。
当使用 kubeadm 创建时,这些组件作为 pods 启动,而不是 systemd 守护进程。如果我杀死其中任何一个 pods,它们就会重新启动,但谁在重新启动它们?我还没有看到任何 replicacontroller 或 deployment 负责这样做。
"right"更新配置的方法是什么?假设我想更改 api 服务器的授权模式。在主节点中,我们可以找到一个包含 kube-apiserver.yaml
文件的 /etc/kubernetes/manifests
文件夹。我们是否应该更改此文件并杀死 pod,以便它使用新配置重新启动?
您描述的功能称为静态 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
命令一样。
我使用 kubeadm 创建了一个 k8s 集群,有几个关于 kube-controller-manager 和 kuber-apiserver 组件的问题。
当使用 kubeadm 创建时,这些组件作为 pods 启动,而不是 systemd 守护进程。如果我杀死其中任何一个 pods,它们就会重新启动,但谁在重新启动它们?我还没有看到任何 replicacontroller 或 deployment 负责这样做。
"right"更新配置的方法是什么?假设我想更改 api 服务器的授权模式。在主节点中,我们可以找到一个包含
kube-apiserver.yaml
文件的/etc/kubernetes/manifests
文件夹。我们是否应该更改此文件并杀死 pod,以便它使用新配置重新启动?
您描述的功能称为静态 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 startkubelet
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
命令一样。