contiv / install

Contiv Installer
https://contiv.github.io
Other
114 stars 56 forks source link

install on kubeadm 1.10 etcd create failed #347

Open like-inspur opened 6 years ago

like-inspur commented 6 years ago

I try to install contiv 1.2.0 on kubeadm 1.10 with only one node, contiv-etcd is CrashLoopBackOff, because etcd proxy has already bind 127.0.0.1:6666. So I delete ds contiv-etcd-proxy, then contiv created successfully. The state of pod and error log of contiv-etcd is like this [root@k8s-206 ~]# kubectl get pod -n kube-system NAME READY STATUS RESTARTS AGE contiv-etcd-proxy-mwzq4 1/1 Running 0 5s contiv-etcd-srfpz 0/1 CrashLoopBackOff 1 5s contiv-netmaster-g6k5n 2/3 Error 0 5s contiv-netplugin-4qc5v 0/2 ContainerCreating 0 5s etcd-k8s-206 1/1 Running 1 6d kube-apiserver-k8s-206 1/1 Running 3 6d kube-controller-manager-k8s-206 1/1 Running 2 6d kube-dns-696b98685-mpzsv 1/3 CrashLoopBackOff 14 11m kube-proxy-pwxkk 1/1 Running 1 5d kube-scheduler-k8s-206 1/1 Running 2 6d

[root@k8s-206 ~]# kubectl log contiv-etcd-srfpz -n kube-system log is DEPRECATED and will be removed in a future version. Use logs instead. 2018-04-11 09:24:24.882049 W | pkg/flags: unrecognized environment variable ETCD_INIT_ARGSFILE=/etc/contiv/etcd/contiv-etcd-args 2018-04-11 09:24:24.882129 I | etcdmain: etcd Version: 3.2.4 2018-04-11 09:24:24.882134 I | etcdmain: Git SHA: c31bec0 2018-04-11 09:24:24.882138 I | etcdmain: Go Version: go1.8.3 2018-04-11 09:24:24.882141 I | etcdmain: Go OS/Arch: linux/amd64 2018-04-11 09:24:24.882145 I | etcdmain: setting maximum number of CPUs to 16, total number of available CPUs is 16 2018-04-11 09:24:24.882175 N | etcdmain: the server is already initialized as member before, starting as etcd member... 2018-04-11 09:24:24.882246 I | embed: listening for peers on http://10.110.25.206:6667 2018-04-11 09:24:24.882298 I | embed: listening for client requests on 10.110.25.206:6666 2018-04-11 09:24:24.882333 I | embed: stopping listening for client requests on 127.0.0.1:6666 2018-04-11 09:24:24.882364 C | etcdmain: listen tcp 127.0.0.1:6666: bind: address already in use

[root@k8s-206 ~]# kubectl delete ds contiv-etcd-proxy -n kube-system daemonset.extensions "contiv-etcd-proxy" deleted

[root@k8s-206 ~]# kubectl get pod -n kube-system NAME READY STATUS RESTARTS AGE contiv-etcd-srfpz 1/1 Running 3 1m contiv-netmaster-g6k5n 3/3 Running 3 1m contiv-netplugin-4qc5v 2/2 Running 0 1m etcd-k8s-206 1/1 Running 1 6d kube-apiserver-k8s-206 1/1 Running 3 6d kube-controller-manager-k8s-206 1/1 Running 2 6d kube-dns-696b98685-mpzsv 2/3 Running 15 12m kube-proxy-pwxkk 1/1 Running 1 5d kube-scheduler-k8s-206 1/1 Running 2 6d

mk01 commented 6 years ago

@like-inspur

to contiv-etcd DaemonSet definition add to spec.template.spec.initContainers.env (contiv-etcd-init)


        - name: ETCD_INIT_LISTEN_ON_LOCALHOST
          value: '0'

otherwise it on start always populates /etc/contiv/etcd/contiv-etcd-args with additional 127.0.0.1:6666 for --listen-client-urls and this conflicts with etcd proxies which listen on 127.0.0.1.

the proxies are started as per scheduling policy, which normally doesn't allow pod scheduling on masters. but as you are running just single node you most probably changed that and now the contiv's etcd master is conflicting with the proxy.

(after you modify the daemon policy and kill the pod (contiv-etcd) - after it restarts all will be fine)