Deploy an ECK on another namespace

Hi,
I tried deploy an ECK in GKE in nemespace I created
and what I got:

kubectl apply -f https://download.elastic.co/downloads/eck/2.2.0/operator.yaml -n ns2
W0612 12:52:31.559080 1136 gcp.go:120] WARNING: the gcp auth plugin is deprecated in v1.22+, unavailable in v1.25+; use gcloud instead.
To learn more, consult https://cloud.google.com/blog/products/containers-kubernetes/kubectl-auth-changes-in-gke
namespace/elastic-system created
clusterrole.rbac.authorization.k8s.io/elastic-operator created
clusterrole.rbac.authorization.k8s.io/elastic-operator-view created
clusterrole.rbac.authorization.k8s.io/elastic-operator-edit created
clusterrolebinding.rbac.authorization.k8s.io/elastic-operator created
validatingwebhookconfiguration.admissionregistration.k8s.io/elastic-webhook.k8s.elastic.co created
the namespace from the provided object "elastic-system" does not match the namespace "ns2". You must pass '--namespace=elastic-system' to perform this operation.
the namespace from the provided object "elastic-system" does not match the namespace "ns2". You must pass '--namespace=elastic-system' to perform this operation.
the namespace from the provided object "elastic-system" does not match the namespace "ns2". You must pass '--namespace=elastic-system' to perform this operation.
the namespace from the provided object "elastic-system" does not match the namespace "ns2". You must pass '--namespace=elastic-system' to perform this operation.
the namespace from the provided object "elastic-system" does not match the namespace "ns2". You must pass '--namespace=elastic-system' to perform this operation.

If you can help me-
Ill be happy.
thanks

Hi @frida Welcome the community.

I suspect you will need to download the operator.yaml and edit the namespace as it is defined in the operator...

I think you will need to replace all the namespace: elastic-system etc in the yaml

Any specific reason you want to change the namespace? I think it will complicate things especially if you are just starting out....

I am not sure what other consequences / effects this will have later when you deploy other components.

# Source: eck-operator/templates/operator-namespace.yaml
apiVersion: v1
kind: Namespace
metadata:
  name: elastic-system <!--- Here 
  labels:
    name: elastic-system <!--- Here 
---
# Source: eck-operator/templates/service-account.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
  name: elastic-operator
  namespace: elastic-system <!--- Here  and so on... 
  labels:
    control-plane: elastic-operator
    app.kubernetes.io/version: "2.2.0"
...

Thank you very very much!

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