Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Centralize configuration of kind version/image in GitHub Action workflows #30916

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/actions/lvh-kind/action.yaml
Expand Up @@ -8,7 +8,8 @@ inputs:
kind-params:
required: true
type: string
kind-image-vsn:
kind-image:
required: true
type: string
test-name:
required: true
Expand Down Expand Up @@ -36,9 +37,8 @@ runs:
provision: 'false'
cmd: |
cd /host
if [ "${{ inputs.kind-image-vsn }}" != "" ]; then
export IMAGE=kindest/node:${{ inputs.kind-image-vsn }}
fi

export IMAGE=${{ inputs.kind-image }}
./contrib/scripts/kind.sh ${{ inputs.kind-params }} 0.0.0.0 6443

- name: Copy kubeconfig
Expand Down
10 changes: 10 additions & 0 deletions .github/actions/set-env-variables/action.yml
Expand Up @@ -16,3 +16,13 @@ runs:
echo "CILIUM_CLI_VERSION=$CILIUM_CLI_VERSION" >> $GITHUB_ENV
echo "PUSH_TO_DOCKER_HUB=true" >> $GITHUB_ENV
echo "GCP_PERF_RESULTS_BUCKET=gs://cilium-scale-results" >> $GITHUB_ENV

# renovate: datasource=github-releases depName=kubernetes-sigs/kind
KIND_VERSION="v0.22.0"
# renovate: datasource=docker
KIND_K8S_IMAGE="kindest/node:v1.29.2@sha256:51a1434a5397193442f0be2a297b488b6c919ce8a3931be0ce822606ea5ca245"
KIND_K8S_VERSION=$(echo "$KIND_K8S_IMAGE" | sed -r 's|.+:(v[0-9a-z.-]+)(@.+)?|\1|')

