Skip to content
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

Optional installation of CRDs #341

Closed
illrill opened this issue Nov 21, 2023 · 3 comments · Fixed by #342
Closed

Optional installation of CRDs #341

illrill opened this issue Nov 21, 2023 · 3 comments · Fixed by #342
Labels
enhancement New feature or request

Comments

@illrill
Copy link
Contributor

illrill commented Nov 21, 2023

Feature Description

Some users prefer to install and manage CRDs outside of the chart. This can help ensure CRDs (and CRs) remain installed even when the chart is uninstalled.

When CRDs are installed as part of the chart templates, it's common to wrap them around a toggle. See for example cert-manager and external-secrets.

Suggested Solution (optional)

Add an installCRDs boolean helm value.

@illrill illrill added the enhancement New feature or request label Nov 21, 2023
@yorugac
Copy link
Collaborator

yorugac commented Nov 23, 2023

Hi @illrill,

This can help ensure CRDs (and CRs) remain installed even when the chart is uninstalled.

Thanks for pointing this use case out! I vaguely remember wondering if we'll need such a field in k6-operator Helm but had doubts about its usefullness 😄

@yorugac
Copy link
Collaborator

yorugac commented Nov 23, 2023

For completeness sake; and in case it'll be needed to locate the problem.

With this change, it's now possible to run k6-operator without CRDs installed very easily (arguably, easier than before) and doing that will result in errors like this:

2023-11-23T15:05:06Z	ERROR	controller-runtime.source.EventHandler	failed to get informer from cache	{"error": "failed to get API group resources: unable to retrieve the complete list of server APIs: k6.io/v1alpha1: the server could not find the requested resource"}

It is an expected error in this case. Solution: make a full installation with CRDs included.

@illrill
Copy link
Contributor Author

illrill commented Nov 23, 2023

@yorugac thanks, that's valuable information (I was initially considering just installing TestRun) 👍

If anyone is interested, this is how I handled CRD installation using kubectl, separately from the Helm release lifecycle.

helm template k6-operator grafana/k6-operator \
  --set k6-operator.installCRDs=true \
  | yq 'select(.kind == "CustomResourceDefinition")' \
  | kubectl apply --server-side --force-conflicts -f -
helm install k6-operator grafana/k6-operator \
  --set k6-operator.installCRDs=false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants