# Deploy ECK to a Single Namespace

**URL:** <https://discuss.elastic.co/t/deploy-eck-to-a-single-namespace/211495>\
**Category:** Elastic Cloud on Kubernetes (ECK)\
**Created:** [December 11, 2019, 4:07pm UTC](https://discuss.elastic.co/t/deploy-eck-to-a-single-namespace/211495 "2019-12-11T16:07:31Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![nobound](https://avatars.discourse-cdn.com/v4/letter/n/f07891/32.png) [@nobound](https://discuss.elastic.co/u/nobound)\
**Post date:** [December 11, 2019, 4:07pm UTC](https://discuss.elastic.co/t/deploy-eck-to-a-single-namespace/211495/1 "2019-12-11T16:07:31Z")

</div>

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](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](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

---

<div class="post-metadata">

**Author:** ![Anya\_Sabo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anya_sabo/32/49903_2.png) [@Anya\_Sabo](https://discuss.elastic.co/u/Anya_Sabo)\
**Post date:** [December 11, 2019, 4:45pm UTC](https://discuss.elastic.co/t/deploy-eck-to-a-single-namespace/211495/2 "2019-12-11T16:45:33Z")

</div>

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

> <https://github.com/elastic/cloud-on-k8s/blob/master/config/operator/global/operator.template.yaml#L24>

---

<div class="post-metadata">

**Author:** ![nobound](https://avatars.discourse-cdn.com/v4/letter/n/f07891/32.png) [@nobound](https://discuss.elastic.co/u/nobound)\
**Post date:** [December 11, 2019, 4:55pm UTC](https://discuss.elastic.co/t/deploy-eck-to-a-single-namespace/211495/3 "2019-12-11T16:55:08Z")

</div>

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](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?

---

<div class="post-metadata">

**Author:** ![nobound](https://avatars.discourse-cdn.com/v4/letter/n/f07891/32.png) [@nobound](https://discuss.elastic.co/u/nobound)\
**Post date:** [December 12, 2019, 8:30pm UTC](https://discuss.elastic.co/t/deploy-eck-to-a-single-namespace/211495/4 "2019-12-12T20:30:19Z")

</div>

I follow the instructions ([https://github.com/elastic/cloud-on-k8s/tree/1.0/config/operator](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.

```auto
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

---

<div class="post-metadata">

**Author:** ![Anya\_Sabo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anya_sabo/32/49903_2.png) [@Anya\_Sabo](https://discuss.elastic.co/u/Anya_Sabo)\
**Post date:** [December 12, 2019, 9:10pm UTC](https://discuss.elastic.co/t/deploy-eck-to-a-single-namespace/211495/5 "2019-12-12T21:10:56Z")

</div>

> Does it mean I should not use the  
> [https://download.elastic.co/downloads/eck/1.0.0-beta1/all-in-one.yaml](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?

---

<div class="post-metadata">

**Author:** ![nobound](https://avatars.discourse-cdn.com/v4/letter/n/f07891/32.png) [@nobound](https://discuss.elastic.co/u/nobound)\
**Post date:** [December 12, 2019, 9:25pm UTC](https://discuss.elastic.co/t/deploy-eck-to-a-single-namespace/211495/6 "2019-12-12T21:25:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![supermancc03](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/supermancc03/32/60505_2.png) [@supermancc03](https://discuss.elastic.co/u/supermancc03)\
**Post date:** [January 8, 2020, 8:36pm UTC](https://discuss.elastic.co/t/deploy-eck-to-a-single-namespace/211495/7 "2020-01-08T20:36:41Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![sebgl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sebgl/32/48702_2.png) [@sebgl](https://discuss.elastic.co/u/sebgl)\
**Post date:** [January 10, 2020, 3:17pm UTC](https://discuss.elastic.co/t/deploy-eck-to-a-single-namespace/211495/8 "2020-01-10T15:17:19Z")

</div>

@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](https://github.com/kubernetes/kubernetes/issues/65551).

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](https://github.com/elastic/cloud-on-k8s/issues/2406)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 4, 2022, 7:37am UTC](https://discuss.elastic.co/t/deploy-eck-to-a-single-namespace/211495/9 "2022-11-04T07:37:03Z")

</div>