echo "KIND_VERSION=$KIND_VERSION" >> $GITHUB_ENV
echo "KIND_K8S_IMAGE=$KIND_K8S_IMAGE" >> $GITHUB_ENV
echo "KIND_K8S_VERSION=$KIND_K8S_VERSION" >> $GITHUB_ENV
2 changes: 0 additions & 2 deletions .github/kind-config-ipv6.yaml
Expand Up @@ -2,7 +2,6 @@ kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
image: kindest/node:v1.29.1@sha256:a0cc28af37cf39b019e2b448c54d1a3f789de32536cb5a5db61a49623e527144
kubeadmConfigPatches:
# To make sure that there is no taint for master node.
# Otherwise additional worker node might be required for conformance testing.
Expand All @@ -12,7 +11,6 @@ nodes:
nodeRegistration:
taints: []
- role: worker
image: kindest/node:v1.29.1@sha256:a0cc28af37cf39b019e2b448c54d1a3f789de32536cb5a5db61a49623e527144
networking:
ipFamily: ipv6
disableDefaultCNI: true
Expand Down
2 changes: 0 additions & 2 deletions .github/kind-config.yaml
Expand Up @@ -2,7 +2,6 @@ kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
image: kindest/node:v1.29.1@sha256:a0cc28af37cf39b019e2b448c54d1a3f789de32536cb5a5db61a49623e527144
kubeadmConfigPatches:
# To make sure that there is no taint for master node.
# Otherwise additional worker node might be required for conformance testing.
Expand All @@ -12,7 +11,6 @@ nodes:
nodeRegistration:
taints: []
- role: worker
image: kindest/node:v1.29.1@sha256:a0cc28af37cf39b019e2b448c54d1a3f789de32536cb5a5db61a49623e527144
networking:
disableDefaultCNI: true
podSubnet: "10.244.0.0/16"
Expand Down
3 changes: 0 additions & 3 deletions .github/kind-config.yaml.tmpl
Expand Up @@ -2,7 +2,6 @@ kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
image: kindest/node:${K8S_VERSION}
kubeadmConfigPatches:
# To make sure that there is no taint for master node.
# Otherwise additional worker node might be required for conformance testing.
Expand All @@ -12,9 +11,7 @@ nodes:
nodeRegistration:
taints: []
- role: worker
image: kindest/node:${K8S_VERSION}
- role: worker
image: kindest/node:${K8S_VERSION}
networking:
disableDefaultCNI: true
ipFamily: ${IPFAMILY}
Expand Down
5 changes: 2 additions & 3 deletions .github/renovate.json5
Expand Up @@ -13,8 +13,6 @@
".github/actions/lvh-kind/**",
".github/actions/set-env-variables/action.yml",
".github/workflows/**",
".github/kind-config.yaml",
".github/kind-config-ipv6.yaml",
"images/**",
"examples/hubble/*",
"go.mod",
Expand Down Expand Up @@ -502,7 +500,8 @@
"^.github/actions/set-env-variables/action\\.yml$"
],
"matchStrings": [
"# renovate: datasource=(?<datasource>.*?) depName=(?<depName>.*?)\\s+.+_VERSION=\"(?<currentValue>.*)\""
"# renovate: datasource=(?<datasource>.*?) depName=(?<depName>.*?)\\s+.+_VERSION=\"(?<currentValue>.*)\"",
"# renovate: datasource=(?<datasource>.*?)\\s+KIND_K8S_IMAGE=\"(?<depName>.*):(?<currentValue>.*)@(?<currentDigest>sha256:[a-f0-9]+)\""
]
},
{
Expand Down
20 changes: 8 additions & 12 deletions .github/workflows/conformance-clustermesh.yaml
Expand Up @@ -55,10 +55,6 @@ concurrency:
cancel-in-progress: true

env:
# renovate: datasource=github-releases depName=kubernetes-sigs/kind
kind_version: v0.22.0
# renovate: datasource=docker depName=kindest/node
k8s_version: v1.29.2
cilium_cli_ci_version:
CILIUM_CLI_MODE: helm
clusterName1: cluster1-${{ github.run_id }}
Expand Down Expand Up @@ -301,15 +297,13 @@ jobs:

- name: Generate Kind configuration files
run: |
K8S_VERSION=${{ env.k8s_version }} \
PODCIDR=${{ steps.vars.outputs.kind_pod_cidr_1 }} \
PODCIDR=${{ steps.vars.outputs.kind_pod_cidr_1 }} \
SVCCIDR=${{ steps.vars.outputs.kind_svc_cidr_1 }} \
IPFAMILY=${{ matrix.ipFamily }} \
KUBEPROXYMODE=${{ matrix.kube-proxy }} \
envsubst < ./.github/kind-config.yaml.tmpl > ./.github/kind-config-cluster1.yaml

K8S_VERSION=${{ env.k8s_version }} \
PODCIDR=${{ steps.vars.outputs.kind_pod_cidr_2 }} \
PODCIDR=${{ steps.vars.outputs.kind_pod_cidr_2 }} \
SVCCIDR=${{ steps.vars.outputs.kind_svc_cidr_2 }} \
IPFAMILY=${{ matrix.ipFamily }} \
KUBEPROXYMODE=${{ matrix.kube-proxy }} \
Expand All @@ -319,17 +313,19 @@ jobs:
uses: helm/kind-action@99576bfa6ddf9a8e612d83b513da5a75875caced # v1.9.0
with:
cluster_name: ${{ env.clusterName1 }}
version: ${{ env.kind_version }}
kubectl_version: ${{ env.k8s_version }}
version: ${{ env.KIND_VERSION }}
node_image: ${{ env.KIND_K8S_IMAGE }}
kubectl_version: ${{ env.KIND_K8S_VERSION }}
config: ./.github/kind-config-cluster1.yaml
wait: 0 # The control-plane never becomes ready, since no CNI is present

- name: Create Kind cluster 2
uses: helm/kind-action@99576bfa6ddf9a8e612d83b513da5a75875caced # v1.9.0
with:
cluster_name: ${{ env.clusterName2 }}
version: ${{ env.kind_version }}
kubectl_version: ${{ env.k8s_version }}
version: ${{ env.KIND_VERSION }}
node_image: ${{ env.KIND_K8S_IMAGE }}
kubectl_version: ${{ env.KIND_K8S_VERSION }}
config: ./.github/kind-config-cluster2.yaml
wait: 0 # The control-plane never becomes ready, since no CNI is present

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/conformance-e2e.yaml
Expand Up @@ -301,6 +301,7 @@ jobs:
test-name: e2e-conformance
kernel: ${{ matrix.kernel }}
kind-params: "${{ steps.kind-params.outputs.params }}"
kind-image: ${{ env.KIND_K8S_IMAGE }}

# Warning: since this is a privileged workflow, subsequent workflow job
# steps must take care not to execute untrusted code.
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/conformance-gateway-api.yaml
Expand Up @@ -58,8 +58,6 @@ concurrency:
env:
cilium_cli_ci_version:
CILIUM_CLI_MODE: helm
# renovate: datasource=github-releases depName=kubernetes-sigs/kind
kind_version: v0.22.0
kind_config: .github/kind-config.yaml
gateway_api_version: v1.0.0
timeout: 5m
Expand Down Expand Up @@ -149,8 +147,11 @@ jobs:
- name: Create kind cluster
uses: helm/kind-action@99576bfa6ddf9a8e612d83b513da5a75875caced # v1.9.0
with:
version: ${{ env.kind_version }}
version: ${{ env.KIND_VERSION }}
node_image: ${{ env.KIND_K8S_IMAGE }}
kubectl_version: ${{ env.KIND_K8S_VERSION }}
config: ${{ env.kind_config }}
wait: 0 # The control-plane never becomes ready, since no CNI is present

- name: Install Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/conformance-ingress.yaml
Expand Up @@ -57,8 +57,6 @@ concurrency:
env:
cilium_cli_ci_version:
CILIUM_CLI_MODE: helm
# renovate: datasource=github-releases depName=kubernetes-sigs/kind
kind_version: v0.22.0
kind_config: .github/kind-config.yaml
timeout: 5m

Expand Down Expand Up @@ -169,8 +167,11 @@ jobs:
- name: Create kind cluster
uses: helm/kind-action@99576bfa6ddf9a8e612d83b513da5a75875caced # v1.9.0
with:
version: ${{ env.kind_version }}
version: ${{ env.KIND_VERSION }}
node_image: ${{ env.KIND_K8S_IMAGE }}
kubectl_version: ${{ env.KIND_K8S_VERSION }}
config: ${{ env.kind_config }}
wait: 0 # The control-plane never becomes ready, since no CNI is present

- name: Checkout ingress-controller-conformance
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/conformance-ipsec-e2e.yaml
Expand Up @@ -187,6 +187,7 @@ jobs:
test-name: e2e-conformance
kernel: ${{ matrix.kernel }}
kind-params: "${{ steps.kind-params.outputs.params }}"
kind-image: ${{ env.KIND_K8S_IMAGE }}

# Warning: since this is a privileged workflow, subsequent workflow job
# steps must take care not to execute untrusted code.
Expand Down
14 changes: 5 additions & 9 deletions .github/workflows/conformance-k8s-kind-network-policies.yaml
Expand Up @@ -21,13 +21,9 @@ concurrency:
cancel-in-progress: true

env:
# renovate: datasource=github-releases depName=kubernetes-sigs/kind
kind_version: v0.22.0
cluster_name: cilium-testing
cilium_cli_ci_version:
CILIUM_CLI_MODE: helm
# renovate: datasource=docker depName=kindest/node
k8s_version: v1.29.2

jobs:
kubernetes-e2e-net-conformance:
Expand Down Expand Up @@ -60,14 +56,14 @@ jobs:
run: |
TMP_DIR=$(mktemp -d)
# Test binaries
curl -L https://dl.k8s.io/${{ env.k8s_version }}/kubernetes-test-linux-amd64.tar.gz -o ${TMP_DIR}/kubernetes-test-linux-amd64.tar.gz
curl -L https://dl.k8s.io/${{ env.KIND_K8S_VERSION }}/kubernetes-test-linux-amd64.tar.gz -o ${TMP_DIR}/kubernetes-test-linux-amd64.tar.gz
tar xvzf ${TMP_DIR}/kubernetes-test-linux-amd64.tar.gz \
--directory ${TMP_DIR} \
--strip-components=3 kubernetes/test/bin/ginkgo kubernetes/test/bin/e2e.test
# kubectl
curl -L https://dl.k8s.io/${{ env.k8s_version }}/bin/linux/amd64/kubectl -o ${TMP_DIR}/kubectl
curl -L https://dl.k8s.io/${{ env.KIND_K8S_VERSION }}/bin/linux/amd64/kubectl -o ${TMP_DIR}/kubectl
# kind
curl -Lo ${TMP_DIR}/kind https://kind.sigs.k8s.io/dl/${{ env.kind_version }}/kind-linux-amd64
curl -Lo ${TMP_DIR}/kind https://kind.sigs.k8s.io/dl/${{ env.KIND_VERSION }}/kind-linux-amd64
# Install
sudo cp ${TMP_DIR}/ginkgo /usr/local/bin/ginkgo
sudo cp ${TMP_DIR}/e2e.test /usr/local/bin/e2e.test
Expand All @@ -80,8 +76,8 @@ jobs:
run: |
cat <<EOF | /usr/local/bin/kind create cluster \
--name ${{ env.cluster_name}} \
--image kindest/node:${{ env.k8s_version }} \
-v7 --wait 1m --retain --config=-
--image ${{ env.KIND_K8S_IMAGE }} \
-v7 --retain --config=-
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
networking:
Expand Down
15 changes: 5 additions & 10 deletions .github/workflows/conformance-k8s-kind.yaml
Expand Up @@ -21,13 +21,9 @@ concurrency:
cancel-in-progress: true

env:
# renovate: datasource=github-releases depName=kubernetes-sigs/kind
kind_version: v0.22.0
cluster_name: cilium-testing
cilium_cli_ci_version:
CILIUM_CLI_MODE: helm
# renovate: datasource=docker depName=kindest/node
k8s_version: v1.29.2

jobs:
kubernetes-e2e:
Expand Down Expand Up @@ -60,14 +56,14 @@ jobs:
run: |
TMP_DIR=$(mktemp -d)
# Test binaries
curl -L https://dl.k8s.io/${{ env.k8s_version }}/kubernetes-test-linux-amd64.tar.gz -o ${TMP_DIR}/kubernetes-test-linux-amd64.tar.gz
curl -L https://dl.k8s.io/${{ env.KIND_K8S_VERSION }}/kubernetes-test-linux-amd64.tar.gz -o ${TMP_DIR}/kubernetes-test-linux-amd64.tar.gz
tar xvzf ${TMP_DIR}/kubernetes-test-linux-amd64.tar.gz \
--directory ${TMP_DIR} \
--strip-components=3 kubernetes/test/bin/ginkgo kubernetes/test/bin/e2e.test
# kubectl
curl -L https://dl.k8s.io/${{ env.k8s_version }}/bin/linux/amd64/kubectl -o ${TMP_DIR}/kubectl
curl -L https://dl.k8s.io/${{ env.KIND_K8S_VERSION }}/bin/linux/amd64/kubectl -o ${TMP_DIR}/kubectl
# kind
curl -Lo ${TMP_DIR}/kind https://kind.sigs.k8s.io/dl/${{ env.kind_version }}/kind-linux-amd64
curl -Lo ${TMP_DIR}/kind https://kind.sigs.k8s.io/dl/${{ env.KIND_VERSION }}/kind-linux-amd64
# Install
sudo cp ${TMP_DIR}/ginkgo /usr/local/bin/ginkgo
sudo cp ${TMP_DIR}/e2e.test /usr/local/bin/e2e.test
Expand All @@ -80,8 +76,8 @@ jobs:
run: |
cat <<EOF | /usr/local/bin/kind create cluster \
--name ${{ env.cluster_name}} \
--image kindest/node:${{ env.k8s_version }} \
-v7 --wait 1m --retain --config=-
--image ${{ env.KIND_K8S_IMAGE }} \
-v7 --retain --config=-
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
networking:
Expand Down Expand Up @@ -242,4 +238,3 @@ jobs:
uses: aanm/junit2md@332ebf0fddd34e91b03a832cfafaa826306558f9 # v0.0.3
with:
junit-directory: "_artifacts"

5 changes: 3 additions & 2 deletions .github/workflows/conformance-k8s-network-policies.yaml
Expand Up @@ -12,8 +12,6 @@ permissions: read-all

env:
cilium_cli_ci_version:
# renovate: datasource=github-releases depName=kubernetes-sigs/kind
KIND_VERSION: v0.22.0
KIND_CONFIG: .github/kind-config.yaml
CONFORMANCE_TEMPLATE: examples/kubernetes/connectivity-check/connectivity-check.yaml
TIMEOUT: 2m
Expand Down Expand Up @@ -84,7 +82,10 @@ jobs:
uses: helm/kind-action@99576bfa6ddf9a8e612d83b513da5a75875caced # v1.9.0
with:
version: ${{ env.KIND_VERSION }}
node_image: ${{ env.KIND_K8S_IMAGE }}
kubectl_version: ${{ env.KIND_K8S_VERSION }}
config: ${{ env.KIND_CONFIG }}
wait: 0 # The control-plane never becomes ready, since no CNI is present

- name: Install cilium chart
id: install-cilium
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/conformance-kind-proxy-daemonset.yaml
Expand Up @@ -21,8 +21,6 @@ concurrency:
cancel-in-progress: true

env:
# renovate: datasource=github-releases depName=kubernetes-sigs/kind
kind_version: v0.22.0
kind_config: .github/kind-config.yaml
cilium_cli_ci_version:
CILIUM_CLI_MODE: helm
Expand Down Expand Up @@ -83,8 +81,11 @@ jobs:
- name: Create kind cluster
uses: helm/kind-action@99576bfa6ddf9a8e612d83b513da5a75875caced # v1.9.0
with:
version: ${{ env.kind_version }}
version: ${{ env.KIND_VERSION }}
node_image: ${{ env.KIND_K8S_IMAGE }}
kubectl_version: ${{ env.KIND_K8S_VERSION }}
config: ${{ env.kind_config }}
wait: 0 # The control-plane never becomes ready, since no CNI is present

- name: Wait for images to be available
timeout-minutes: 30
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/conformance-multi-pool.yaml
Expand Up @@ -56,8 +56,6 @@ concurrency:

env:
cilium_cli_ci_version:
# renovate: datasource=github-releases depName=kubernetes-sigs/kind
kind_version: v0.22.0
kind_config: .github/kind-config.yaml
timeout: 5m

Expand Down Expand Up @@ -171,8 +169,11 @@ jobs:
- name: Create kind cluster
uses: helm/kind-action@99576bfa6ddf9a8e612d83b513da5a75875caced # v1.9.0
with:
version: ${{ env.kind_version }}
version: ${{ env.KIND_VERSION }}
node_image: ${{ env.KIND_K8S_IMAGE }}
kubectl_version: ${{ env.KIND_K8S_VERSION }}
config: ${{ env.kind_config }}
wait: 0 # The control-plane never becomes ready, since no CNI is present

- name: Wait for images to be available
timeout-minutes: 30
Expand Down