Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.

Commit d16e066

Browse files
committed
feat: allow installation of the latest semantic version
1 parent ac0bbf8 commit d16e066

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

templates/cluster-template.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ spec:
4848
- apt-key fingerprint 0EBFCD88
4949
- add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
5050
- apt-get update -y
51-
- apt-get install -y ca-certificates socat jq ebtables apt-transport-https cloud-utils prips docker-ce docker-ce-cli containerd.io kubelet kubeadm kubectl
51+
- TRIMMED_KUBERNETES_VERSION=$(echo $KUBERNETES_VERSION | sed 's/\./\\./g' | sed 's/^v//')
52+
- RESOLVED_KUBERNETES_VERSION=$(apt-cache policy kubelet | awk -v "VERSION=${TRIMMED_KUBERNETES_VERSION}" '$1~ VERSION { print $1 }' | head -n1)
53+
- apt-get install -y ca-certificates socat jq ebtables apt-transport-https cloud-utils prips docker-ce docker-ce-cli containerd.io kubelet=${RESOLVED_KUBERNETES_VERSION} kubeadm=${RESOLVED_KUBERNETES_VERSION} kubectl=${RESOLVED_KUBERNETES_VERSION}
5254
- systemctl daemon-reload
5355
- systemctl enable docker
5456
- systemctl start docker
@@ -160,7 +162,9 @@ spec:
160162
- apt-key fingerprint 0EBFCD88
161163
- add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
162164
- apt-get update -y
163-
- apt-get install -y ca-certificates socat jq ebtables apt-transport-https cloud-utils prips docker-ce docker-ce-cli containerd.io kubelet kubeadm kubectl
165+
- TRIMMED_KUBERNETES_VERSION=$(echo $KUBERNETES_VERSION | sed 's/\./\\./g' | sed 's/^v//')
166+
- RESOLVED_KUBERNETES_VERSION=$(apt-cache policy kubelet | awk -v "VERSION=${TRIMMED_KUBERNETES_VERSION}" '$1~ VERSION { print $1 }' | head -n1)
167+
- apt-get install -y ca-certificates socat jq ebtables apt-transport-https cloud-utils prips docker-ce docker-ce-cli containerd.io kubelet=${RESOLVED_KUBERNETES_VERSION} kubeadm=${RESOLVED_KUBERNETES_VERSION} kubectl=${RESOLVED_KUBERNETES_VERSION}
164168
- systemctl daemon-reload
165169
- systemctl enable docker
166170
- systemctl start docker

0 commit comments

Comments
 (0)