Improve CRD maintenance options and fix permissions
@Techassi ci sta già lavorando.
Dal 26/3/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
I had this in mind for quite some time, but was re-triggered by @NickLarsenNZ's work on https://github.com/stackabletech/issues/issues/798.
Currently, there is a single CRD maintenance option available in all operators:
maintenance:
customResourceDefinitions:
maintain: true
A single setting is too limited and currently breaks operator installations in more ways than it needs to. I therefor propose to implement the following changes.
[!NOTE]
All option names are up for debate. The ones below are just the ones I came up with while writing the proposal.
-
There should be an option to toggle CRD creation by the operator. This could look like:
maintenance: customResourceDefinitions: create: true # (default) or falseThis would allow users to opt-out of CRD creation. The
createpermission onapiextensions.k8s.io/customresourcedefinitionsshould be appropriately gated. -
There should be an option to toggle the conversion webhook. This could look like:
maintenance: customResourceDefinitions: conversion: true # (default) or falseThis would allow users to opt-out of creating and running the conversion webhook as part of the operator. It should be noted that opting out of running the conversion webhook requires everyone and everything to use the latest available CRD version going forward as no automatic conversion between older and never CRD versions is performed.
-
Remove the existing option, because in combination with two new options this would result in the following (confusing) combination matrix:
\ maintain create conversion Notes 1 false false false No CRDs are created by the operator, different mechanism needed. The CRD also isn't maintained, which it also doesn't need to, because the conversion is also turned off*. 2 true false false No CRDs are created by the operator, different mechanism needed. It is requested to maintain the CRD, but it doesn't need to, because the conversion is turned off*. 3 false true false The CRDs are created. The CRD isn't maintained, which it also doesn't need to, because the conversion is also turned off*. 4 false false true No CRDs are created by the operator, different mechanism needed. The CRD also isn't maintained, but the conversion webhook runs. It is however not used, because the conversion webhook configuration is not injected*. 5 true true false The CRDs are created. It is requested to maintain the CRD, but it doesn't need to, because the conversion is turned off*. 6 false true true The CRDs are created. The CRD isn't maintained, but the conversion webhook runs. It is however not used, because the conversion webhook configuration is not injected*. 7 true false true No CRDs are created by the operator, different mechanism needed. The CRD is maintained and the conversion webhook runs. I guess this is useful for deployments where the CRD should be created by a different deployment mechanism, like ArgoCD. 8 true true true The complete deal. Everything works as expected. This can and should be reduced to the following combination matrix:
\ create conversion Notes 1 false false No CRDs are created by the operator, different mechanism needed. Also, no CRDs are maintained and no conversion webhook is running*. 2 true false The CRDs are created. The conversion webhook is not running*. 3 false true No CRDs are created by the operator, different mechanism needed. Once CRDs are established, they can be maintained and converted via the conversion webhook. 4 true true The complete deal. Everything works as expected. I would argue this is way easier to grasp and also what users probably expect when using these options.
* Only the latest CRD version can be used.
-
There should be an option to toggle deploying default custom resource objects. This could look like:
maintenance: customResourceDefinitions: createDefault: true # (default) or false
In addition to the option changes above, I would also like to overhaul how permissions are gated:
- For operators which deploy default custom resource objects for their own CRDs (like listener and secret), the permissions to
createandpatchthese objects should only be granted whencreateDefaultis set totrue. - The permissions to
listandwatchapiextensions.k8s.io/customresourcedefinitionsis always needed as long as we have thecrd_establishedstartup condition. - The permissions to
createapiextensions.k8s.io/customresourcedefinitionsis only needed whencreateis set totrue. Thepatchpermission is only needed when the CRD needs to be maintained. This is the case whenconversionis set totrue.
Just adding the new options leads slightly weird naming. I would suggest the following names:
maintenance:
customResources:
createDefinitions: true
createDefaults: true
convert: true
- Lingua principale
- Nessun dato sulla lingua
- Stelle
- 2
- Fork
- 0
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di stackabletech/issues
-
Metadata store: MVP Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
stackabletech/issues#892 ·
-
Metadata Store Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
stackabletech/issues#891 · 1 commento · 1 reazione ·
-
Release Retro 26.11.0 Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 50/100
stackabletech/issues#890 ·
-
epic
stackabletech/issues#889 · 2 assegnatari ·
-
stackabletech/issues#888 · 1 commento · 1 assegnatario ·