Skip to content

Commit

Permalink
Do not create/destroy namespace on (un)deploy
Browse files Browse the repository at this point in the history
Related to cryostatio#180
  • Loading branch information
andrewazores committed Mar 25, 2021
1 parent e09e971 commit 6c2676c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
19 changes: 13 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,25 @@ install: manifests kustomize
uninstall: manifests kustomize
- $(KUSTOMIZE) build config/crd | $(CLUSTER_CLIENT) delete -f -

.PHONY: predeploy
predeploy:
cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG)
cd config/default && $(KUSTOMIZE) edit set namespace $(DEPLOY_NAMESPACE)

.PHONY: print_deploy_config
print_deploy_config: predeploy
$(KUSTOMIZE) build config/default

# Deploy controller in the configured Kubernetes cluster in ~/.kube/config
.PHONY: deploy
deploy: manifests kustomize
pushd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG) && popd
$(KUSTOMIZE) build config/default | sed 's/container-jfr-operator-system/$(DEPLOY_NAMESPACE)/' | $(CLUSTER_CLIENT) apply -f -
deploy: manifests kustomize predeploy
$(KUSTOMIZE) build config/default | $(CLUSTER_CLIENT) apply -f -

# UnDeploy controller from the configured Kubernetes cluster in ~/.kube/config
.PHONY: undeploy
undeploy:
undeploy: destroy_containerjfr_cr
- $(CLUSTER_CLIENT) delete recording --all
- $(CLUSTER_CLIENT) delete -f config/samples/rhjmc_v1beta1_containerjfr.yaml
- $(KUSTOMIZE) build config/default | sed 's/container-jfr-operator-system/$(DEPLOY_NAMESPACE)/' | $(CLUSTER_CLIENT) delete -f -
- $(KUSTOMIZE) build config/default | $(CLUSTER_CLIENT) delete -f -

# Generate manifests e.g. CRD, RBAC etc.
.PHONY: manifests
Expand Down
7 changes: 0 additions & 7 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
apiVersion: v1
kind: Namespace
metadata:
labels:
control-plane: controller-manager
name: system
---
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down

0 comments on commit 6c2676c

Please sign in to comment.