diff --git a/templates/cluster-template.yaml b/templates/cluster-template.yaml index 45fa2126d..df156df6f 100644 --- a/templates/cluster-template.yaml +++ b/templates/cluster-template.yaml @@ -62,7 +62,7 @@ spec: key: kubeadm-pre-init.sh permissions: "0500" preKubeadmCommands: - - /kubeadm-pre-init.sh '{{ ds.meta_data.label }}' ${KUBERNETES_VERSION#[vV]} + - /kubeadm-pre-init.sh '{{ ds.meta_data.label }}' ${KUBERNETES_VERSION} clusterConfiguration: apiServer: extraArgs: @@ -91,11 +91,11 @@ metadata: spec: template: spec: - image: ${LINODE_OS:=""} + image: ${LINODE_OS:="linode/ubuntu22.04"} type: ${LINODE_CONTROL_PLANE_MACHINE_TYPE} region: ${LINODE_REGION} authorizedKeys: - - ${LINODE_SSH_KEY:=""} + - ${LINODE_SSH_KEY} --- apiVersion: cluster.x-k8s.io/v1beta1 kind: MachineDeployment @@ -127,11 +127,11 @@ metadata: spec: template: spec: - image: ${LINODE_OS:=""} + image: ${LINODE_OS:="linode/ubuntu22.04"} type: ${LINODE_MACHINE_TYPE} region: ${LINODE_REGION} authorizedKeys: - - ${LINODE_SSH_KEY:=""} + - ${LINODE_SSH_KEY} --- apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 kind: KubeadmConfigTemplate @@ -163,7 +163,7 @@ spec: key: kubeadm-pre-init.sh permissions: "0500" preKubeadmCommands: - - /kubeadm-pre-init.sh '{{ ds.meta_data.label }}' ${KUBERNETES_VERSION#[vV]} + - /kubeadm-pre-init.sh '{{ ds.meta_data.label }}' ${KUBERNETES_VERSION} joinConfiguration: nodeRegistration: kubeletExtraArgs: @@ -199,7 +199,8 @@ stringData: export DEBIAN_FRONTEND=noninteractive hostnamectl set-hostname "$1" && hostname -F /etc/hostname mkdir -p -m 755 /etc/apt/keyrings - VERSION=$${2%.*} + VERSION=$${2#[v]} + VERSION=$${VERSION%.*} curl -fsSL "https://pkgs.k8s.io/core:/stable:/v$VERSION/deb/Release.key" | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg echo "deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v$VERSION/deb/ /" | sudo tee /etc/apt/sources.list.d/kubernetes.list apt-get update -y