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

Allow setting additional operator flags via the Helm chart #7252

Merged
merged 2 commits into from
Oct 24, 2023

Conversation

naemono
Copy link
Contributor

@naemono naemono commented Oct 19, 2023

closes #6091

What is this change?

Allows setting the following Operator flags via the Helm chart:

  • -disable-config-watch
  • -ip-family
  • -operator-namespace # is set indirectly via .Release.Namespace
  • -ubi-only
  • -webhook-secret

Notes for review

-operator-namespace isn't allowed to be set directly, but is set indirectly via whatever namespace the Helm chart is installed within {{ .Release.Namespace }}.
-config is not allowed to be set at all, as it doesn't make sense in the context of a Helm chart. (It's used in the statefulset template --config=/conf/eck.yaml.

Testing done

❯ helm upgrade -i elastic-operator . -n elastic-system --create-namespace --set=config.disableConfigWatch=true --set=config.ipFamily=IPv4 --set=config.ubiOnly=true --set=image.tag=2.9.0

❯ kubectl get cm -n elastic-system elastic-operator -o yaml | yq '.data["eck.yaml"]'
log-verbosity: 0
metrics-port: 0
container-registry: docker.elastic.co
max-concurrent-reconciles: 3
ca-cert-validity: 8760h
ca-cert-rotate-before: 24h
cert-validity: 8760h
cert-rotate-before: 24h
disable-config-watch: true
exposed-node-labels: [topology.kubernetes.io/.*,failure-domain.beta.kubernetes.io/.*]
ip-family: IPv4
set-default-security-context: auto-detect
kube-client-timeout: 60s
elasticsearch-client-timeout: 180s
disable-telemetry: false
distribution-channel: helm
validate-storage-class: true
enable-webhook: true
webhook-name: elastic-operator.elastic-system.k8s.elastic.co
webhook-port: 9443
operator-namespace: elastic-system
enable-leader-election: true
elasticsearch-observation-interval: 10s
ubi-only: true

Signed-off-by: Michael Montgomery <mmontg1@gmail.com>
@naemono naemono added >enhancement Enhancement of existing functionality :helm-charts labels Oct 19, 2023
Signed-off-by: Michael Montgomery <mmontg1@gmail.com>
@@ -14,5 +15,7 @@ disable-telemetry: false
distribution-channel: image
validate-storage-class: true
enable-webhook: false
operator-namespace: elastic-system
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default is empty string?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is coming from manifest-gen which defaults to using the 'elastic-system' namespace when generating yaml from the helm charts.

cmd.Flags().StringVarP(&generateFlags.OperatorNamespace, "namespace", "n", "elastic-system", "Operator namespace")

And with the addition of operator-namespace: {{ .Release.Namespace }}, this is why it's now defaulting to setting this in the default configuration.

If preferred, I can just remove this from the template, as it really isn't getting us anything.

Copy link
Collaborator

@pebrc pebrc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise lgtm

deploy/eck-operator/values.yaml Show resolved Hide resolved
@naemono naemono merged commit 4685042 into elastic:main Oct 24, 2023
@naemono naemono deleted the 6091-add-additional-operator-flags-helm branch October 24, 2023 13:41
@naemono
Copy link
Contributor Author

naemono commented Oct 24, 2023

💚 All backports created successfully

Status Branch Result
2.10

Questions ?

Please refer to the Backport tool documentation

naemono added a commit to naemono/cloud-on-k8s that referenced this pull request Oct 24, 2023
* Allow setting additional operator flags.
---------
Signed-off-by: Michael Montgomery <mmontg1@gmail.com>
(cherry picked from commit 4685042)
naemono added a commit that referenced this pull request Oct 24, 2023
* Allow setting additional operator flags.
---------
Signed-off-by: Michael Montgomery <mmontg1@gmail.com>
(cherry picked from commit 4685042)
@thbkrkr thbkrkr changed the title Allow setting additional Operator flags. Allow setting additional operator flags via the Helm chart Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement Enhancement of existing functionality :helm-charts v2.10.0 v2.11.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Operator flags not available through Helm
3 participants