Deploy ECK to a Single Namespace

Hi,

I would like to deploy ECK within a single namespace, but it is not clear to me how to do so after reading
https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-ns-config.html
and
https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-operator-config.html.

Not sure exactly how to specify thoes options. Can someone give me a quick example?

Thanks
Kc

@nobound you can set them as args or env vars in the operator stateful set. For example here:

Thanks for the reply.

Does it mean I should not use the
https://download.elastic.co/downloads/eck/1.0.0-beta1/all-in-one.yaml?

I should just customize the template yaml file to deploy the ECK. Right?

I follow the instructions (https://github.com/elastic/cloud-on-k8s/tree/1.0/config/operator) to generate yaml file for namespace operator that manages resources in a given namespace.

OPERATOR_IMAGE=docker.elastic.co/eck/eck-operator:1.0.0-beta NAMESPACE=test MANAGED_NAMESPACE=test make generate-namespace > namespace.yaml

Is that right?

Thanks

Does it mean I should not use the
https://download.elastic.co/downloads/eck/1.0.0-beta1/all-in-one.yaml?

The easiest way would be to use that, but edit the args first. Sorry for the confusion, I was just linking the template as an example of where the args are in the all-in-one. So around line 3024 in the all-in-one you can add them either as args or environment variables. Does that make help?

Thanks for the clarification.
I sort of figure out what you meant as I am poking around those configuration templates.

@Anya_Sabo I found my way here in search of the same thing. I'm a bit confused by the terminology in the docs. Is it possible to deploy everything(ECK and CRDs) within a single namespace? Working on a huge multi-tenant system and I'm limited to what I can deploy in my namespace.

@supermancc03 I think (not tested in a while) this is possible but requires some tweaking.
Basically you can change the ClusterRole and ClusterRoleBinding from the all-in-one manifests to their corresponding Role and RoleBinding translations, with your desired namespace.
Then, you can patch the operator StatefulSet manifest to be deployed in the desired namespace. Also make sure the --namespaces flag of the operator cmd matches the namespace you want the operator to work with (probably the same it's deployed in).

However, you can only deploy the CRDs cluster-wide, AFAIK it is not possible to limit a CustomResourceDefinition resource to a particular namespace. And it looks it's not going to be supported anytime soon.

I understand this feels a bit hacky. I'm opening an issue to track this so we can come up with an easier way to generate your own flavor of the manifests: https://github.com/elastic/cloud-on-k8s/issues/2406

1 Like