You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/11/28 01:19:26 UTC

[GitHub] [apisix] Yiyiyimu opened a new issue #2881: request help: problem to access etcd when deploy on kubernetes

Yiyiyimu opened a new issue #2881:
URL: https://github.com/apache/apisix/issues/2881


   ### Issue description
   ```
   $ k logs apisix-gw-deployment-56467f797f-pcdws
   got malformed version message: "" from etcd
   ```
   which means no version message returned from etcdctl so no etcd cluster could be accessed (BTW we need to change this error to make it readable).
   
   ### Reproduce steps
   Deploy on clean minikube, follow [etcd operator guidance](https://github.com/coreos/etcd-operator) to build example etcd operator and cluster, and test it works.
   Follow [apisix/kubernetes](https://github.com/apache/apisix/tree/master/kubernetes) to deploy apisix.
   
   To get coredns cluster IP and check etcd cluster is running.
   ```shell
   $ k get service --namespace=kube-system
   NAME       TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)                  AGE
   kube-dns   ClusterIP   10.96.0.10   <none>        53/UDP,53/TCP,9153/TCP   35m
   $ k get pods
   NAME                                    READY   STATUS             RESTARTS   AGE
   etcd-operator-66f94b6847-bgmtb          1/1     Running            0          35m
   example-etcd-cluster-89gq9568bd         1/1     Running            0          33m
   example-etcd-cluster-hgm2tpp554         1/1     Running            0          34m
   example-etcd-cluster-w6whjldjqp         1/1     Running            0          33m
   ```
   config.yaml
   ```yaml
   dns_resolver:
     - 10.96.0.10      # default coreDNS cluster ip
   etcd:
     host:
       - "http://etcd-cluster-client.default.svc.cluster.local:2379"  
   ```
   
   And then deploy:
   ```shell
   kubectl create configmap apisix-gw-config.yaml --from-file=../conf/config.yaml
   kubectl apply -f deployment.yaml
   kubectl apply -f service.yaml
   ```
   Got
   ```
   $ k get pods
   NAME                                    READY   STATUS             RESTARTS   AGE
   apisix-gw-deployment-56467f797f-pcdws   0/1     CrashLoopBackOff   9          22m
   apisix-gw-deployment-56467f797f-tr9rc   0/1     CrashLoopBackOff   9          22m
   etcd-operator-66f94b6847-bgmtb          1/1     Running            0          48m
   example-etcd-cluster-89gq9568bd         1/1     Running            0          47m
   example-etcd-cluster-hgm2tpp554         1/1     Running            0          48m
   example-etcd-cluster-w6whjldjqp         1/1     Running            0          46m
   
   $ k describe pod apisix-gw-deployment-56467f797f-pcdws
   ...
   Events:
     Type     Reason     Age                   From               Message
     ----     ------     ----                  ----               -------
     Normal   Scheduled  22m                   default-scheduler  Successfully assigned default/apisix-gw-deployment-56467f797f-pcdws to minikube
     Normal   Pulling    22m                   kubelet, minikube  Pulling image "busybox:latest"
     Normal   Pulled     22m                   kubelet, minikube  Successfully pulled image "busybox:latest"
     Normal   Created    22m                   kubelet, minikube  Created container init-sysctl
     Normal   Started    22m                   kubelet, minikube  Started container init-sysctl
     Normal   Created    21m (x4 over 22m)     kubelet, minikube  Created container apisix-gw-deployment
     Normal   Started    21m (x4 over 22m)     kubelet, minikube  Started container apisix-gw-deployment
     Normal   Pulled     21m (x5 over 22m)     kubelet, minikube  Container image "apache/apisix:latest" already present on machine
     Warning  BackOff    2m26s (x94 over 22m)  kubelet, minikube  Back-off restarting failed container
   
   $ k logs apisix-gw-deployment-56467f797f-pcdws
   got malformed version message: "" from etcd
   ```
   
   I think maybe I use the incorrect dns_resolver IP, but I'm not sure how to fix it
   
   ### Environment
   
   * apisix version (cmd: `apisix version`): apache:apisix/latest
   * OS: WSL2
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] gxthrj commented on issue #2881: request help: problem to access etcd when deploy on kubernetes

Posted by GitBox <gi...@apache.org>.
gxthrj commented on issue #2881:
URL: https://github.com/apache/apisix/issues/2881#issuecomment-735343963


   @Yiyiyimu Please show the `svc` of etcd in default namespace.
   The config.yaml as below, make sure the svc name is `etcd-cluster-client`
   ```yaml
   etcd:
     host:
       - "http://etcd-cluster-client.default.svc.cluster.local:2379"  
   ```
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] Yiyiyimu closed issue #2881: request help: problem to access etcd when deploy on kubernetes

Posted by GitBox <gi...@apache.org>.
Yiyiyimu closed issue #2881:
URL: https://github.com/apache/apisix/issues/2881


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] spacewander commented on issue #2881: request help: problem to access etcd when deploy on kubernetes

Posted by GitBox <gi...@apache.org>.
spacewander commented on issue #2881:
URL: https://github.com/apache/apisix/issues/2881#issuecomment-735024193


   CC @nic-chen 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] Yiyiyimu commented on issue #2881: request help: problem to access etcd when deploy on kubernetes

Posted by GitBox <gi...@apache.org>.
Yiyiyimu commented on issue #2881:
URL: https://github.com/apache/apisix/issues/2881#issuecomment-735384386


   Thank you @nic-chen @gxthrj! Yes I use the wrong name for service, the default one is not what we want. Thanks again!!


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] moonming commented on issue #2881: request help: problem to access etcd when deploy on kubernetes

Posted by GitBox <gi...@apache.org>.
moonming commented on issue #2881:
URL: https://github.com/apache/apisix/issues/2881#issuecomment-735033229


   cc @gxthrj 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] nic-chen commented on issue #2881: request help: problem to access etcd when deploy on kubernetes

Posted by GitBox <gi...@apache.org>.
nic-chen commented on issue #2881:
URL: https://github.com/apache/apisix/issues/2881#issuecomment-735165736


   @Yiyiyimu  
   I think in `init_etcd` it doesn't use `dns_resolver` yet.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org