Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nsq: make nsqadmin wait for lookupd #8

Open
LordNoteworthy opened this issue Aug 18, 2021 · 1 comment
Open

nsq: make nsqadmin wait for lookupd #8

LordNoteworthy opened this issue Aug 18, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@LordNoteworthy
Copy link
Contributor

LordNoteworthy commented Aug 18, 2021

Hello @benjamin658

This is not a bug, but probably an enhancement we can do to nsqadmin.

What basically happens when you install the chart, nsqadmin is the first candidate that quickly get fetched and when the container run, it output the following error:

[nsqadmin] 2021/08/18 09:32:32.771223 FATAL: failed to instantiate nsqadmin -
failed to resolve --lookupd-http-address (jupiter-nsqlookupd-0.jupiter-nsqlookupd:4161) -
lookup jupiter-nsqlookupd-0.jupiter-nsqlookupd on 10.96.0.10:53: no such host

Then it get restarted for few times until nsqlookupd is ready, then it starts. It looks a bit ugly to see that the container has crashed few times.

This is normal because nsqadmin does not wait for lookupd to start. I have this problem anytime I have a container which depends on another one. The way I get arround this is by adding an side car container that wait for the dependency to show up. Something like this:

initContainers:
  - name: wait-for-db
    image: groundnuty/k8s-wait-for:v1.3
    imagePullPolicy: Always
    args:
      - "pod"
        - "-lapp=mysql"

Not sure if this is the best way to do it :)

Cheers.

@benjamin658
Copy link
Member

benjamin658 commented Aug 18, 2021

Hi @LordNoteworthy , thanks for your feedback.

I also notice this imperfection.
It's a good idea to run a wait-for init container to wait until the nsqlookupd pod becomes ready.
I will do it these days.

Thanks.

@benjamin658 benjamin658 added the enhancement New feature or request label Aug 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants