K3s 将 Kubernetes 组件(kube-apiserver、kube-controller-manager、kube-scheduler、kubelet、kube-proxy)捆绑到组合进程中,以简单的服务器和代理模型呈现。运行 k3s server 会启动 Kubernetes server 并自动将本地主机注册为代理。k3s 支持多节点模型,用户可以使用进程启动时生成的“node-token”。默认情况下,k3s 会同时安装服务器和代理(结合了 Kubelet、kubeproxy 和 flannel 代理进程),同样可以使用“--disable-agent”来控制,其中服务器和代理(Kubernetes 术语中的主节点和节点)可以分开。
据我所知 - k3s 的所有配置文件都可以在/var/lib/rancher/k3s
目录下找到:
Running kube-apiserver --advertise-port=6443 --allow-privileged=true
--api-audiences=unknown --authorization-mode=Node,RBAC --basic-auth-file=/var/lib/ranch
er/k3s/server/cred/passwd
--bind-address=127.0.0.1 --cert-dir=/var/lib/rancher/k3s/server/tls/temporary-certs --client-ca-file=/var/lib/rancher/k3s/server/tls/client-ca.crt
--enable-admission-p
lugins=NodeRestriction --insecure-port=0
--kubelet-client-certificate=/var/lib/rancher/k3s/server/tls/client-kube-apiserver.crt
--kubelet-client-key=/var/lib/rancher/k3s/server/tls/client-kube-
apiserver.key
--proxy-client-cert-file=/var/lib/rancher/k3s/server/tls/client-auth-proxy.crt
--proxy-client-key-file=/var/lib/rancher/k3s/server/tls/client-auth-proxy.key --requestheader-allowe
d-names=system:auth-proxy
--requestheader-client-ca-file=/var/lib/rancher/k3s/server/tls/request-header-ca.crt
--requestheader-extra-headers-prefix=X-Remote-Extra-
--requestheader-group-headers
=X-Remote-Group --requestheader-username-headers=X-Remote-User
--secure-port=6444 --service-account-issuer=k3s --service-account-key-file=/var/lib/rancher/k3s/server/tls/service.key
--service-a
ccount-signing-key-file=/var/lib/rancher/k3s/server/tls/service.key
--service-cluster-ip-range=10.43.0.0/16 --tls-cert-file=/var/lib/rancher/k3s/server/tls/serving-kube-apiserver.crt --tls-priv
ate-key-file=/var/lib/rancher/k3s/server/tls/serving-kube-apiserver.key
您还可以使用--kube-apiserver-arg
选项指定所需的值