Skip to content

Commit

Permalink
Use k8s 1.30.3 (#668)
Browse files Browse the repository at this point in the history
- Use RKE2_VERSION where possible
- Rename vsphere CPI_IMAGE_VERSION

Signed-off-by: Danil-Grigorev <[email protected]>
  • Loading branch information
Danil-Grigorev authored Aug 16, 2024
1 parent 4400b32 commit 2276e2e
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test_chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
uses: helm/[email protected]
with:
cluster_name: kind
node_image: kindest/node:v1.30.0
node_image: kindest/node:v1.30.3

- name: Add local docker image
run: kind load docker-image ${{ env.MANIFEST_IMG }}:${{ env.TAG }}
Expand Down
23 changes: 9 additions & 14 deletions hack/ensure-kubectl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,26 @@ fi
source "$(dirname "${BASH_SOURCE[0]}")/utils.sh"

GOPATH_BIN="$(go env GOPATH)/bin/"
MINIMUM_KUBECTL_VERSION=v1.30.0
MINIMUM_KUBECTL_VERSION=v1.30.3
goarch="$(go env GOARCH)"
goos="$(go env GOOS)"

# Ensure the kubectl tool exists and is a viable version, or installs it
verify_kubectl_version() {

local kubectl_version
IFS=" " read -ra kubectl_version <<< "$(kubectl version --client || echo 'v0.0.0')"

# If kubectl is not available on the path, get it
if ! [ -x "$(command -v kubectl)" ]; then
if ! [ -x "$(command -v kubectl)" ] || [[ "${MINIMUM_KUBECTL_VERSION}" != $(echo -e "${MINIMUM_KUBECTL_VERSION}\n${kubectl_version[2]}" | sort -s -t. -k 1,1 -k 2,2n -k 3,3n | head -n1) ]]; then
if [ "$goos" == "linux" ] || [ "$goos" == "darwin" ]; then
if ! [ -d "${GOPATH_BIN}" ]; then
mkdir -p "${GOPATH_BIN}"
fi
echo 'kubectl not found, installing'

echo "kubectl not found or below ${MINIMUM_KUBECTL_VERSION}, installing"
echo "Updating to ${MINIMUM_KUBECTL_VERSION}."

curl -sLo "${GOPATH_BIN}/kubectl" "https://dl.k8s.io/release/${MINIMUM_KUBECTL_VERSION}/bin/${goos}/${goarch}/kubectl"
chmod +x "${GOPATH_BIN}/kubectl"
verify_gopath_bin
Expand All @@ -48,17 +54,6 @@ verify_kubectl_version() {
return 2
fi
fi

local kubectl_version
IFS=" " read -ra kubectl_version <<< "$(kubectl version --client)"
if [[ "${MINIMUM_KUBECTL_VERSION}" != $(echo -e "${MINIMUM_KUBECTL_VERSION}\n${kubectl_version[2]}" | sort -s -t. -k 1,1 -k 2,2n -k 3,3n | head -n1) ]]; then
cat <<EOF
Detected kubectl version: ${kubectl_version[2]}.
Requires ${MINIMUM_KUBECTL_VERSION} or greater.
Please install ${MINIMUM_KUBECTL_VERSION} or later.
EOF
return 2
fi
}

install_plugins() {
Expand Down
2 changes: 1 addition & 1 deletion scripts/kind-cluster-with-extramounts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: kind.x-k8s.io/v1alpha4
name: capi-test
nodes:
- role: control-plane
image: kindest/node:v1.30.0
image: kindest/node:v1.30.3
extraMounts:
- hostPath: /var/run/docker.sock
containerPath: /var/run/docker.sock
4 changes: 2 additions & 2 deletions test/e2e/config/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ variables:
HELM_BINARY_PATH: "helm"
HELM_EXTRA_VALUES_FOLDER: "/tmp"
KUBERNETES_VERSION: "v1.30.3"
KUBERNETES_MANAGEMENT_VERSION: "v1.30.0"
KUBERNETES_MANAGEMENT_VERSION: "v1.30.3"
RKE2_VERSION: "v1.30.3+rke2r1"
KUBERNETES_MANAGEMENT_AWS_REGION: "eu-west-2"
RANCHER_HOSTNAME: "localhost"
Expand All @@ -49,7 +49,7 @@ variables:
TURTLES_PATH: "turtles/rancher-turtles"
TURTLES_REPO_NAME: "turtles"
TURTLES_URL: https://rancher.github.io/turtles
CPI_IMAGE_K8S_VERSION: "v1.30.0"
CPI_IMAGE_VERSION: "v1.30.1"
RANCHER_REPO_NAME: "rancher-latest"
RANCHER_ALPHA_REPO_NAME: "rancher-alpha"
RANCHER_URL: "https://releases.rancher.com/server-charts/latest"
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/data/cluster-templates/docker-rke2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ metadata:
name: ${CLUSTER_NAME}-control-plane
spec:
replicas: ${CONTROL_PLANE_MACHINE_COUNT}
version: ${KUBERNETES_VERSION}+rke2r1
version: ${RKE2_VERSION}
registrationMethod: internal-first
rolloutStrategy:
rollingUpdate:
Expand Down Expand Up @@ -94,7 +94,7 @@ spec:
cluster.x-k8s.io/cluster-name: ${CLUSTER_NAME}
template:
spec:
version: ${KUBERNETES_VERSION}+rke2r1
version: ${RKE2_VERSION}
clusterName: ${CLUSTER_NAME}
bootstrap:
configRef:
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/data/cluster-templates/vsphere-kubeadm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@ data:
- --v=2
- --cloud-provider=vsphere
- --cloud-config=/etc/cloud/vsphere.conf
image: gcr.io/cloud-provider-vsphere/cpi/release/manager:${CPI_IMAGE_K8S_VERSION}
image: gcr.io/cloud-provider-vsphere/cpi/release/manager:${CPI_IMAGE_VERSION}
name: vsphere-cloud-controller-manager
resources:
requests:
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/data/cluster-templates/vsphere-rke2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,7 @@ data:
- --v=2
- --cloud-provider=vsphere
- --cloud-config=/etc/cloud/vsphere.conf
image: gcr.io/cloud-provider-vsphere/cpi/release/manager:${CPI_IMAGE_K8S_VERSION}
image: gcr.io/cloud-provider-vsphere/cpi/release/manager:${CPI_IMAGE_VERSION}
name: vsphere-cloud-controller-manager
resources:
requests:
Expand Down

0 comments on commit 2276e2e

Please sign in to comment.