From 16d2101da8a6ab330ff985a4fb3f783f4ef6ab43 Mon Sep 17 00:00:00 2001 From: volodymyrZotov Date: Wed, 19 Oct 2022 17:13:05 +0300 Subject: [PATCH] use current kubectl namespace to deploy operator --- Makefile | 6 +++++- config/default/kustomization.yaml | 3 --- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index e2f2d93..4656a23 100644 --- a/Makefile +++ b/Makefile @@ -137,8 +137,12 @@ install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~ uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion. $(KUSTOMIZE) build config/crd | kubectl delete --ignore-not-found=$(ignore-not-found) -f - +.PHONY: set-namespace +set-namespace: + cd config/default && $(KUSTOMIZE) edit set namespace $(shell kubectl config view --minify -o jsonpath={..namespace}) + .PHONY: deploy -deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config. +deploy: manifests kustomize set-namespace ## Deploy controller to the K8s cluster specified in ~/.kube/config. cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG} $(KUSTOMIZE) build config/default | kubectl apply -f - diff --git a/config/default/kustomization.yaml b/config/default/kustomization.yaml index 4ec4d67..27c013b 100644 --- a/config/default/kustomization.yaml +++ b/config/default/kustomization.yaml @@ -1,6 +1,3 @@ -# Adds namespace to all resources. -namespace: onepassword-operator-system - # Value of this field is prepended to the # names of all resources, e.g. a deployment named # "wordpress" becomes "alices-wordpress".