ECK flags and env configurations

Hi,

For configuring Elastic Cloud on Kubernetes (ECK), I tried following the instructions on this link: https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-operator-config.html

I would like to change some of the default values using "environment variables". Can you please clarify where should I configure these? Am I supposed to change the all-in-one.yaml definition of the statefulset? Are those variables supposed to be added to the "values.yaml" of a helm chart? and if so, how? I tried in the values.yaml with either:

env:
  - name: AUTO_PORT_FORWARD
    value: false
  - name: OPERATOR_NAMESPACE
    value: sebas-elastic

and

AUTO_PORT_FORWARD: false
OPERATOR_NAMESPACE: sebas-elastic

I would rather not to change the CRD definition nor use flags during command line deployment (i don't deploy using CLI, but a gitops system instead).

Thank you.

You have to add the environment variable declarations to the manager container template defined in the elastic-operator StatefulSet definition. This is indeed in the all-in-one.yaml file. If you take a look at the all-in-one.yaml, there are already two environment variables declared (OPERATOR_NAMESPACE and WEBHOOK_SECRET). You can add more to that array.

That being said, AUTO_PORT_FORWARD is not a setting you should be concerned about as it is a flag that only takes effect in development mode. OPERATOR_NAMESAPCE is derived automatically from the namespace the operator is deployed to so you don't have to explicitly change it either. Just make sure the operator is deployed to sebas-elastic instead of elastic-system by changing the namespace of resources declared in the all-in-one.yaml.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.