You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apisix.apache.org by "Li Ling(Lien)" <li...@apache.org> on 2020/10/10 03:16:16 UTC

[discuss] retry etcd host in the init_etcd phase when deploy in k8s

Hello, dev,
recently I am working on installing APISIX via helm chart into K8S with
etcd as dependent.
Due to the  mechanism of  in-house DNS,after the etcd pod is ready,it would
take some time (usually 5~10 seconds)before the internal domain can be
correctly resolved.

here comes two ideas to solve this problem:
1、add a *wait_etcd *phase before init_etcd, to check if the etcd is live or
not.
which means will need to change the code in /bin/apisix
2、change deployment.yaml of helm, add initContainers command to it.

what do you think?

[image: image.png]
Thanks,
Lien Li

Re: [discuss] retry etcd host in the init_etcd phase when deploy in k8s

Posted by YuanSheng Wang <me...@apache.org>.
The option 2 seems clearer. we can add it first.

Create an issue about the option `1`, it can be a todo feature for APISIX.
Implement it later.


On Sat, Oct 10, 2020 at 11:52 AM dabue <88...@qq.com> wrote:

> I prefer option 2 .
>
>
>
> 88786912@qq.com
>
> From: Li Ling(Lien)
> Date: 2020-10-10 11:16
> To: dev
> Subject: [discuss] retry etcd host in the init_etcd phase when deploy in
> k8s
> Hello, dev,
> recently I am working on installing APISIX via helm chart into K8S with
> etcd as dependent.
> Due to the  mechanism of  in-house DNS,after the etcd pod is ready,it
> would take some time (usually 5~10 seconds)before the internal domain can
> be correctly resolved.
>
> here comes two ideas to solve this problem:
> 1、add a wait_etcd phase before init_etcd, to check if the etcd is live or
> not.
> which means will need to change the code in /bin/apisix
> 2、change deployment.yaml of helm, add initContainers command to it.
>
> what do you think?
>
>
> Thanks,
> Lien Li
>


-- 

*MembPhis*
My GitHub: https://github.com/membphis
Apache APISIX: https://github.com/apache/incubator-apisix

Re: [discuss] retry etcd host in the init_etcd phase when deploy in k8s

Posted by dabue <88...@qq.com>.
I prefer option 2 .



88786912@qq.com
 
From: Li Ling(Lien)
Date: 2020-10-10 11:16
To: dev
Subject: [discuss] retry etcd host in the init_etcd phase when deploy in k8s
Hello, dev,
recently I am working on installing APISIX via helm chart into K8S with etcd as dependent.
Due to the  mechanism of  in-house DNS,after the etcd pod is ready,it would take some time (usually 5~10 seconds)before the internal domain can be correctly resolved.

here comes two ideas to solve this problem:
1、add a wait_etcd phase before init_etcd, to check if the etcd is live or not.
which means will need to change the code in /bin/apisix
2、change deployment.yaml of helm, add initContainers command to it. 

what do you think?


Thanks,
Lien Li

Re: [discuss] retry etcd host in the init_etcd phase when deploy in k8s

Posted by "Li Ling(Lien)" <li...@apache.org>.
I think by adding a initcontainers should fix this.

>   initContainers:
>       - name: init-apisix
>         image: busybox:1.28
>         command: ['sh', '-c', "until nslookup {{ .Release.Name
> }}-etcd-0.{{ .Release.Name }}-etcd.{{ .Release.Namespace }}.svc.{{
> .Values.gateway.k8s_domain }}; do echo waiting for etcd-0; sleep 2; done"]
>
>

Li Ling(Lien) <li...@apache.org> 于2020年10月10日周六 上午11:16写道:

> Hello, dev,
> recently I am working on installing APISIX via helm chart into K8S with
> etcd as dependent.
> Due to the  mechanism of  in-house DNS,after the etcd pod is ready,it
> would take some time (usually 5~10 seconds)before the internal domain can
> be correctly resolved.
>
> here comes two ideas to solve this problem:
> 1、add a *wait_etcd *phase before init_etcd, to check if the etcd is live
> or not.
> which means will need to change the code in /bin/apisix
> 2、change deployment.yaml of helm, add initContainers command to it.
>
> what do you think?
>
> [image: image.png]
> Thanks,
> Lien Li
>