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

MongoDB Standalone - issue with templates #250

Open
gauravjain1582 opened this issue Sep 16, 2021 · 1 comment
Open

MongoDB Standalone - issue with templates #250

gauravjain1582 opened this issue Sep 16, 2021 · 1 comment
Labels
bug Something isn't working component:mongodb help wanted Extra attention is needed

Comments

@gauravjain1582
Copy link

gauravjain1582 commented Sep 16, 2021

Folks, I observed an issue with init jobs config (for deployments relay on mongodb), specifically when mongoDB set to run in standalone architecture.
k8s do not create headless service for standalone mode, hence a service/endpoint should be referred in place of headless services.

Following need some logical handing for standalone mode.
until nc -z -w 2 {{ $.Release.Name }}-mongodb-headless {{ $mongodb_port }} && echo mongodb ok;

--->

until nc -z -w 2 {{ $.Release.Name }}-mongodb {{ $mongodb_port }} && echo mongodb ok;

`

{{- $mongodb_port := (int (index .Values "mongodb" "service" "port")) }}
- name: wait-for-db
  image: busybox:1.28
  command:
    - 'sh'
    - '-c'
    - >
      until nc -z -w 2 {{ $.Release.Name }}-mongodb-headless {{ $mongodb_port }} && echo mongodb ok;
        do
          echo 'Waiting for MongoDB Connection...'
          sleep 2;
      done
{{- end }}
{{- end -}}

let me know if anyone able to reproduce it.

Thanks

@cognifloyd
Copy link
Member

The relevant sections of the template are here:
https://github.com/StackStorm/stackstorm-ha/blob/8388b0bb741be1f1c77ab7d942f9c0e4aae23624/templates/_helpers.tpl#L42-L55
https://github.com/StackStorm/stackstorm-ha/blob/8388b0bb741be1f1c77ab7d942f9c0e4aae23624/templates/_helpers.tpl#L89-L104

It is interesting that we handle the non -headless case in one helper but not the other. I would be happy to review a PR that improves this. Thanks!

@cognifloyd cognifloyd added component:mongodb help wanted Extra attention is needed bug Something isn't working labels Nov 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working component:mongodb help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants