Improve CRD maintenance options and fix permissions
@Techassi đang làm issue này rồi.
Từ ngày 26/3/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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
- Ngôn ngữ chính
- Không có dữ liệu ngôn ngữ
- Star
- 2
- Fork
- 0
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của stackabletech/issues
-
Metadata store: MVP Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
stackabletech/issues#892 ·
-
Metadata Store Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
stackabletech/issues#891 · 1 bình luận · 1 reaction ·
-
Release Retro 26.11.0 Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 50/100
stackabletech/issues#890 ·
-
tracking: SDP Release 26.11.0 Đang mởepic
stackabletech/issues#889 · 2 người được giao ·
-
stackabletech/issues#888 · 1 bình luận · 1 người được giao ·