Kubernete's documention asks you to pass args to systemd services all the time.
The thing that sucks is that every implementation/flavor/distribution of Linux is different and installs things in different places !
And then on top of that every implementation/flavor/installation method of Kubernetes is different as well !!
And then, because that wasn't enough to deal with systemd has like 5 different methods of passing flags/arguments as well !!!
Thus the best way to do this seems to be:
To use the find command to find where *.service is located, and that won't always work either, because some implementations of systemd don't have you pass arguements in the *.service file, but if you search for the name of the service with the find command, you might find a config file where the EXTRA_ARGs are passed, thus I claim find command is the best method for linux noobs. Other than that you'd need to do a deep dive and truly learning the ins and outs of systemd/all 5ish different methods of passing args.
WorkerNodeBash# find / -name "*.service" | grep -i "kube"
WorkerNodeBash# nano /etc/systemd/system/kubelet.service
[Unit]
Description=Kubernetes Kubelet
Documentation=https://github.com/kubernetes/kubernetes
After=containerd.service
Requires=containerd.service
[Service]
ExecStart=/usr/local/bin/kubelet \
--config=/var/lib/kubelet/kubelet-config.yaml \
--container-runtime=remote \
--container-runtime-endpoint=unix:///var/run/containerd/containerd.sock \
--image-pull-progress-deadline=2m \
--kubeconfig=/var/lib/kubelet/kubeconfig \
--network-plugin=cni \
--register-node=true \
--pod-manifest-path=/etc/kubernetes/manifests \
--v=2
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
(The above comes from Kubernetes the hard way implementation, I've also done kubeadm implementation and looked in this same file and saw no args AND when I tried to pass args they were ignored?, but thanks to learning how to use the find command I was able to search:
WorkerNodeBash# find / -type f -name "*.yaml" | grep "kube"
And I found a config file that mentioned
KUBELET_EXTRA_ARGS=, and pass them in there.
/etc/init.d/
and/etc/init/
. – sagarchalise Mar 06 '12 at 18:04