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
2 changes: 1 addition & 1 deletion charts/capi-cloudstack/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ keywords:
- bootstrapping
- kubernetes
- cloudstack
version: 0.3.0
version: 1.0.0
home: https://cluster-api.sigs.k8s.io/
sources:
- https://cluster-api.sigs.k8s.io/
Expand Down
15 changes: 8 additions & 7 deletions charts/capi-cloudstack/templates/machine-deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{{- range $index, $md := .Values.machineDeployments }}
{{- $object := dict "MachineDeployment" $md "Index" $index "Context" $ -}}
{{- $kadmconfig := merge (default dict $md.kubeadm) $.Values.kubeadm }}
---
apiVersion: cluster.x-k8s.io/{{ $.Values.clusterapiVersion }}
kind: MachineDeployment
Expand Down Expand Up @@ -34,18 +35,18 @@ metadata:
spec:
template:
spec:
{{ if $.Values.kubeadm.users }}
users: {{ toYaml $.Values.kubeadm.users | nindent 8 }}
{{ if $kadmconfig.users }}
users: {{ toYaml $kadmconfig.users | nindent 8 }}
{{ end }}
joinConfiguration:
{{- toYaml (required ".Values.kubeadm.joinConfiguration"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this message be updated?

Copy link
Author

Choose a reason for hiding this comment

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

In general at the event of no defining any spec on the machine deploy the general kubeadm configs will be applied. This line does the trick

It can be a good place to harden a litle bit control planes or any other machine deploy granting different users access to those.

$.Values.kubeadm.joinConfiguration ) | nindent 8 }}
{{ if $.Values.kubeadm.files }}
$kadmconfig.joinConfiguration ) | nindent 8 }}
{{ if $kadmconfig.files }}
files:
{{- toYaml $.Values.kubeadm.files | nindent 8 }}
{{- toYaml $kadmconfig.files | nindent 8 }}
{{ end -}}
{{ if $.Values.kubeadm.preKubeadmCommands }}
{{ if $kadmconfig.preKubeadmCommands }}
preKubeadmCommands:
{{- toYaml $.Values.kubeadm.preKubeadmCommands | nindent 8 }}
{{- toYaml $kadmconfig.preKubeadmCommands | nindent 8 }}
{{ end }}
{{ end }}
4 changes: 4 additions & 0 deletions charts/capi-cloudstack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ machineTemplates: []
# - name: production
# templateName: prodTemplate
# replicas: 3
# kubeadm:
# preKubeadmCommands:
# - swapoff -a
# - sudo apt update
# - name: develop
# templateName: smallTemplate
# replicas: 2
Expand Down