diff --git a/Makefile b/Makefile index 69f3a22bf..077c60052 100644 --- a/Makefile +++ b/Makefile @@ -97,8 +97,15 @@ kind-cluster-cleanup: kind ## Delete the kind cluster build: manifests generate fmt vet ## Build manager binary. go build -o bin/manager main.go +.PHONY: run-image +run-image: docker-build kind-load install-cert-mgr install-rukpak install deploy wait ## Build the operator-controller then deploy it into an existing kind cluster. + .PHONY: run -run: docker-build kind-cluster kind-load cert-mgr rukpak install deploy wait ## Build the operator-controller then deploy it into a new kind cluster. +run: kind-cluster run-image ## Build the operator-controller then deploy it into a new kind cluster. + +.PHONY: run-local +run-local: manifests generate fmt vet ## Run a controller from your host. Make sure that necessary CRDs are installed in the cluster. + go run ./main.go .PHONY: wait wait: @@ -139,16 +146,24 @@ ifndef ignore-not-found endif ## TODO dfranz: replace cert-mgr and rukpak targets with our chosen method of distribution when available -.PHONY: cert-mgr -cert-mgr: ## Install cert-manager +.PHONY: install-cert-mgr +install-cert-mgr: ## Install cert-manager kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/$(CERT_MGR_VERSION)/cert-manager.yaml kubectl wait --for=condition=Available --namespace=cert-manager deployment/cert-manager-webhook --timeout=$(WAIT_TIMEOUT) -.PHONY: rukpak -rukpak: ## Install rukpak +.PHONY: uninstall-cert-mgr +uninstall-cert-mgr: ## Install cert-manager + kubectl delete -f https://github.com/cert-manager/cert-manager/releases/download/$(CERT_MGR_VERSION)/cert-manager.yaml + +.PHONY: install-rukpak +install-rukpak: ## Install rukpak kubectl apply -f https://github.com/operator-framework/rukpak/releases/latest/download/rukpak.yaml kubectl wait --for=condition=Available --namespace=rukpak-system deployment/core --timeout=$(WAIT_TIMEOUT) +.PHONY: uninstall-rukpak +uninstall-rukpak: ## Install rukpak + kubectl delete -f https://github.com/operator-framework/rukpak/releases/latest/download/rukpak.yaml + .PHONY: install install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config. $(KUSTOMIZE) build config/crd | kubectl apply -f - @@ -166,6 +181,10 @@ deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in 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 --ignore-not-found=$(ignore-not-found) -f - +# cleans up all the operator resources and their dependents like cert-manager and rukpak +.PHONY: cleanup +cleanup: undeploy uninstall uninstall-rukpak uninstall-cert-mgr + ##@ Build Dependencies ## Location to install dependencies to