Skip to content

Commit

Permalink
cicd: bump k8s version in the int tests (#978)
Browse files Browse the repository at this point in the history
* Bump k8s version int tests

* Introduce custom k3d provisioning gh action

* Remove github dir from ignore in dispatch check

* Remove github dir from ignore in dispatch check

* wip

* wip

* wip

* wip

* wip

* wip

* Fix lint

---------

Co-authored-by: Vladimir Videlov <[email protected]>
  • Loading branch information
kolodziejczak and videlov committed Aug 16, 2024
1 parent e9ee4c1 commit ef3c969
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 51 deletions.
19 changes: 7 additions & 12 deletions .github/actions/integration-test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,20 @@ runs:
- uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
- name: Create Single Cluster
uses: AbsaOSS/k3d-action@4e8b3239042be1dc0aed6c5eb80c13b18200fc79 #v2.4.0
- name: Create Cluster
uses: ./.github/actions/provision-k3d-cluster
with:
cluster-name: "test-cluster-1"
args: >-
--agents ${{ inputs.agents }}
--image docker.io/rancher/k3s:v1.28.2-k3s1
--servers-memory ${{ inputs.servers-memory }}
--port 80:80@loadbalancer
--port 443:443@loadbalancer
--k3s-arg "--disable=traefik@server:0"
k3s-version: "1.29.7"
agents: ${{ inputs.agents }}
servers-memory: ${{ inputs.servers-memory }}
- name: Run integration tests
shell: bash
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
k3d image import ${{ inputs.operator-image-name }} -c test-cluster-1
k3d image import ${{ inputs.operator-image-name }}
fi
kubectl config use-context k3d-test-cluster-1
kubectl config use-context k3d-k3s-default
if [ "${{ inputs.evaluation }}" == "true" ]; then
TEST_EVALUATION=TRUE EXPORT_RESULT=true IMG=${{ inputs.operator-image-name }} make istio-integration-test
else
Expand Down
19 changes: 6 additions & 13 deletions .github/actions/k8s-compatibility-test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,24 @@ runs:
- uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
- name: Create Single Cluster
uses: AbsaOSS/k3d-action@4e8b3239042be1dc0aed6c5eb80c13b18200fc79 #v2.4.0
- name: Create Cluster
uses: ./.github/actions/provision-k3d-cluster
with:
cluster-name: "test-cluster-1"
args: >-
--agents 2
--image docker.io/rancher/k3s:v1.29.4-k3s1
--servers-memory=16g
--port 80:80@loadbalancer
--port 443:443@loadbalancer
--k3s-arg "--disable=traefik@server:0"
k3s-version: "1.30.3"
- name: Run integration tests
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
k3d image import ${{ inputs.operator-image-name }} -c test-cluster-1
k3d image import ${{ inputs.operator-image-name }}
fi
kubectl config use-context k3d-test-cluster-1
kubectl config use-context k3d-k3s-default
EXPORT_RESULT=true IMG=${{ inputs.operator-image-name }} make istio-integration-test
shell: bash
- name: Check deprecations
run: |
set -eou pipefail
GO111MODULE=on go install github.com/prometheus/prom2json/cmd/[email protected]
kubectl get --context k3d-test-cluster-1 --raw /metrics | prom2json | jq '.[] | select(.name=="apiserver_requested_deprecated_apis").metrics[].labels' > deprecations.txt
kubectl get --context k3d-k3s-default --raw /metrics | prom2json | jq '.[] | select(.name=="apiserver_requested_deprecated_apis").metrics[].labels' > deprecations.txt
shell: bash
- uses: actions/upload-artifact@v4
with:
Expand Down
28 changes: 28 additions & 0 deletions .github/actions/provision-k3d-cluster/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: 'Provision k3d cluster'
description: 'Provisions a k3d cluster'
inputs:
k3s-version:
description: 'Kubernetes version'
required: true
agents:
description: 'Number of nodes in the cluster'
required: false
default: 1
servers-memory:
description: 'Number of GB for the node'
required: false
default: 16

runs:
using: "composite"
steps:
- name: Provision k3d cluster
shell: bash
run: |
curl -s https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash
k3d cluster create --agents ${{ inputs.agents }} \
--image docker.io/rancher/k3s:v${{ inputs.k3s-version }}-k3s1 \
--servers-memory=${{ inputs.servers-memory }}g \
--port 80:80@loadbalancer \
--port 443:443@loadbalancer \
--k3s-arg "--disable=traefik@server:0"
13 changes: 5 additions & 8 deletions .github/actions/upgrade-integration-test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,16 @@ runs:
- uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
- name: Create Single Cluster
uses: AbsaOSS/k3d-action@4e8b3239042be1dc0aed6c5eb80c13b18200fc79 #v2.4.0
- name: Create Cluster
uses: ./.github/actions/provision-k3d-cluster
with:
cluster-name: "test-cluster-1"
args: >-
--agents 0
--k3s-arg "--disable=traefik@server:0"
k3s-version: "1.29.7"
- name: Run upgrade integration test
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
k3d image import ${{ inputs.operator-image-name }} -c test-cluster-1
k3d image import ${{ inputs.operator-image-name }}
fi
kubectl config use-context k3d-test-cluster-1
kubectl config use-context k3d-k3s-default
EXPORT_RESULT=true IMG=${{ inputs.operator-image-name }} TARGET_BRANCH=${{inputs.target_branch}} make istio-upgrade-integration-test
shell: bash
10 changes: 5 additions & 5 deletions .github/workflows/main-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
- uses: ./.github/actions/integration-test
with:
operator-image-name: "europe-docker.pkg.dev/kyma-project/prod/istio-manager:${{github.sha}}"
servers-memory: "16g"
servers-memory: "16"
agents: 2

istio-integration-gcp:
Expand All @@ -93,7 +93,7 @@ jobs:
GARDENER_PROVIDER_SECRET_NAME: "goat"
GARDENER_PROVIDER: "gcp"
GARDENER_REGION: "europe-west3"
GARDENER_CLUSTER_VERSION: "1.28"
GARDENER_CLUSTER_VERSION: "1.29.7"
MACHINE_TYPE: "n2-standard-4"
DISK_SIZE: 50
DISK_TYPE: "pd-standard"
Expand Down Expand Up @@ -122,7 +122,7 @@ jobs:
GARDENER_PROJECT_NAME: "goats"
GARDENER_PROVIDER_SECRET_NAME: "aws-gardener-access"
GARDENER_PROVIDER: "aws"
GARDENER_CLUSTER_VERSION: "1.28"
GARDENER_CLUSTER_VERSION: "1.29.7"
GARDENER_REGION: "eu-west-1"
MACHINE_TYPE: "m5.xlarge"
DISK_SIZE: 50
Expand Down Expand Up @@ -153,7 +153,7 @@ jobs:
GARDENER_PROVIDER_SECRET_NAME: "goat"
GARDENER_PROVIDER: "gcp"
GARDENER_REGION: "europe-west3"
GARDENER_CLUSTER_VERSION: "1.28"
GARDENER_CLUSTER_VERSION: "1.29.7"
MACHINE_TYPE: "n2-standard-4"
DISK_SIZE: 50
DISK_TYPE: "pd-standard"
Expand Down Expand Up @@ -182,7 +182,7 @@ jobs:
GARDENER_PROJECT_NAME: "goats"
GARDENER_PROVIDER_SECRET_NAME: "aws-gardener-access"
GARDENER_PROVIDER: "aws"
GARDENER_CLUSTER_VERSION: "1.28"
GARDENER_CLUSTER_VERSION: "1.29.7"
GARDENER_REGION: "eu-west-1"
MACHINE_TYPE: "m5.xlarge"
DISK_SIZE: 50
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pull-integration-gardener.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
GARDENER_PROVIDER_SECRET_NAME: "goat"
GARDENER_PROVIDER: "gcp"
GARDENER_REGION: "europe-west3"
GARDENER_CLUSTER_VERSION: "1.28"
GARDENER_CLUSTER_VERSION: "1.29.7"
MACHINE_TYPE: "n2-standard-4"
DISK_SIZE: 50
DISK_TYPE: "pd-standard"
Expand Down Expand Up @@ -104,7 +104,7 @@ jobs:
GARDENER_PROJECT_NAME: "goats"
GARDENER_PROVIDER_SECRET_NAME: "aws-gardener-access"
GARDENER_PROVIDER: "aws"
GARDENER_CLUSTER_VERSION: "1.28"
GARDENER_CLUSTER_VERSION: "1.29.7"
GARDENER_REGION: "eu-west-1"
MACHINE_TYPE: "m5.xlarge"
DISK_SIZE: 50
Expand Down Expand Up @@ -136,7 +136,7 @@ jobs:
GARDENER_PROVIDER_SECRET_NAME: "goat"
GARDENER_PROVIDER: "gcp"
GARDENER_REGION: "europe-west3"
GARDENER_CLUSTER_VERSION: "1.28"
GARDENER_CLUSTER_VERSION: "1.29.7"
MACHINE_TYPE: "n2-standard-4"
DISK_SIZE: 50
DISK_TYPE: "pd-standard"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pull-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
with:
evaluation: false
operator-image-name: "istio-manager:PR-${{github.event.number}}"
servers-memory: "16g"
servers-memory: "16"
agents: 2

istio-integration-test-evaluation:
Expand All @@ -57,5 +57,5 @@ jobs:
with:
evaluation: true
operator-image-name: "istio-manager:PR-${{github.event.number}}"
servers-memory: "4g"
servers-memory: "4"
agents: 0
4 changes: 0 additions & 4 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@ jobs:
files_ignore: |
docs/**
**/*.md
**/*.yaml
tests/performance/**
OWNERS
CODEOWNERS
.github/**
.reuse/**
- name: List all changed files
run: echo '${{ steps.changed-files.outputs.all_changed_files }}' >> $GITHUB_STEP_SUMMARY
Expand Down Expand Up @@ -58,7 +56,6 @@ jobs:
OWNERS
CODEOWNERS
sec-scanners-config.yaml
.github/**
.reuse/**
- name: List all changed files
run: echo '${{ steps.changed-files.outputs.all_changed_files }}' >> $GITHUB_STEP_SUMMARY
Expand Down Expand Up @@ -87,7 +84,6 @@ jobs:
OWNERS
CODEOWNERS
sec-scanners-config.yaml
.github/**
.reuse/**
- name: List all changed files
run: echo '${{ steps.changed-files.outputs.all_changed_files }}' >> $GITHUB_STEP_SUMMARY
Expand Down
8 changes: 4 additions & 4 deletions pkg/lib/sidecars/test/restart_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func generateReport() {
}
err := htmlReport.Generate()
if err != nil {
log.Fatalf(err.Error())
log.Fatal(err.Error())
}

err = filepath.Walk("reports", func(path string, info fs.FileInfo, err error) error {
Expand Down Expand Up @@ -108,7 +108,7 @@ func generateReport() {
})

if err != nil {
log.Fatalf(err.Error())
log.Fatal(err.Error())
}

if artifactsDir, ok := os.LookupEnv("ARTIFACTS"); ok {
Expand All @@ -125,12 +125,12 @@ func generateReport() {
})

if err != nil {
log.Fatalf(err.Error())
log.Fatal(err.Error())
}

_, err = copyReport("./junit-report.xml", fmt.Sprintf("%s/junit-report.xml", artifactsDir))
if err != nil {
log.Fatalf(err.Error())
log.Fatal(err.Error())
}
}

Expand Down

0 comments on commit ef3c969

Please sign in to comment.