diff --git a/files/1.14/kubelet.service b/files/1.14/kubelet.service new file mode 100644 index 000000000..28a3b062a --- /dev/null +++ b/files/1.14/kubelet.service @@ -0,0 +1,21 @@ +[Unit] +Description=Kubernetes Kubelet +Documentation=https://github.com/kubernetes/kubernetes +After=docker.service +Requires=docker.service + +[Service] +ExecStartPre=/sbin/iptables -P FORWARD ACCEPT +ExecStart=/usr/bin/kubelet --cloud-provider aws \ + --config /etc/kubernetes/kubelet/kubelet-config.json \ + --kubeconfig /var/lib/kubelet/kubeconfig \ + --container-runtime docker \ + --network-plugin cni $KUBELET_ARGS $KUBELET_EXTRA_ARGS + +Restart=on-failure +RestartForceExitStatus=SIGPIPE +RestartSec=5 +KillMode=process + +[Install] +WantedBy=multi-user.target diff --git a/install-worker.sh b/install-worker.sh index f57836812..8b4bbe9df 100644 --- a/install-worker.sh +++ b/install-worker.sh @@ -194,7 +194,11 @@ sudo mkdir -p /etc/kubernetes/kubelet sudo mkdir -p /etc/systemd/system/kubelet.service.d sudo mv $TEMPLATE_DIR/kubelet-kubeconfig /var/lib/kubelet/kubeconfig sudo chown root:root /var/lib/kubelet/kubeconfig -sudo mv $TEMPLATE_DIR/kubelet.service /etc/systemd/system/kubelet.service +if [ "$KUBERNETES_MINOR_VERSION" = "1.14" ]; then + sudo mv $TEMPLATE_DIR/1.14/kubelet.service /etc/systemd/system/kubelet.service +else + sudo mv $TEMPLATE_DIR/kubelet.service /etc/systemd/system/kubelet.service +fi sudo chown root:root /etc/systemd/system/kubelet.service sudo mv $TEMPLATE_DIR/$KUBELET_CONFIG /etc/kubernetes/kubelet/kubelet-config.json sudo chown root:root /etc/kubernetes/kubelet/kubelet-config.json