Feat: add common_crds role and Prometheus Operator CRDs installation#12441
Conversation
ae56340 to
4d94a21
Compare
|
/hold |
|
This looks very promising, good job! One question though: would it be possible to check if the CRD is installed already, and skip the install in this case? (say somewhere in a layer above Kubespray we change the CRD version, then we wouldn't want subsequent Kubespray runs overwriting it) See this comment on the generic hooks PR too: #12408 (comment) |
|
I remember that upgrade is not yet integrated with CRDs (that is, upgrading a cluster does not include installing or upgrading CRDs) |
Hmmm, I don't think this is about upgrades, we sort of run the Maybe something like this: Maybe expose it through another flag: That would make this feature actually usable for us, remove the need of generic hooks and make everything simpler 🥳 WDYT? |
4d94a21 to
0165ca9
Compare
|
@rarescosma I changed the state to
|
|
/unhold |
Lovely, I'll try backporting this onto our |
|
@MrFreezeex could you help me take a look at this? thanks! |
MrFreezeex
left a comment
There was a problem hiding this comment.
Thanks that look promising!
The only thing that might be a bit weird to me is that we need to duplicate those default variable in multiple places (especially those version number unfortunately) but this is the same for the existing gateway-api crds so I wouldn't block that pr on that
I can add the lgtm label if you want me to or wait in case you want additional reviews as you wish
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: MrFreezeex, tico88612 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Yep, ideally, I would like to write the CRD version in separate files, but obviously the download module will need to be used. We may need to discuss how to proceed.
If you think it's okay to merge, I respect the opinion of each reviewer. |
VannTen
left a comment
There was a problem hiding this comment.
The common CRDs idea looks smart to me, some comments.
roles/kubernetes-apps/common_crds/prometheus_operator_crds/defaults/main.yml
Outdated
Show resolved
Hide resolved
roles/kubernetes-apps/common_crds/prometheus_operator_crds/tasks/main.yml
Outdated
Show resolved
Hide resolved
Adding commonly used CRDs can be expanded Signed-off-by: ChengHao Yang <17496418+tico88612@users.noreply.github.com>
Signed-off-by: ChengHao Yang <17496418+tico88612@users.noreply.github.com>
0165ca9 to
4440dcc
Compare
roles/kubernetes-apps/common_crds/prometheus_operator_crds/defaults/main.yml
Outdated
Show resolved
Hide resolved
| --- | ||
| - name: Prometheus Operator CRDs | Download YAML | ||
| include_tasks: "../../../../download/tasks/download_file.yml" | ||
| vars: | ||
| download: "{{ download_defaults | combine(downloads.prometheus_operator_crds) }}" | ||
|
|
||
| - name: Read CRDs yaml from remote | ||
| slurp: | ||
| src: "{{ local_release_dir }}/prometheus-operator-crds.yaml" | ||
| register: crds_file | ||
| when: | ||
| - "inventory_hostname == groups['kube_control_plane'][0]" |
There was a problem hiding this comment.
I somehow forgot that the download rewrite is still WIP 😅
5109496 to
97b0ebd
Compare
The Prometheus Operator CRDs are commonly used for monitoring and are used by some CNIs (such as Cilium). Kubespray can be installed first, and the subsequent installation of the operator can be handled by the user (or later extensions). Signed-off-by: ChengHao Yang <17496418+tico88612@users.noreply.github.com>
97b0ebd to
9dca520
Compare
|
/retest |
1 similar comment
|
/retest |
|
Can you just add the |
Signed-off-by: ChengHao Yang <17496418+tico88612@users.noreply.github.com>
Added it. |
|
/lgtm |
What type of PR is this?
/kind feature
What this PR does / why we need it:
The use case proposed by the Post kubeadm hook (#12408) is to install Prometheus CRDs, such as ServiceMonitor. Most packages commonly use Prometheus Operator CRDs for monitoring, so this PR proposal is installed together with the Gateway API and merged into
common_crds.Which issue(s) this PR fixes:
Related #12408
Special notes for your reviewer:
The Prometheus Operator CRDs are commonly used for monitoring and are used by some CNIs (such as Cilium). Kubespray can be installed first, and the subsequent installation of the Prometheus operator can be handled by the user (or later extensions).
/label tide/merge-method-merge
Does this PR introduce a user-facing change?: