gpt4 book ai didi

kubernetes - 谁启动 kube-apiserver 以及如何配置其启动参数?

转载 作者:行者123 更新时间:2023-12-05 02:06:59 36 4
gpt4 key购买 nike

kube-apiserver 是由 kubeadm init 创建的配置中的 containerd.service 启动的,如何检查 containerd.service 的配置以及它如何知道如何启动 kube-apiserver?

ytong@controller-4135505:~$ systemctl status containerd.service
● containerd.service - containerd container runtime
Loaded: loaded (/lib/systemd/system/containerd.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2020-06-09 04:34:04 GMT+7; 3min 24s ago
Docs: https://containerd.io
Process: 5135 ExecStartPre=/sbin/modprobe overlay (code=exited, status=0/SUCCESS)
Main PID: 5138 (containerd)
Tasks: 228
CGroup: /system.slice/containerd.service
├─5138 /usr/bin/containerd
├─5821 etcd --advertise-client-urls=https://10.169.97.0:2379 --cert-file=/etc/kubernetes/pki/etcd/server.crt --client-cert-auth=true --data-dir=/var/lib/etcd --initial-advertise-
├─5847 kube-scheduler --authentication-kubeconfig=/etc/kubernetes/scheduler.conf --authorization-kubeconfig=/etc/kubernetes/scheduler.conf --bind-address=127.0.0.1 --kubeconfig=/
* ├─5868 kube-apiserver --advertise-address=10.169.97.0 --allow-privileged=true --authorization-mode=Node,RBAC --client-ca-file=/etc/kubernetes/pki/ca.crt --enable-admission-plugin
└─7587 kube-controller-manager --authentication-kubeconfig=/etc/kubernetes/controller-manager.conf --authorization-kubeconfig=/etc/kubernetes/controller-manager.conf --bind-addre```
And it is not controlled by kubelet.service right since I restart kubelet.service will not restart kube-apiserver daemon.

The only configuration file found by me for containerd.service is for /lib/systemd/system/containerd.service, but it only tell the execStart is /usr/bin/containerd.

The /usr/bin/containerd is a binary and all clues are ended here for me to find how it can find kube-apiserver to start.

Or does containerd has some path to hold its configuration files?

最佳答案

Kube API 服务器启动为 static pod来自位于 /etc/kubernetes/manifests/kube-apiserver.yaml 的 yaml 您可以编辑 yaml 以添加或删除启动参数。 Kubelet 知道在该路径中查找任何 yaml,如果有任何 yaml,kubelet 会将容器创建委托(delegate)给 containerd。所以 containerd 并不直接了解 Kubernetes API Server 的任何信息。对于 containerd,Kubernetes API 服务器只是另一个要启动的容器。

https://kubernetes.io/docs/reference/setup-tools/kubeadm/implementation-details/#constants-and-well-known-values-and-paths

关于kubernetes - 谁启动 kube-apiserver 以及如何配置其启动参数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62281807/

36 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com