From 0aa4eec99b540a2f6fbc1f0ef57383612aec6252 Mon Sep 17 00:00:00 2001 From: Todd Malsbary Date: Mon, 13 Dec 2021 12:33:46 -0800 Subject: [PATCH] Make userData optional in cluster chart The userData may be specified completely by the machine chart. Signed-off-by: Todd Malsbary Change-Id: I6761fc90ed924c97062728b8205aa009e379add7 --- deploy/cluster/templates/kubeadmconfigtemplate.yaml | 2 ++ deploy/cluster/templates/kubeadmcontrolplane.yaml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/deploy/cluster/templates/kubeadmconfigtemplate.yaml b/deploy/cluster/templates/kubeadmconfigtemplate.yaml index 0172dc7..33afc28 100644 --- a/deploy/cluster/templates/kubeadmconfigtemplate.yaml +++ b/deploy/cluster/templates/kubeadmconfigtemplate.yaml @@ -47,6 +47,7 @@ spec: permissions: '0777' content: | {{ $.Files.Get "resources/set_kernel_cmdline.sh" | indent 10 }} +{{- if .Values.userData }} users: - name: {{ .Values.userData.name }} shell: /bin/bash @@ -59,3 +60,4 @@ spec: - name: root sshAuthorizedKeys: - {{ .Values.userData.sshAuthorizedKey }} +{{- end }} diff --git a/deploy/cluster/templates/kubeadmcontrolplane.yaml b/deploy/cluster/templates/kubeadmcontrolplane.yaml index 3342c73..c960733 100644 --- a/deploy/cluster/templates/kubeadmcontrolplane.yaml +++ b/deploy/cluster/templates/kubeadmcontrolplane.yaml @@ -82,6 +82,7 @@ spec: permissions: '0777' content: | {{ $.Files.Get "resources/set_kernel_cmdline.sh" | indent 8 }} +{{- if .Values.userData }} users: - name: {{ .Values.userData.name }} shell: /bin/bash @@ -94,6 +95,7 @@ spec: - name: root sshAuthorizedKeys: - {{ .Values.userData.sshAuthorizedKey }} +{{- end }} machineTemplate: infrastructureRef: apiVersion: infrastructure.cluster.x-k8s.io/v1alpha5 -- 2.16.6