Skip to content
Open
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ endif

.PHONY: install
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build config/crd | kubectl apply -f -
$(KUSTOMIZE) build config/crd | kubectl replace --force -f -
Copy link
Contributor

Choose a reason for hiding this comment

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

Why force is needed? that also removes CRDs and custom resources

Copy link
Contributor Author

@Akrog Akrog Jun 18, 2024

Choose a reason for hiding this comment

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

Because I've seen it fail otherwise during development complaining about some incompatibility.
It also solves the problem of trying to replace a CRD that doesn't exist. For example if we run make uninstall install.

Copy link
Contributor

Choose a reason for hiding this comment

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

Would be good to understand first what were those incompatibility because when i tried it i didn't faced it, but yes it possible based on the version installed and what being installed.
If it fails due to incompatibility, i think user can be provided an option to force it with details about what to expect with force option and not do it by default because of the above concerns as there can be requirement to not wipe out installed control plane services.

Copy link
Contributor

Choose a reason for hiding this comment

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

What about having two targets install and install-force?

The install target could use:

kubectl replace -f - 

OR

kubectl apply --server-side -f -

And the install-force could utilize the --force parameter:

kubectl replace --force -f -

OR

kubectl apply --server-side --force-conflicts -f -

I was facing the Too long: must have at most 262144 bytes error as well, and I think it would be good if it was fixed.


.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.
Expand Down