Skip to content

Instantly share code, notes, and snippets.

@gangliao
Last active July 16, 2018 11:36
Show Gist options
  • Save gangliao/3989b216c083cabe7b4d3340945ff587 to your computer and use it in GitHub Desktop.
Save gangliao/3989b216c083cabe7b4d3340945ff587 to your computer and use it in GitHub Desktop.
#!/bin/sh
set -x
sudo systemctl stop docker
sudo ip link delete docker0
sudo /usr/bin/cat > /usr/lib/systemd/system/docker.service << EOF
[Unit]
Description=Docker Application Container Engine
Documentation=http://docs.docker.io
[Service]
Environment="HTTP_PROXY=http://10.130.14.129:8080/" "NO_PROXY=localhost,127.0.0.1,10.142.104.73"
Environment="PATH=/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin"
EnvironmentFile=-/run/flannel/docker
ExecStart=/usr/bin/dockerd --insecure-registry=10.142.104.73:8043 --log-level=error \$DOCKER_NETWORK_OPTIONS
ExecReload=/bin/kill -s HUP \$MAINPID
Restart=on-failure
RestartSec=5
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
Delegate=yes
KillMode=process
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl enable docker
sudo systemctl daemon-reload
sudo systemctl start docker
sudo systemctl daemon-reload
sudo systemctl enable kubelet
sudo systemctl start kubelet
sudo systemctl status kubelet
sudo systemctl daemon-reload
sudo systemctl enable kube-proxy
sudo systemctl start kube-proxy
sudo systemctl status kube-proxy
ifconfig docker0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment