-
Notifications
You must be signed in to change notification settings - Fork 21
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
Update make uninstall #191
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -211,6 +211,7 @@ install: manifests kustomize install-authorino ## Install CRDs into the K8s clus | |
|
||
uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. | ||
kubectl delete -f $(OPERATOR_MANIFESTS) | ||
$(MAKE) uninstall-authorino | ||
|
||
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config. | ||
cd config/manager && $(KUSTOMIZE) edit set image controller=${OPERATOR_IMAGE} | ||
|
@@ -222,12 +223,21 @@ undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/confi | |
$(KUSTOMIZE) build config/default | kubectl delete -f - | ||
|
||
install-authorino: install-cert-manager ## install RBAC and CRD for authorino | ||
kubectl create namespace authorino-operator | ||
$(KUSTOMIZE) build config/authorino | kubectl apply -f - | ||
|
||
uninstall-authorino: ## uninstall RBAC and CRD for authorino | ||
$(KUSTOMIZE) build config/authorino | kubectl delete -f - | ||
kubectl delete namespace authorino-operator | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Deleting the operator's namespace seems a bit harsh. Effectively, this will decommission the operator instance. IWO, it's almost like a "undeploy" target. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ya the namespace thing was something that kept biting me when doing this. As the create of the namespace is documented in the README I would be happy the remove the changes I made around the namespace. |
||
$(MAKE) uninstall-cert-manager | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we install cert-manager as part There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see that now. Tricky one. Installing when it's already present causes less harm than uninstalling when you aren't supposed to. Not sure what best here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, I see your point. The question I find my self asking is, what is the purpose of the make targets? Are they how we recommend the user installs the operator in production? If so how do we handle upgrades? Or is the purpose to aid developers in the day to day develop of the operator? In which case it would be better to revert all changes to a cluster? I am also not sure which is best but I do lean to the latter. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Mainly dev and testing workflows, I'd say.
No.
Yes.
I was thinking... These make targets are useful for people who clone the repo, maybe they make changes, and want to try them out locally. They may no know exactly which YAMLs to apply for each step to of the workflow and therefore the targets provide them with a bit of guidance/documentation. We cannot predict the exact scenario that development/test work is going on. E.g. maybe it's for a change in the controller's code, maybe it's a change in the Authorino CRD, maybe it's because of a change in Authorino itself that requires some tweak in the operator to be tested, maybe it's running in a fresh newly created cluster, maybe it's running on a preexisting cluster with preexisting stuff installed, maybe cert-manager is already running (installed for something else), maybe it's the first time the operator is installed, maybe it's a re-install, maybe it's to test a new version of CRDs on a preexisting install, etc. With that in mind, perhaps a reasonable approach is providing very granular targets, for very specific operations, alongside with fewer more opinionated ones. For example,
I guess the pattern being:
WDYT? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe, it is this idea of easy of use. The idea that While I think this is a compromise and contradiction in usability, it is also possible the correct solution for now. Change would need some docs update also and the scope of some current targets would need to be reduced. The example off the top of my head is how the |
||
|
||
install-cert-manager: ## install the cert manager need for the web hooks | ||
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v${CERT_MANAGER_VERSION}/cert-manager.yaml | ||
kubectl -n cert-manager wait --timeout=300s --for=condition=Available deployments --all | ||
|
||
uninstall-cert-manager: ## uninstall the cert manager need for the web hooks | ||
kubectl delete -f https://github.com/cert-manager/cert-manager/releases/download/v${CERT_MANAGER_VERSION}/cert-manager.yaml | ||
|
||
# go-get-tool will 'go install' any package $2 and install it to $1. | ||
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST)))) | ||
define go-get-tool | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make install
does not install Authorino CRDs. I wonder ifmake uninstall
should indeed try to undo what its counterpart did not do.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
make install
does install the Authorino CRD, it is part ofOPERATOR_MANIFESTS
. The adding of themake uninstall-authorino
is to mirror how themake install
callsinstall-authorino
. This change aligns closer with what its counterpart does.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My confusion.
OPERATOR_MANIFESTS
points to this file, which does not include Authorino CRDs. However,install
depends oninstall-authorino
. Makes sense.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like I am missing something. The very first file in that manifest is the authorino CRD. What am I missing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Authorino CRD belongs to the operator. AuthConfig CRD is the one that belongs to Authorino.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay I get you now when you said Authorio CRDs you meant Authorino as in Authorino the product and not the CRD kind. Happy that confusion was cleared up.
So to be sure, are you asking for anything to be changed here?