Skip to content

Commit

Permalink
Merge pull request #139 from salasberryfin/update-chart-to-enable-fea…
Browse files Browse the repository at this point in the history
…ture-flags

feat: update chart to enable crs and topology features
  • Loading branch information
alexander-demicev authored Sep 26, 2023
2 parents d36af93 + d73fd08 commit 0e28a41
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 10 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ cluster-api-operator:
cluster-api:
enabled: true # indicates if core CAPI controllers should be installed (default: true)
version: v1.4.6 # version of CAPI to install (default: v1.4.6)
configSecret:
configSecret: # set the name/namespace of configuration secret. Leave empty unless you want to use your own secret.
name: "" # name of the config secret to use for core CAPI controllers, used by the CAPI operator. See [CAPI operator](https://github.com/kubernetes-sigs/cluster-api-operator/tree/main/docs#installing-azure-infrastructure-provider) docs for more details.
namespace: "" # namespace of the config secret to use for core CAPI controllers, used by the CAPI operator.
defaultName: "capi-env-variables" # default name for the secret.
core:
namespace: capi-system
fetchConfig: # (only required for airgapped environments)
Expand Down
22 changes: 19 additions & 3 deletions charts/rancher-turtles/templates/core-provider.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ spec:
additionalManifests:
name: capi-additional-rbac-roles
namespace: {{ index .Values "cluster-api-operator" "cluster-api" "core" "namespace" }}
{{- if index .Values "cluster-api-operator" "cluster-api" "configSecret" "name" }}
{{- if and (index .Values "cluster-api-operator" "cluster-api" "configSecret" "name") (index .Values "cluster-api-operator" "cluster-api" "configSecret" "namespace") }}
secretName: {{ index .Values "cluster-api-operator" "cluster-api" "configSecret" "name" }}
{{- if index .Values "cluster-api-operator" "cluster-api" "configSecret" "namespace" }}
secretNamespace: {{ index .Values "cluster-api-operator" "cluster-api" "configSecret" "namespace" }}
{{- end }}
{{ else }}
secretName: {{ index .Values "cluster-api-operator" "cluster-api" "configSecret" "defaultName" }}
secretNamespace: {{ index .Values "cluster-api-operator" "cluster-api" "core" "namespace" }}
{{- end }}
{{- if or (index .Values "cluster-api-operator" "cluster-api" "core" "fetchConfig" "url") (index .Values "cluster-api-operator" "cluster-api" "core" "fetchConfig" "selector") }}
fetchConfig:
Expand Down Expand Up @@ -68,4 +69,19 @@ data:
- apiGroups: ["rke-machine.cattle.io"]
resources: ["*"]
verbs: ["*"]
---
{{- if not (and (index .Values "cluster-api-operator" "cluster-api" "configSecret" "name") (index .Values "cluster-api-operator" "cluster-api" "configSecret" "namespace")) }}
apiVersion: v1
kind: Secret
metadata:
name: {{ index .Values "cluster-api-operator" "cluster-api" "configSecret" "defaultName" }}
namespace: {{ index .Values "cluster-api-operator" "cluster-api" "core" "namespace" }}
annotations:
"helm.sh/hook": "post-install, post-upgrade"
"helm.sh/hook-weight": "2"
type: Opaque
stringData:
CLUSTER_TOPOLOGY: "true"
EXP_CLUSTER_RESOURCE_SET: "true"
{{- end }}
{{- end }}
7 changes: 4 additions & 3 deletions charts/rancher-turtles/templates/kubeadm-bootstrap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ metadata:
"helm.sh/hook-weight": "2"
spec:
version: {{ index .Values "cluster-api-operator" "cluster-api" "version" }}
{{- if index .Values "cluster-api-operator" "cluster-api" "configSecret" "name" }}
{{- if and (index .Values "cluster-api-operator" "cluster-api" "configSecret" "name") (index .Values "cluster-api-operator" "cluster-api" "configSecret" "namespace") }}
secretName: {{ index .Values "cluster-api-operator" "cluster-api" "configSecret" "name" }}
{{- if index .Values "cluster-api-operator" "cluster-api" "configSecret" "namespace" }}
secretNamespace: {{ index .Values "cluster-api-operator" "cluster-api" "configSecret" "namespace" }}
{{- end }}
{{ else }}
secretName: {{ index .Values "cluster-api-operator" "cluster-api" "configSecret" "defaultName" }}
secretNamespace: {{ index .Values "cluster-api-operator" "cluster-api" "core" "namespace" }}
{{- end }}
{{- if or (index .Values "cluster-api-operator" "cluster-api" "kubeadmBootstrap" "fetchConfig" "url") (index .Values "cluster-api-operator" "cluster-api" "kubeadmBootstrap" "fetchConfig" "selector") }}
fetchConfig:
Expand Down
7 changes: 4 additions & 3 deletions charts/rancher-turtles/templates/kubeadm-control-plane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ metadata:
"helm.sh/hook-weight": "2"
spec:
version: {{ index .Values "cluster-api-operator" "cluster-api" "version" }}
{{- if index .Values "cluster-api-operator" "cluster-api" "configSecret" "name" }}
{{- if and (index .Values "cluster-api-operator" "cluster-api" "configSecret" "name") (index .Values "cluster-api-operator" "cluster-api" "configSecret" "namespace") }}
secretName: {{ index .Values "cluster-api-operator" "cluster-api" "configSecret" "name" }}
{{- if index .Values "cluster-api-operator" "cluster-api" "configSecret" "namespace" }}
secretNamespace: {{ index .Values "cluster-api-operator" "cluster-api" "configSecret" "namespace" }}
{{- end }}
{{ else }}
secretName: {{ index .Values "cluster-api-operator" "cluster-api" "configSecret" "defaultName" }}
secretNamespace: {{ index .Values "cluster-api-operator" "cluster-api" "core" "namespace" }}
{{- end }}
{{- if or (index .Values "cluster-api-operator" "cluster-api" "kubeadmControlPlane" "fetchConfig" "url") (index .Values "cluster-api-operator" "cluster-api" "kubeadmControlPlane" "fetchConfig" "selector") }}
fetchConfig:
Expand Down
1 change: 1 addition & 0 deletions charts/rancher-turtles/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ cluster-api-operator:
configSecret:
name: ""
namespace: ""
defaultName: capi-env-variables
core:
namespace: capi-system
fetchConfig:
Expand Down

0 comments on commit 0e28a41

Please sign in to comment.