opensearch-k8s-operator: [BUG] Unable to set OPENSEARCH_INITIAL_ADMIN_PASSWORD for bootstrap pod
What is the bug?
Unable to perform new deployment of opensearch 2.12.0 using opensearch-operator 2.5.1.
How can one reproduce the bug?
Create clean opensearch 2.12.0 cluster using opensearch-operator 2.5.1.
What is the expected behavior?
Cluster is up and running including bootstrap pod.
What is your host/environment?
GKE (1.27.8-gke.1067004)
Do you have any additional context?
Opensearch 2.12.0 explicitely requires to set OPENSEARCH_INITIAL_ADMIN_PASSWORD environment variable for each pod. This is possible for nodePools but not for bootstrap pod, as the helm manifest only supports additionalConfig, therefore pod is crashing.
Setting up Custom Admin User does not help, as pod strictly requires OPENSEARCH_INITIAL_ADMIN_PASSWORD defined as the variable.
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 14
- Comments: 19 (2 by maintainers)
Commits related to this issue
- downgrade opensearch cluster to work around https://github.com/opensearch-project/opensearch-k8s-operator/issues/759#issuecomment-2283329133 elifesciences/issues#8911 — committed to elifesciences/journal-team-deployment by scottaubrey 2 years ago
- upgrade opensearch cluster after working around https://github.com/opensearch-project/opensearch-k8s-operator/issues/759#issuecomment-2283329133 elifesciences/issues#8911 — committed to elifesciences/journal-team-deployment by scottaubrey 2 years ago
- Revert "upgrade opensearch cluster after working around https://github.com/opensearch-project/opensearch-k8s-operator/issues/759#issuecomment-2283329133 elifesciences/issues#8911" This reverts commit... — committed to elifesciences/journal-team-deployment by scottaubrey 2 years ago
yeah, Install 2.11.0 and then upgrade to a version you want to. during upgrade, bootstrap pod is no longer used.
I think that once/if https://github.com/opensearch-project/opensearch-k8s-operator/pull/754 is merged, this problem will be solved.
https://github.com/opensearch-project/opensearch-k8s-operator/issues/759#issuecomment-2283329133
My PR was meant to address an issue where the Opensearch security plugin seemingly gets activated but the operator doesn’t correctly setup/bootstrap pods with an initial admin password that meets complexity requirements enforced by the security plugin.
I don’t completely understand how the security plugin works but it looks like this is largely out of scope of the operator and built-in to the Opensearch Docker container. I think installing the s3 repository plugin pulled in the Opensearch security plugin causing bootstrap to fail but I don’t have a very good understanding of how this is supposed to work and couldn’t reliably reproduce it.
There are some docs somewhere for bootstrapping a cluster with your own credentials in the operator docs
It seems like the operator should do something here to play nice with Opensearch security but I don’t have enough knowledge and time to figure out the correct approach.
probably you can add
and it should work, cause operator merge this values to pod env
Hmm I can’t seem to repro on Github Actions even with the config that was causing me errors locally. Maybe there’s some kind of race condition or something at play
It works adding these env vars. The operator can add this var referencing the Secret its stored in with ValueFrom. I’ll put up a PR tonight after work if I have time
I tried to create a cluster with the following config but it’s not working with the same error
This should run a
Jobto follow steps in Custom Admin User butbootstrapstill crashes withNo custom admin password found. Please provide a password via the environment variable OPENSEARCH_INITIAL_ADMIN_PASSWORD.