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

✨ Add featureGates to ControlPlaneProvider #536

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
13 changes: 13 additions & 0 deletions hack/charts/cluster-api-operator/templates/control-plane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,19 @@ spec:
{{- if $controlPlaneVersion }}
version: {{ $controlPlaneVersion }}
{{- end }}
{{- if $.Values.manager }}
manager:
{{- if hasKey $.Values.manager.featureGates $controlPlaneName }}
{{- range $key, $value := $.Values.manager.featureGates }}
{{- if eq $key $controlPlaneName }}
featureGates:
{{- range $k, $v := $value }}
{{ $k }}: {{ $v }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- if $.Values.configSecret.name }}
configSecret:
name: {{ $.Values.configSecret.name }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ metadata:
"helm.sh/hook-weight": "2"
{{- with .Values.configSecret }}
spec:
{{- if $.Values.manager }}
manager:
{{- if $.Values.manager.featureGates.kubeadm }}
Copy link
Contributor

Choose a reason for hiding this comment

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

can we make kubeadm configurable here? for users that are not using kubeadm for bootstrapping

Copy link
Author

Choose a reason for hiding this comment

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

@alexander-demicev
Sorry, I don't seem to understand correctly what you mean.
Could you please explain in more detail?
Thx.

Copy link
Author

Choose a reason for hiding this comment

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

As changes may be made, the test is written after hearing the explanation.
Thx.

Copy link
Author

Choose a reason for hiding this comment

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

@alexander-demicev remind 🙇‍♂️

Copy link
Member

Choose a reason for hiding this comment

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

@kahirokunn current implementation always assumes that manager.featureGates dictionary will use kubeadm as a bootstrap provider and nothing else. However, there is a possibilty that, other bootstrap provider, like rke2 could be used instead of kubeadm, so making manager.featureGates configurable would makes sense here only if we could make the whole ControlPlaneProvider type (starting from line 42) configurable including metadata.name & metadata.namespace.

@alexander-demicev perhaps we could keep it as is, since it is already kubeadm specific, WDYT?

Copy link
Author

Choose a reason for hiding this comment

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

I wrote this because the file is specific to kubeadm
I wrote this because it is a kubeadm-specific file, and I thought it would be confusing if I wrote it in a standard way.

featureGates:
{{- range $key, $value := $.Values.manager.featureGates.kubeadm }}
{{ $key }}: {{ $value }}
{{- end }}
{{- end }}
{{- end }}
configSecret:
name: {{ .name }}
{{- if .namespace }}
Expand Down