- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我是Docker的初学者。想知道这样做是否是一种好习惯,什么是最好的方法呢?
系统:Ubuntu LTS 16.04.2
我想在具有代理的服务器上部署Kubernetes。由于某些问题,我使用polipo将sock5代理转换为http代理。 http代理已成功应用于终端。然后我搜索了:
https://docs.docker.com/engine/admin/systemd/#http-proxy
并且我在 /etc/systemd/system/docker.service.d/http-proxy.conf 中添加了HTTP_PROXY环境变量:
[Service]
Environment="HTTP_PROXY=http://127.0.0.1:8123/"
$ sudo systemctl show --property Environment docker Environment=HTTP_PROXY=http://127.0.0.1:8123/
$ sudo systemctl daemon-reload
$ sudo systemctl restart docker
# kubeadm init
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.
# 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)
最佳答案
安装它,我进行了修改以在docker&kubelet之间对齐cfgroups:
docker 信息| grep -i cgroup
在文件 /etc/systemd/system/kubelet.service.d/10-kubeadm.conf中
修改相应的行以具有:
Environment =“KUBELET_CGROUP_ARGS =-cgroup-driver = cgroupfs”
再见
关于docker - 如何为Docker配置Polipo的HTTP代理以部署Kubernetes,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47122761/
我是一名优秀的程序员,十分优秀!