Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // KubeletServiceTempl defines the template of kubelete service for systemd. KubeletServiceTempl = template.Must(template.New("kubeletService").Parse( dedent.Dedent(`[Unit] Description=kubelet: The Kubernetes Node Agent Documentation=http://kubernetes.io/docs/ [Service] ExecStart=/usr/local/bin/kubelet Restart=always StartLimitInterval=0 RestartSec=10 [Install] WantedBy=multi-user.target `))) // KubeletEnvTempl defines the template of kubelet's Env for the kubelet's systemd service. KubeletEnvTempl = template.Must(template.New("kubeletEnv").Parse( dedent.Dedent(`# Note: This dropin only works with kubeadm and kubelet v1.11+ [Service] Environment="KUBELET_KUBECONFIG_ARGS=--bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf" Environment="KUBELET_CONFIG_ARGS=--config=/var/lib/kubelet/config.yaml" # This is a file that "kubeadm init" and "kubeadm join" generate at runtime, populating the KUBELET_KUBEADM_ARGS variable dynamically 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 }}" ExecStart= ExecStart=/usr/local/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_CONFIG_ARGS $KUBELET_KUBEADM_ARGS $KUBELET_EXTRA_ARGS `))) )
Functions ¶
func GenerateKubeletEnv ¶
func GenerateKubeletEnv(node *kubekeyapiv1alpha1.HostCfg) (string, error)
GenerateKubeletEnv is used to generate the env content of kubelet's service for systemd.
func GenerateKubeletService ¶
GenerateKubeletService is used to generate kubelet's service content for systemd.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.