How can we patch the ECK operator to watch multiple namespaces

I ahve patched it ONCE to watch one namespace other than default ... But how do you patch for multiple ...

ECK worked for the first one but without patching doesn't for the second one. How do we add to the list of namespaces for ECK to watch... What would be the JSON string for that

patch statefulset/elastic-operator
-n elastic-system
--type='json'
--patch '[{"op":"add","path":"/spec/template/spec/containers/0/env/-","value": {"name": "NAMESPACE", "value": "elastic"}}]'

In the current version ECK supports only one of two modes of operation, you can either watch all namespaces (set NAMESPACE to the empty string or omit the environment variable alltogether) or restrict the operator to one specific namespace by setting NAMESPACE to that namespace.

Hi @pebrc,
I see this answer is from Sept 2019,
but now I can see namespaces which is Namespaces in which this operator should manage resources. Accepts multiple comma-separated values. Defaults to all namespaces if empty or unspecified.
Am i understanding it correctly ?

Yes you are understanding correctly. This restriction has been lifted in version 1.0 of ECK https://www.elastic.co/guide/en/cloud-on-k8s/master/release-notes-1.0.0.html

You can now also specify a list of namespaces to watch as a comma-separated list.

1 Like

Thanks