Overriding service via drop-in file instead of sed

fixes https://github.com/rook/rook/issues/1057
This commit is contained in:
Steve Leon committed 2017-10-12 17:02:57 -07:00
1 parent 9fab5fb404
commit cbb96feb1d
1 file changed
+4 -1
+4 -1
View File
@@ -22,7 +22,10 @@ install_master(){
# This is needed on K8S 1.6 to fix a regression. https://github.com/kubernetes/kubernetes/issues/47109
if [[ $KUBE_VERSION == v1.6* ]] ;
then
sudo sed -i 's/KUBELET_SYSTEM_PODS_ARGS=/KUBELET_SYSTEM_PODS_ARGS=--enable-controller-attach-detach=false /g' /etc/systemd/system/kubelet.service.d/10-kubeadm.conf
cat << EOF | sudo tee -a /etc/systemd/system/kubelet.service.d/11-disable_attachdetach_controller.conf
[Service]
Environment="KUBELET_SYSTEM_PODS_ARGS=--pod-manifest-path=/etc/kubernetes/manifests --allow-privileged=true --enable-controller-attach-detach=false"
EOF
sudo systemctl daemon-reload
fi