问题
I am have configured kubernetes 1.6.2 in centos 7, 3 node cluster. when I deploy the pods I get the uniq ip address for each pod. also I see network ineterface created docker0, flannel.1 and cni0 created. But when I query etcd I didn't see any value.
# kubectl get pods -o wide
NAME READY STATUS RESTARTS AGE IP NODE
node-hello-3045857680-fg1b4 1/1 Running 0 1h 10.244.1.3 node-01
node-hello-3045857680-q84jt 1/1 Running 0 1h 10.244.2.4 node-02
node-hello-3045857680-sbcz0 1/1 Running 0 2h 10.244.2.3 node-02
node-hello-3045857680-tmjgr 1/1 Running 0 1h 10.244.2.5 node-02
node-hello-3045857680-wwhn4 1/1 Running 0 2h 10.244.1.2 node-01
i deployed these to yaml files.
kubectl create -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel-rbac.yml
kubectl create -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
# etcdctl get /atomic.io/network/config
{"Network":"10.20.0.0/16"}
# etcdctl ls / --recursive
/atomic.io
/atomic.io/network
/atomic.io/network/config
Api process configured to talk to etcd.
root 4597 4571 1 20:52 ? 00:02:29 kube-apiserver --admission-control=NamespaceLifecycle,LimitRanger,ServiceAccount,PersistentVolumeLabel,DefaultStorageClass,ResourceQuota,DefaultTolerationSeconds --requestheader-username-headers=X-Remote-User --requestheader-extra-headers-prefix=X-Remote-Extra- --requestheader-allowed-names=front-proxy-client --service-cluster-ip-range=10.96.0.0/12 --client-ca-file=/etc/kubernetes/pki/ca.crt --kubelet-client-certificate=/etc/kubernetes/pki/apiserver-kubelet-client.crt --insecure-port=0 --storage-backend=etcd3 --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname --service-account-key-file=/etc/kubernetes/pki/sa.pub --requestheader-client-ca-file=/etc/kubernetes/pki/front-proxy-ca.crt --allow-privileged=true --experimental-bootstrap-token-auth=true --requestheader-group-headers=X-Remote-Group --tls-cert-file=/etc/kubernetes/pki/apiserver.crt --kubelet-client-key=/etc/kubernetes/pki/apiserver-kubelet-client.key --secure-port=6443 --tls-private-key-file=/etc/kubernetes/pki/apiserver.key --authorization-mode=RBAC --advertise-address=192.168.15.101 --etcd-servers=http://127.0.0.1:2379
I expected to see newly created IP address in the etcd database not sure why its not updating to etcd.
any help to resolve this issue.
Thanks -SR
回答1:
Kubernetes >1.6 is using by default etcd v3, from what I can see you are querying etcd v2, so you are not seeing the current kubernetes keys. In order to query etcd v3, you have to set ETCDCTL_API=3
and then check for the specific key. Keep in mind, that etcdctl v3 commands are not the same as for etcd v2. Check it here: https://github.com/coreos/etcd/tree/master/etcdctl
来源:https://stackoverflow.com/questions/43978998/kubernetes-flannel-etcd-not-upading