mirror of
https://github.com/jpetazzo/container.training.git
synced 2026-07-18 12:29:18 +00:00
🔧 Pass kubernetesVersion: in kubeadm config file
This commit is contained in:
@@ -453,6 +453,7 @@ _cmd_kube() {
|
||||
need_tag
|
||||
|
||||
if [ "$KUBEVERSION" ]; then
|
||||
CLUSTER_CONFIGURATION_KUBERNETESVERSION='kubernetesVersion: "v'$KUBEVERSION'"'
|
||||
pssh "
|
||||
sudo tee /etc/apt/preferences.d/kubernetes <<EOF
|
||||
Package: kubectl kubeadm kubelet
|
||||
@@ -480,13 +481,6 @@ EOF"
|
||||
echo 'alias k=kubectl' | sudo tee /etc/bash_completion.d/k &&
|
||||
echo 'complete -F __start_kubectl k' | sudo tee -a /etc/bash_completion.d/k"
|
||||
|
||||
# Disable swap
|
||||
# (note that this won't survive across node reboots!)
|
||||
if [ "$INFRACLASS" = "linode" ]; then
|
||||
pssh "
|
||||
sudo swapoff -a"
|
||||
fi
|
||||
|
||||
# Install a valid configuration for containerd
|
||||
# (first, the CRI interface needs to be re-enabled;
|
||||
# also, the correct systemd cgroup driver must be selected,
|
||||
@@ -527,6 +521,7 @@ apiVersion: kubeadm.k8s.io/v1beta3
|
||||
apiServer:
|
||||
certSANs:
|
||||
- \$(cat /tmp/ipv4)
|
||||
$CLUSTER_CONFIGURATION_KUBERNETESVERSION
|
||||
EOF
|
||||
sudo kubeadm init --config=/tmp/kubeadm-config.yaml
|
||||
fi"
|
||||
|
||||
@@ -7,7 +7,7 @@ USER_PASSWORD=training
|
||||
|
||||
# For a list of old versions, check:
|
||||
# https://kubernetes.io/releases/patch-releases/#non-active-branch-history
|
||||
KUBEVERSION=1.22.17
|
||||
KUBEVERSION=1.22.5
|
||||
|
||||
STEPS="
|
||||
wait
|
||||
|
||||
Reference in New Issue
Block a user