Skip to content

Instantly share code, notes, and snippets.

@johnmarcou
Last active February 9, 2018 04:41
Show Gist options
  • Save johnmarcou/5486c5e0f9b89b0619d958e7584d5c9c to your computer and use it in GitHub Desktop.
Save johnmarcou/5486c5e0f9b89b0619d958e7584d5c9c to your computer and use it in GitHub Desktop.
Deploy CRIPROXY on CoreOS
set -x
mkdir -p /opt/bin/
#wget -O /opt/bin/criproxy https://github.com/Mirantis/criproxy/releases/download/v0.9.4/criproxy
chmod +x /opt/bin/criproxy
if [ ! -f /etc/systemd/system/kubelet.service.origin ]; then
cp /etc/systemd/system/kubelet.service /etc/systemd/system/kubelet.service.origin
fi
cp /etc/systemd/system/kubelet.service.origin /etc/systemd/system/dockershim.service
cp /etc/systemd/system/kubelet.service.origin /etc/systemd/system/kubelet.service
sed -i -e 's?--allow-privileged?--experimental-dockershim --port 11250 --allow-privileged?' /etc/systemd/system/dockershim.service
sed -i -e 's?--allow-privileged?--container-runtime=remote --container-runtime-endpoint=unix:///run/criproxy.sock --image-service-endpoint=unix:///run/criproxy.sock --enable-controller-attach-detach=false --allow-privileged?' /etc/systemd/system/kubelet.service
cat > /etc/systemd/system/criproxy.service <<EOF
[Unit]
Description=CRI Proxy
[Service]
ExecStart=/opt/bin/criproxy -v 3 -logtostderr -connect /var/run/dockershim.sock,virtlet.cloud:/run/virtlet.sock -listen /run/criproxy.sock
Restart=always
StartLimitInterval=0
RestartSec=10
[Install]
WantedBy=kubelet.service
EOF
mkdir -p /etc/cni/net.d/
cp -R /etc/kubernetes/cni/net.d/* /etc/cni/net.d/.
sed -i -e 's?/etc/kubernetes/cni/net.d/calico-kubeconfig?/etc/cni/net.d/calico-kubeconfig?' /etc/cni/net.d/10-calico.conflist
systemctl stop kubelet
systemctl daemon-reload
systemctl enable criproxy dockershim
systemctl start criproxy dockershim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment