I am a beginner of Docker. Wanted to know if it's good practice to do that and what would be the best way to do that?
System: Ubuntu LTS 16.04.2
I want to deploy Kubernetes on my server with proxy. Because of some problem, I used polipo to convert sock5 proxy to http proxy. The http proxy has been successfully applied to the terminal. Then I searched that: https://docs.docker.com/engine/admin/systemd/#http-proxy and I added the HTTP_PROXY environment variable in /etc/systemd/system/docker.service.d/http-proxy.conf:
[Service]
Environment="HTTP_PROXY=http://127.0.0.1:8123/"
and then do that:
$ sudo systemctl show --property Environment docker Environment=HTTP_PROXY=http://127.0.0.1:8123/
$ sudo systemctl daemon-reload
$ sudo systemctl restart docker
and then I successfully installed kubelet kubeadm kubectl kubernetes-cni and I ran this command:
# kubeadm init
here are result of the operation:
root@ubuntu16:~# kubeadm init
[kubeadm] WARNING: kubeadm is in beta, please do not use it for production clusters.
[init] Using Kubernetes version: v1.8.2
[init] Using Authorization modes: [Node RBAC]
[preflight] Running pre-flight checks
[preflight] WARNING: Connection to "https://59.64.78.138:6443" uses proxy
"http://127.0.0.1:8123/". If that is not intended, adjust your proxy settings
[preflight] Starting the kubelet service
[kubeadm] WARNING: starting in 1.8, tokens expire after 24 hours by default (if you require a non-expiring token use --token-ttl 0)
[certificates] Generated ca certificate and key.
[certificates] Generated apiserver certificate and key.
[certificates] apiserver serving cert is signed for DNS names [ubuntu16 kubernetes kubernetes.default kubernetes.default.svc kubernetes.default.svc.cluster.local] and IPs [10.96.0.1 my_server_IP]
[certificates] Generated apiserver-kubelet-client certificate and key.
[certificates] Generated sa key and public key.
[certificates] Generated front-proxy-ca certificate and key.
[certificates] Generated front-proxy-client certificate and key.
[certificates] Valid certificates and keys now exist in "/etc/kubernetes/pki"
[kubeconfig] Wrote KubeConfig file to disk: "admin.conf"
[kubeconfig] Wrote KubeConfig file to disk: "kubelet.conf"
[kubeconfig] Wrote KubeConfig file to disk: "controller-manager.conf"
[kubeconfig] Wrote KubeConfig file to disk: "scheduler.conf"
[controlplane] Wrote Static Pod manifest for component kube-apiserver to "/etc/kubernetes/manifests/kube-apiserver.yaml"
[controlplane] Wrote Static Pod manifest for component kube-controller-manager to "/etc/kubernetes/manifests/kube-controller-manager.yaml"
[controlplane] Wrote Static Pod manifest for component kube-scheduler to "/etc/kubernetes/manifests/kube-scheduler.yaml"
[etcd] Wrote Static Pod manifest for a local etcd instance to "/etc/kubernetes/manifests/etcd.yaml"
[init] Waiting for the kubelet to boot up the control plane as Static Pods from directory "/etc/kubernetes/manifests"
[init] This often takes around a minute; or longer if the control plane images have to be pulled.
Then it does not go ahead and I ran
# systemctl status kubelet
● kubelet.service - kubelet: The Kubernetes Node Agent
Loaded: loaded (/lib/systemd/system/kubelet.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/kubelet.service.d
└─10-kubeadm.conf, 90-local-extras.conf
Active: active (running) since Sun 2017-11-05 21:17:37 CST; 9min ago
Docs: http://kubernetes.io/docs/
Main PID: 19363 (kubelet)
Tasks: 14
Memory: 39.9M
CPU: 14.229s
CGroup: /system.slice/kubelet.service
└─19363 /usr/bin/kubelet --bootstrap->?
kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/k
Nov 05 21:26:28 ubuntu16 kubelet[19363]: W1105 21:26:28.959628 19363 cni.go:196] Unable to update cni config: No ne
Nov 05 21:26:28 ubuntu16 kubelet[19363]: E1105 21:26:28.960538 19363 kubelet.go:2095] Container runtime network not
Nov 05 21:26:33 ubuntu16 kubelet[19363]: W1105 21:26:33.962500 19363 cni.go:196] Unable to update cni config: No ne
Nov 05 21:26:33 ubuntu16 kubelet[19363]: E1105 21:26:33.963407 19363 kubelet.go:2095] Container runtime network not
Nov 05 21:26:38 ubuntu16 kubelet[19363]: W1105 21:26:38.974986 19363 cni.go:196] Unable to update cni config: No ne
Nov 05 21:26:38 ubuntu16 kubelet[19363]: E1105 21:26:38.975851 19363 kubelet.go:2095] Container runtime network not
Nov 05 21:26:43 ubuntu16 kubelet[19363]: W1105 21:26:43.977879 19363 cni.go:196] Unable to update cni config: No ne
Nov 05 21:26:43 ubuntu16 kubelet[19363]: E1105 21:26:43.978806 19363 kubelet.go:2095] Container runtime network not
Nov 05 21:26:48 ubuntu16 kubelet[19363]: W1105 21:26:48.992642 19363 cni.go:196] Unable to update cni config: No ne
Nov 05 21:26:48 ubuntu16 kubelet[19363]: E1105 21:26:48.993587 19363 kubelet.go:2095] Container runtime network not
lines 1-23/23 (END)
Now I am confused how to solve this problem. I am searching for a long time on net. But no use. Please help or try to give some ideas how to achieve this.
Thanks in advance.