systemd
Configure Scheduled Tasks with systemd timer
· β˜• 4 min read
1. Preparing the Scheduled Script If it is a Bash script, the first line needs to specify the interpreter. 1 2 mkdir -p /root/scripts vim /root/scripts/quick-clear.sh 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 #!/bin/sh /usr/local/bin/kubectl --kubeconfig /root/.kube/config get pods --all-namespaces -o wide | grep Evicted | awk '{print $1,$2}' | xargs --no-run-if-empty -L1 /usr/local/bin/kubectl --kubeconfig /root/.

How to Change Kubelet Startup Parameters
· β˜• 1 min read
1. Edit the Kubelet Configuration File 1 vim /etc/systemd/system/kubelet.service.d/10-kubeadm.conf Modify the relevant Kubelet parameters ExecStart=/usr/local/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_CONFIG_ARGS $KUBELET_KUBEADM_ARGS $KUBELET_EXTRA_ARGS You can list the available parameters with the following command: 1 kubelet --help For example, if you need to change --sync-frequency in KUBELET_KUBECONFIG_ARGS, the period for syncing container configuration, the default value is 1 min.