X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=deploy%2Fcluster%2Ftemplates%2Fkubeadmcontrolplane.yaml;h=f49f7a1d0ae94e32c1b72c6ac4f3ccbc866a90f8;hb=HEAD;hp=3342c7305b4bedbef8f236e8ad4387102ad009c4;hpb=53692156832a326a5d1123e3284a3f8737ed395f;p=icn.git diff --git a/deploy/cluster/templates/kubeadmcontrolplane.yaml b/deploy/cluster/templates/kubeadmcontrolplane.yaml index 3342c73..f49f7a1 100644 --- a/deploy/cluster/templates/kubeadmcontrolplane.yaml +++ b/deploy/cluster/templates/kubeadmcontrolplane.yaml @@ -12,6 +12,7 @@ spec: initConfiguration: nodeRegistration: kubeletExtraArgs: + {{- include "cluster.nodeIP" .Values.networkData | nindent 10 }} node-labels: metal3.io/uuid={{ "{{" }} ds.meta_data.uuid {{ "}}" }} cpu-manager-policy: static topology-manager-policy: best-effort @@ -27,10 +28,8 @@ spec: kube-reserved: cpu=200m,memory=512Mi name: '{{ "{{" }} ds.meta_data.name {{ "}}" }}' preKubeadmCommands: -{{- if .Values.networks }} - # Without touching up /etc/hosts, kubeadm may pick the wrong - # (i.e. provisioning network) address for the node IP - - sed -i "1i $(ip -4 addr show dev {{ .Values.networks.baremetal.interface }} | grep -oP '(?<=inet\s)\d+(\.\d+){3}' | head -1) $(hostname)" /etc/hosts +{{- if .Values.preKubeadmCommands }} +{{ toYaml .Values.preKubeadmCommands | indent 4 }} {{- end }} - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - - add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" @@ -64,6 +63,8 @@ spec: # This must be done after kubeadm as the cabpk provider relies on # files in /var/run, which won't persist after a reboot - /usr/local/bin/set_kernel_cmdline.sh + # Required for OpenEBS support + - /usr/local/bin/enable_iscsi.sh files: {{ include "cluster.keepalived" .Values | indent 4 }} {{ include "cluster.containerRuntime" .Values | indent 4 }} @@ -82,6 +83,16 @@ spec: permissions: '0777' content: | {{ $.Files.Get "resources/set_kernel_cmdline.sh" | indent 8 }} + - path: /usr/local/bin/enable_iscsi.sh + permissions: '0777' + content: | +{{ $.Files.Get "resources/enable_iscsi.sh" | indent 8 }} +{{- if eq .Values.cni "calico" }} + - path: /etc/NetworkManager/conf.d/calico.conf + content: | +{{ $.Files.Get "resources/calico.conf" | indent 8 }} +{{- end }} +{{- if .Values.userData }} users: - name: {{ .Values.userData.name }} shell: /bin/bash @@ -94,6 +105,7 @@ spec: - name: root sshAuthorizedKeys: - {{ .Values.userData.sshAuthorizedKey }} +{{- end }} machineTemplate: infrastructureRef: apiVersion: infrastructure.cluster.x-k8s.io/v1alpha5