From 4b66494635083e69051af770b1f4b689e33f6693 Mon Sep 17 00:00:00 2001 From: Vishal Tewatia Date: Wed, 10 Apr 2024 12:38:16 +0530 Subject: [PATCH 1/2] add recipe for installing and uninstalling rbac related resources --- Makefile | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Makefile b/Makefile index 4fb74286b..348eb1001 100644 --- a/Makefile +++ b/Makefile @@ -182,22 +182,34 @@ ifndef ignore-not-found ignore-not-found = false endif +.PHONY: install-rbac +install-rbac: manifests kustomize ## Install RBAC related manifests into the K8s cluster specified in ~/.kube/config. + $(KUSTOMIZE) build config/rbac | kubectl apply --server-side -f - + +.PHONY: uninstall-rbac +install-rbac: manifests kustomize ## Uninstall RBAC related manifests from the K8s cluster specified in ~/.kube/config. + $(KUSTOMIZE) build config/rbac | kubectl delete --server-side --ignore-not-found=$(ignore-not-found) -f - + .PHONY: install install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config. $(KUSTOMIZE) build config/crd | kubectl apply --server-side -f - + $(MAKE) install-rbac .PHONY: uninstall 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 --server-side --ignore-not-found=$(ignore-not-found) -f - + $(MAKE) uninstall-rbac .PHONY: deploy deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config. cd config/manager && $(KUSTOMIZE) edit set image flux-iac/tofu-controller=${MANAGER_IMG}:${TAG} $(KUSTOMIZE) build config/default | kubectl apply --server-side -f - + $(MAKE) install-rbac .PHONY: undeploy undeploy: ## Undeploy controller 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/default | kubectl delete --server-side --ignore-not-found=$(ignore-not-found) -f - + $(MAKE) uninstall-rbac # Deploy controller dev image in the configured Kubernetes cluster in ~/.kube/config .PHONY: dev-deploy From 333b294e6cc037c7b1e581277d6e3110516bcdd1 Mon Sep 17 00:00:00 2001 From: Vishal Tewatia Date: Wed, 10 Apr 2024 14:59:29 +0530 Subject: [PATCH 2/2] fix target name --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 348eb1001..ed4471cec 100644 --- a/Makefile +++ b/Makefile @@ -187,7 +187,7 @@ install-rbac: manifests kustomize ## Install RBAC related manifests into the K8s $(KUSTOMIZE) build config/rbac | kubectl apply --server-side -f - .PHONY: uninstall-rbac -install-rbac: manifests kustomize ## Uninstall RBAC related manifests from the K8s cluster specified in ~/.kube/config. +uninstall-rbac: manifests kustomize ## Uninstall RBAC related manifests from the K8s cluster specified in ~/.kube/config. $(KUSTOMIZE) build config/rbac | kubectl delete --server-side --ignore-not-found=$(ignore-not-found) -f - .PHONY: install