Skip to content
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
14 changes: 13 additions & 1 deletion hack/charts/cluster-api-operator/templates/addon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,21 @@ metadata:
"helm.sh/hook-weight": "2"
{{- end }}
"argocd.argoproj.io/sync-wave": "2"
{{- if or $addonVersion $.Values.secretName $.Values.configSecret.name (($addon).configSecret).name }}
{{- if or $addonVersion $.Values.secretName $.Values.configSecret.name $addon.manager (($addon).configSecret).name }}
spec:
{{- end}}
{{- if $addon.manager }}
manager:
{{- if $addon.manager.metrics }}
metrics:
{{- if $addon.manager.metrics.insecureDiagnostics }}
insecureDiagnostics: {{- $addon.manager.metrics.insecureDiagnostics }}
{{- end }}
{{- if $addon.manager.metrics.diagnosticsAddress }}
diagnosticsAddress: {{- $addon.manager.metrics.diagnosticsAddress }}
{{- end }}
{{- end }}
{{- end }}
{{- if $addonVersion }}
version: {{ $addonVersion }}
{{- end }}
Expand Down
14 changes: 13 additions & 1 deletion hack/charts/cluster-api-operator/templates/bootstrap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,21 @@ metadata:
"helm.sh/hook-weight": "2"
{{- end }}
"argocd.argoproj.io/sync-wave": "2"
{{- if or $bootstrapVersion $.Values.configSecret.name (($bootstrap).configSecret).name }}
{{- if or $bootstrapVersion $.Values.configSecret.name $bootstrap.manager (($bootstrap).configSecret).name }}
spec:
{{- end}}
{{- if $bootstrap.manager }}
manager:
{{- if $bootstrap.manager.metrics }}
metrics:
{{- if $bootstrap.manager.metrics.insecureDiagnostics }}
insecureDiagnostics: {{- $bootstrap.manager.metrics.insecureDiagnostics }}
{{- end }}
{{- if $bootstrap.manager.metrics.diagnosticsAddress }}
diagnosticsAddress: {{- $bootstrap.manager.metrics.diagnosticsAddress }}
{{- end }}
{{- end }}
{{- end }}
{{- if $bootstrapVersion }}
version: {{ $bootstrapVersion }}
{{- end }}
Expand Down
23 changes: 14 additions & 9 deletions hack/charts/cluster-api-operator/templates/control-plane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,29 @@ metadata:
"helm.sh/hook-weight": "2"
{{- end }}
"argocd.argoproj.io/sync-wave": "2"
{{- if or $controlPlaneVersion $.Values.configSecret.name $.Values.manager (($controlPlane).configSecret).name }}
{{- if or $controlPlaneVersion $.Values.configSecret.name $controlPlane.manager (($controlPlane).configSecret).name }}
spec:
{{- end}}
{{- if $controlPlaneVersion }}
version: {{ $controlPlaneVersion }}
{{- end }}
{{- if $.Values.manager }}
{{- if hasKey $.Values.manager.featureGates $controlPlaneName }}
{{- if $controlPlane.manager }}
manager:
{{- range $key, $value := $.Values.manager.featureGates }}
{{- if eq $key $controlPlaneName }}
{{- if $controlPlane.manager.featureGates }}
featureGates:
{{- range $k, $v := $value }}
{{ $k }}: {{ $v }}
{{- range $key, $value := $controlPlane.manager.featureGates }}
{{ $key }}: {{ $value }}
{{- end }}
{{- end }}
{{- if $controlPlane.manager.metrics }}
metrics:
{{- if $controlPlane.manager.metrics.insecureDiagnostics }}
insecureDiagnostics: {{- $controlPlane.manager.metrics.insecureDiagnostics }}
{{- end }}
{{- if $controlPlane.manager.metrics.diagnosticsAddress }}
diagnosticsAddress: {{- $controlPlane.manager.metrics.diagnosticsAddress }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- if (default (($controlPlane).configSecret).name (($.Values).configSecret).name) }}
{{- include "capi-operator.configSecret" (dict "ROOT" $ "ARGUMENT" $controlPlane) | nindent 2 }}
Expand Down
19 changes: 14 additions & 5 deletions hack/charts/cluster-api-operator/templates/core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,29 @@ metadata:
"helm.sh/hook-weight": "2"
{{- end }}
"argocd.argoproj.io/sync-wave": "2"
{{- if or $coreVersion $.Values.configSecret.name $.Values.manager (($core).configSecret).name }}
{{- if or $coreVersion $.Values.configSecret.name $core.manager (($core).configSecret).name }}
spec:
{{- end}}
{{- if $coreVersion }}
version: {{ $coreVersion }}
{{- end }}
{{- if $.Values.manager }}
{{- if and $.Values.manager.featureGates $.Values.manager.featureGates.core }}
{{- if $core.manager }}
manager:
{{- if $core.manager.featureGates }}
featureGates:
{{- range $key, $value := $.Values.manager.featureGates.core }}
{{- range $key, $value := $core.manager.featureGates }}
{{ $key }}: {{ $value }}
{{- end }}
{{- end }}
{{- end }}
{{- if $core.manager.metrics }}
metrics:
{{- if $core.manager.metrics.insecureDiagnostics }}
insecureDiagnostics: {{- $core.manager.metrics.insecureDiagnostics }}
{{- end }}
{{- if $core.manager.metrics.diagnosticsAddress }}
diagnosticsAddress: {{- $core.manager.metrics.diagnosticsAddress }}
{{- end }}
{{- end }}
{{- end }}
{{- if (default (($core).configSecret).name (($.Values).configSecret).name) }}
{{- include "capi-operator.configSecret" (dict "ROOT" $ "ARGUMENT" $core) | nindent 2 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,6 @@ metadata:
"argocd.argoproj.io/sync-wave": "2"
{{- with .Values.configSecret }}
spec:
{{- if $.Values.manager }}
{{- if and $.Values.manager.featureGates $.Values.manager.featureGates.kubeadm }}
manager:
featureGates:
{{- range $key, $value := $.Values.manager.featureGates.kubeadm }}
{{ $key }}: {{ $value }}
{{- end }}
{{- end }}
{{- end }}
configSecret:
name: {{ .name }}
{{- if .namespace }}
Expand Down
23 changes: 14 additions & 9 deletions hack/charts/cluster-api-operator/templates/infra.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,29 @@ metadata:
"helm.sh/hook-weight": "2"
{{- end }}
"argocd.argoproj.io/sync-wave": "2"
{{- if or $infrastructureVersion $.Values.configSecret.name $.Values.manager $.Values.additionalDeployments (($infra).configSecret).name }}
{{- if or $infrastructureVersion $.Values.configSecret.name $infra.manager $.Values.additionalDeployments (($infra).configSecret).name }}
spec:
{{- end }}
{{- if $infrastructureVersion }}
version: {{ $infrastructureVersion }}
{{- end }}
{{- if $.Values.manager }}
{{- if and (kindIs "map" $.Values.manager.featureGates) (hasKey $.Values.manager.featureGates $infrastructureName) }}
{{- if $infra.manager }}
manager:
{{- range $key, $value := $.Values.manager.featureGates }}
{{- if eq $key $infrastructureName }}
{{- if $infra.manager.featureGates }}
featureGates:
{{- range $k, $v := $value }}
{{ $k }}: {{ $v }}
{{- range $key, $value := $infra.manager.featureGates }}
{{ $key }}: {{ $value }}
{{- end }}
{{- end }}
{{- if $infra.manager.metrics }}
metrics:
{{- if $infra.manager.metrics.insecureDiagnostics }}
insecureDiagnostics: {{- $infra.manager.metrics.insecureDiagnostics }}
{{- end }}
{{- if $infra.manager.metrics.diagnosticsAddress }}
diagnosticsAddress: {{- $infra.manager.metrics.diagnosticsAddress }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- if and (kindIs "map" $.Values.fetchConfig) (hasKey $.Values.fetchConfig $infrastructureName) }}
{{- range $key, $value := $.Values.fetchConfig }}
Expand Down
23 changes: 14 additions & 9 deletions hack/charts/cluster-api-operator/templates/ipam.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,29 @@ metadata:
"helm.sh/hook-weight": "2"
{{- end }}
"argocd.argoproj.io/sync-wave": "2"
{{- if or $ipamVersion $.Values.configSecret.name $.Values.manager $.Values.additionalDeployments (($ipam).configSecret).name }}
{{- if or $ipamVersion $.Values.configSecret.name $ipam.manager $.Values.additionalDeployments (($ipam).configSecret).name }}
spec:
{{- end }}
{{- if $ipamVersion }}
version: {{ $ipamVersion }}
{{- end }}
{{- if $.Values.manager }}
{{- if and (kindIs "map" $.Values.manager.featureGates) (hasKey $.Values.manager.featureGates $ipamName) }}
{{- if $ipam.manager }}
manager:
{{- range $key, $value := $.Values.manager.featureGates }}
{{- if eq $key $ipamName }}
{{- if $ipam.manager.featureGates }}
featureGates:
{{- range $k, $v := $value }}
{{ $k }}: {{ $v }}
{{- range $key, $value := $ipam.manager.featureGates }}
{{ $key }}: {{ $value }}
{{- end }}
{{- end }}
{{- if $ipam.manager.metrics }}
metrics:
{{- if $ipam.manager.metrics.insecureDiagnostics }}
insecureDiagnostics: {{- $ipam.manager.metrics.insecureDiagnostics }}
{{- end }}
{{- if $ipam.manager.metrics.diagnosticsAddress }}
diagnosticsAddress: {{- $ipam.manager.metrics.diagnosticsAddress }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- if and (kindIs "map" $.Values.fetchConfig) (hasKey $.Values.fetchConfig $ipamName) }}
{{- range $key, $value := $.Values.fetchConfig }}
Expand Down
40 changes: 31 additions & 9 deletions hack/charts/cluster-api-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,63 @@ core: {}
# namespace: "" # Optional
# version: "" # Optional
# createNamespace: true # Optional
# manager: # Optional
# featureGates:
# ClusterTopology: true
# metrics:
# insecureDiagnostics: true
# diagnosticsAddress: localhost:8080
bootstrap: {}
# kubeadm: {} # Name, required
# namespace: "" # Optional
# version: "" # Optional
# createNamespace: true # Optional
# manager: # Optional
# metrics:
# insecureDiagnostics: true
# diagnosticsAddress: localhost:8080
controlPlane: {}
# kubeadm: {} # Name, required
# namespace: "" # Optional
# version: "" # Optional
# createNamespace: true # Optional
# manager: # Optional
# featureGates:
# ClusterTopology: true
# metrics:
# insecureDiagnostics: true
# diagnosticsAddress: localhost:8080
infrastructure: {}
# docker: {} # Name, required
# namespace: "" # Optional
# version: "" # Optional
# createNamespace: true # Optional
# manager: # Optional
# featureGates:
# ClusterTopology: true
# metrics:
# insecureDiagnostics: true
# diagnosticsAddress: localhost:8080
addon: {}
# helm: {} # Name, required
# namespace: "" # Optional
# version: "" # Optional
# createNamespace: true # Optional
# manager: # Optional
# metrics:
# insecureDiagnostics: true
# diagnosticsAddress: localhost:8080
ipam: {}
# in-cluster: {} # Name, required
# namespace: "" # Optional
# version: "" # Optional
# createNamespace: true # Optional
manager.featureGates: {}
# Configuration for enabling feature gates in different providers
# manager:
# featureGates:
# proxmox: # Name of the provider
# ClusterTopology: true
# core:
# ClusterTopology: true
# kubeadm:
# manager: # Optional
# featureGates:
# ClusterTopology: true
# metrics:
# insecureDiagnostics: true
# diagnosticsAddress: localhost:8080
fetchConfig: {}
# ---
# Common configuration secret options
Expand Down
58 changes: 29 additions & 29 deletions test/e2e/helm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,19 +354,19 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
})
It("should deploy core and infra with feature gates enabled", func() {
manifests, err := helmChart.Run(map[string]string{
"configSecret.name": "aws-variables",
"configSecret.namespace": "default",
"infrastructure.aws.version": "v2.4.0",
"ipam.in-cluster.enabled": "true",
"addon.helm.enabled": "true",
"image.manager.tag": "v0.9.1",
"core.cluster-api.version": "v1.6.2",
"manager.featureGates.core.ClusterTopology": "true",
"manager.featureGates.core.MachinePool": "true",
"manager.featureGates.aws.ClusterTopology": "true",
"manager.featureGates.aws.MachinePool": "true",
"manager.featureGates.aws.EKSEnableIAM": "true",
"manager.featureGates.aws.EKSAllowAddRoles": "true",
"configSecret.name": "aws-variables",
"configSecret.namespace": "default",
"infrastructure.aws.version": "v2.4.0",
"infrastructure.aws.manager.featureGates.ClusterTopology": "true",
"infrastructure.aws.manager.featureGates.MachinePool": "true",
"infrastructure.aws.manager.featureGates.EKSEnableIAM": "true",
"infrastructure.aws.manager.featureGates.EKSAllowAddRoles": "true",
"ipam.in-cluster.enabled": "true",
"addon.helm.enabled": "true",
"image.manager.tag": "v0.9.1",
"core.cluster-api.version": "v1.6.2",
"core.cluster-api.manager.featureGates.ClusterTopology": "true",
"core.cluster-api.manager.featureGates.MachinePool": "true",
})
Expect(err).ToNot(HaveOccurred())
Expect(manifests).ToNot(BeEmpty())
Expand All @@ -391,14 +391,14 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
})
It("should deploy all providers when manager is defined but another infrastructure spec field is defined", func() {
manifests, err := helmChart.Run(map[string]string{
"core.cluster-api.enabled": "true",
"controlPlane.kubeadm.enabled": "true",
"bootstrap.kubeadm.enabled": "true",
"infrastructure.docker.enabled": "true",
"ipam.in-cluster.enabled": "true",
"addon.helm.enabled": "true",
"manager.featureGates.core.ClusterTopology": "true",
"manager.featureGates.core.MachinePool": "true",
"core.cluster-api.enabled": "true",
"core.cluster-api.manager.featureGates.MachinePool": "true",
"core.cluster-api.manager.featureGates.ClusterTopology": "true",
"controlPlane.kubeadm.enabled": "true",
"bootstrap.kubeadm.enabled": "true",
"infrastructure.docker.enabled": "true",
"ipam.in-cluster.enabled": "true",
"addon.helm.enabled": "true",
})
Expect(err).ToNot(HaveOccurred())
Expect(manifests).ToNot(BeEmpty())
Expand All @@ -408,14 +408,14 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
})
It("should deploy kubeadm control plane with manager specified", func() {
manifests, err := helmChart.Run(map[string]string{
"core.cluster-api.enabled": "true",
"controlPlane.kubeadm.enabled": "true",
"bootstrap.kubeadm.enabled": "true",
"infrastructure.docker.enabled": "true",
"ipam.in-cluster.enabled": "true",
"addon.helm.enabled": "true",
"manager.featureGates.kubeadm.ClusterTopology": "true",
"manager.featureGates.kubeadm.MachinePool": "true",
"core.cluster-api.enabled": "true",
"controlPlane.kubeadm.enabled": "true",
"controlPlane.kubeadm.manager.featureGates.MachinePool": "true",
"controlPlane.kubeadm.manager.featureGates.ClusterTopology": "true",
"bootstrap.kubeadm.enabled": "true",
"infrastructure.docker.enabled": "true",
"ipam.in-cluster.enabled": "true",
"addon.helm.enabled": "true",
})
Expect(err).ToNot(HaveOccurred())
Expect(manifests).ToNot(BeEmpty())
Expand Down
5 changes: 1 addition & 4 deletions test/e2e/resources/kubeadm-manager-defined.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ metadata:
"helm.sh/hook": "post-install,post-upgrade"
"helm.sh/hook-weight": "2"
"argocd.argoproj.io/sync-wave": "2"
spec:
---
# Source: cluster-api-operator/templates/ipam.yaml
apiVersion: operator.cluster.x-k8s.io/v1alpha2
Expand All @@ -119,7 +118,6 @@ metadata:
"helm.sh/hook": "post-install,post-upgrade"
"helm.sh/hook-weight": "2"
"argocd.argoproj.io/sync-wave": "2"
spec:
---
# Source: cluster-api-operator/templates/infra.yaml
apiVersion: operator.cluster.x-k8s.io/v1alpha2
Expand All @@ -130,5 +128,4 @@ metadata:
annotations:
"helm.sh/hook": "post-install,post-upgrade"
"helm.sh/hook-weight": "2"
"argocd.argoproj.io/sync-wave": "2"
spec:
"argocd.argoproj.io/sync-wave": "2"
Loading