mirror of
https://github.com/kubesphere/kubekey.git
synced 2025-12-26 01:22:51 +00:00
Merge pull request #1856 from littleBlackHouse/master
support custom argument when start the kubelet
This commit is contained in:
commit
9d69ed049e
|
|
@ -191,6 +191,7 @@ func (g *GenerateKubeletEnv) Execute(runtime connector.Runtime) error {
|
|||
"NodeIP": host.GetInternalAddress(),
|
||||
"Hostname": host.GetName(),
|
||||
"ContainerRuntime": "",
|
||||
"KubeletArgs": g.KubeConf.Cluster.Kubernetes.KubeletArgs,
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ EnvironmentFile=-/var/lib/kubelet/kubeadm-flags.env
|
|||
# This is a file that the user can use for overrides of the kubelet args as a last resort. Preferably, the user should use
|
||||
# the .NodeRegistration.KubeletExtraArgs object in the configuration files instead. KUBELET_EXTRA_ARGS should be sourced from this file.
|
||||
EnvironmentFile=-/etc/default/kubelet
|
||||
Environment="KUBELET_EXTRA_ARGS=--node-ip={{ .NodeIP }} --hostname-override={{ .Hostname }} {{ if .ContainerRuntime }}--network-plugin=cni{{ end }}"
|
||||
Environment="KUBELET_EXTRA_ARGS=--node-ip={{ .NodeIP }} --hostname-override={{ .Hostname }} {{ if .ContainerRuntime }}--network-plugin=cni{{ end }} {{range .KubeletArgs }} {{.}}{{ end }}"
|
||||
ExecStart=
|
||||
ExecStart=/usr/local/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_CONFIG_ARGS $KUBELET_KUBEADM_ARGS $KUBELET_EXTRA_ARGS
|
||||
`)))
|
||||
|
|
|
|||
|
|
@ -55,6 +55,10 @@ spec:
|
|||
#skipConfigureOS: true # Do not pre-configure the host OS (e.g. kernel modules, /etc/hosts, sysctl.conf, NTP servers, etc). You will have to set these things up via other methods before using KubeKey.
|
||||
|
||||
kubernetes:
|
||||
#kubelet start arguments
|
||||
#kubeletArgs:
|
||||
# Directory path for managing kubelet files (volume mounts, etc).
|
||||
# - --root-dir=/var/lib/kubelet
|
||||
version: v1.21.5
|
||||
# Optional extra Subject Alternative Names (SANs) to use for the API Server serving certificate. Can be both IP addresses and DNS names.
|
||||
apiserverCertExtraSans:
|
||||
|
|
|
|||
Loading…
Reference in New Issue