Skip to content

Commit

Permalink
Install bootstrap and control plane providers using helm chart values
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandr Demicev <alexandr.demicev@suse.com>
  • Loading branch information
alexander-demicev committed Sep 12, 2023
1 parent 8ffe71f commit e99f3f0
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 20 deletions.
30 changes: 15 additions & 15 deletions charts/rancher-turtles/templates/core-provider.yaml
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
{{- if .Values.capi.enabled }}
{{- if .Values.cluster-api.enabled }}
---
apiVersion: v1
kind: Namespace
metadata:
annotations:
"helm.sh/hook": "post-install, post-upgrade"
"helm.sh/hook-weight": "1"
name: {{ .Values.capi.namespace }}
name: {{ .Values.cluster-api.core.namespace }}
---
apiVersion: operator.cluster.x-k8s.io/v1alpha1
kind: CoreProvider
metadata:
name: cluster-api
namespace: {{ .Values.capi.namespace }}
namespace: {{ .Values.cluster-api.core.namespace }}
annotations:
"helm.sh/hook": "post-install, post-upgrade"
"helm.sh/hook-weight": "2"
spec:
version: v1.4.6
version: {{ $.Values.cluster-api.version }}
additionalManifests:
name: capi-additional-rbac-roles
namespace: {{ .Values.capi.namespace }}
{{- if $.Values.capi.configSecret.name }}
secretName: {{ $.Values.capi.configSecret.name }}
{{- if $.Values.capi.configSecret.namespace }}
secretNamespace: {{ $.Values.capi.configSecret.namespace }}
namespace: {{ .Values.cluster-api.core.namespace }}
{{- if $.Values.cluster-api.configSecret.name }}
secretName: {{ $.Values.cluster-api.configSecret.name }}
{{- if $.Values.cluster-api.configSecret.namespace }}
secretNamespace: {{ $.Values.cluster-api.configSecret.namespace }}
{{- end }}
{{- end }}
{{- if or $.Values.capi.fetchConfig.url $.Values.capi.configSecret.selector }}
{{- if or $.Values.cluster-api.core.fetchConfig.url $.Values.cluster-api.core.fetchConfig.selector }}
fetchConfig:
{{- if $.Values.capi.configSecret.url }}
url: {{ $.Values.capi.configSecret.url }}
{{- if $.Values.cluster-api.core.fetchConfig.url }}
url: {{ $.Values.cluster-api.core.fetchConfig.url }}
{{- end }}
{{- if $.Values.capi.configSecret.selector }}
selector: {{ $.Values.capi.configSecret.selector }}
{{- if $.Values.cluster-api.core.fetchConfig.selector }}
selector: {{ $.Values.cluster-api.core.fetchConfig.selector }}
{{- end }}
{{- end }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: capi-additional-rbac-roles
namespace: {{ .Values.capi.namespace }}
namespace: {{ .Values.cluster-api.core.namespace }}
annotations:
"helm.sh/hook": "post-install, post-upgrade"
"helm.sh/hook-weight": "2"
Expand Down
36 changes: 36 additions & 0 deletions charts/rancher-turtles/templates/kubeadm-bootstrap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{{- if .Values.cluster-api.enabled }}
---
apiVersion: v1
kind: Namespace
metadata:
annotations:
"helm.sh/hook": "post-install, post-upgrade"
"helm.sh/hook-weight": "1"
name: {{ .Values.cluster-api.kubeadm-bootstrap.namespace }}
---
apiVersion: operator.cluster.x-k8s.io/v1alpha1
kind: BootstrapProvider
metadata:
name: kubeadm
namespace: {{ .Values.cluster-api.kubeadm-bootstrap.namespace }}
annotations:
"helm.sh/hook": "post-install, post-upgrade"
"helm.sh/hook-weight": "2"
spec:
version: {{ $.Values.cluster-api.version }}
{{- if $.Values.cluster-api.configSecret.name }}
secretName: {{ $.Values.cluster-api.configSecret.name }}
{{- if $.Values.cluster-api.configSecret.namespace }}
secretNamespace: {{ $.Values.cluster-api.configSecret.namespace }}
{{- end }}
{{- end }}
{{- if or $.Values.cluster-api.kubeadm-bootstrap.fetchConfig.url $.Values.cluster-api.kubeadm-bootstrap.fetchConfig.selector }}
fetchConfig:
{{- if $.Values.cluster-api.kubeadm-bootstrap.fetchConfig.url }}
url: {{ $.Values.cluster-api.kubeadm-bootstrap.fetchConfig.url }}
{{- end }}
{{- if $.Values.cluster-api.kubeadm-bootstrap.fetchConfig.selector }}
selector: {{ $.Values.cluster-api.kubeadm-bootstrap.fetchConfig.selector }}
{{- end }}
{{- end }}
{{- end }}
36 changes: 36 additions & 0 deletions charts/rancher-turtles/templates/kubeadm-control-plane.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{{- if .Values.cluster-api.enabled }}
---
apiVersion: v1
kind: Namespace
metadata:
annotations:
"helm.sh/hook": "post-install, post-upgrade"
"helm.sh/hook-weight": "1"
name: {{ .Values.cluster-api.kubeadm-control-plane.namespace }}
---
apiVersion: operator.cluster.x-k8s.io/v1alpha1
kind: BootstrapProvider
metadata:
name: kubeadm
namespace: {{ .Values.cluster-api.kubeadm-control-plane.namespace }}
annotations:
"helm.sh/hook": "post-install, post-upgrade"
"helm.sh/hook-weight": "2"
spec:
version: {{ $.Values.cluster-api.version }}
{{- if $.Values.cluster-api.configSecret.name }}
secretName: {{ $.Values.cluster-api.configSecret.name }}
{{- if $.Values.cluster-api.configSecret.namespace }}
secretNamespace: {{ $.Values.cluster-api.configSecret.namespace }}
{{- end }}
{{- end }}
{{- if or $.Values.cluster-api.kubeadm-control-plane.fetchConfig.url $.Values.cluster-api.kubeadm-control-plane.fetchConfig.selector }}
fetchConfig:
{{- if $.Values.cluster-api.kubeadm-control-plane.fetchConfig.url }}
url: {{ $.Values.cluster-api.kubeadm-control-plane.fetchConfig.url }}
{{- end }}
{{- if $.Values.cluster-api.kubeadm-control-plane.fetchConfig.selector }}
selector: {{ $.Values.cluster-api.kubeadm-control-plane.fetchConfig.selector }}
{{- end }}
{{- end }}
{{- end }}
22 changes: 17 additions & 5 deletions charts/rancher-turtles/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,26 @@ rancherTurtles:
tag: v0.0.0
imagePullPolicy: Never
namespace: rancher-turtles-system
capi:
cluster-api:
enabled: true
namespace: capi-system
version: v1.4.6
configSecret:
name: ""
namespace: ""
fetchConfig:
url: ""
selector: ""
core:
namespace: capi-system
fetchConfig:
url: ""
selector: ""
kubeadm-bootstrap:
namespace: capi-kubeadm-bootstrap-system
fetchConfig:
url: ""
selector: ""
kubeadm-control-plane:
namespace: capi-kubeadm-control-plane-system
fetchConfig:
url: ""
selector: ""
cluster-api-operator:
enabled: true

0 comments on commit e99f3f0

Please sign in to comment.