Skip to content

Add targets to Makefile #120

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 24 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to do an install here, so that CRDs are install on the default cluster?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking about it, then realized that we need rukpak and cert-manager CRDs too. Which I why I excluded everything instead of selectively installing only operator CRDs.

go run ./main.go

.PHONY: wait
wait:
Expand Down Expand Up @@ -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 -
Expand All @@ -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
Expand Down