问题是 kubelets /etc/kubernetes/manifests/kube-proxy.yaml 中的配置问题
该行 - --master=https:// 需要 https:// 而我只有 IP 192.168.3.220。下面是我的工作 kube-proxy.yaml
apiVersion: v1
kind: Pod
metadata:
name: kube-proxy
namespace: kube-system
spec:
hostNetwork: true
containers:
- name: kube-proxy
image: quay.io/coreos/hyperkube:v1.6.1_coreos.0
command:
- /hyperkube
- proxy
- --master=https://192.168.3.240
- --kubeconfig=/etc/kubernetes/worker-kubeconfig.yaml
- --proxy-mode=iptables
securityContext:
privileged: true
volumeMounts:
- mountPath: /etc/ssl/certs
name: "ssl-certs"
- mountPath: /etc/kubernetes/worker-kubeconfig.yaml
name: "kubeconfig"
readOnly: true
- mountPath: /etc/kubernetes/ssl
name: "etc-kube-ssl"
readOnly: true
volumes:
- name: "ssl-certs"
hostPath:
path: "/usr/share/ca-certificates"
- name: "kubeconfig"
hostPath:
path: "/etc/kubernetes/worker-kubeconfig.yaml"
- name: "etc-kube-ssl"
hostPath:
path: "/etc/kubernetes/ssl"
很棒的指南,只是在这方面有点误导,因为在它之前的 /etc/systemd/system/kubelet.service 的直接代码片段中它有 --api-servers=https://${MASTER_HOST} \ 带有 https:// ,因为 /etc/kubernetes/manifests/kube-proxy.yaml 的 yaml 有 - --master=${MASTER_HOST} 没有 https:// 前缀