diff --git a/.github/workflows/helm-chart-test.yml b/.github/workflows/helm-chart-test.yml index 7ed9fd6a6..228aca921 100644 --- a/.github/workflows/helm-chart-test.yml +++ b/.github/workflows/helm-chart-test.yml @@ -42,32 +42,38 @@ jobs: cluster: 'kind' helm-version: 'v3.10.3' test-existing-keda: true + test-upgrade: true - k8s-version: 'v1.26.15' test-strategy: deployment cluster: 'minikube' helm-version: 'v3.11.3' test-existing-keda: true + test-upgrade: true - k8s-version: 'v1.27.12' test-strategy: job_https cluster: 'minikube' helm-version: 'v3.12.3' test-existing-keda: true + test-upgrade: true - k8s-version: 'v1.28.8' test-strategy: job_hostname cluster: 'minikube' helm-version: 'v3.13.3' test-existing-keda: false + test-upgrade: true - k8s-version: 'v1.29.3' test-strategy: deployment_https cluster: 'minikube' helm-version: 'v3.14.3' test-existing-keda: false + test-upgrade: true env: CLUSTER: ${{ matrix.cluster }} KUBERNETES_VERSION: ${{ matrix.k8s-version }} ARTIFACT_NAME: ${{ matrix.k8s-version }}-${{ matrix.test-strategy }} HELM_VERSION: ${{ matrix.helm-version }} TEST_EXISTING_KEDA: ${{ matrix.test-existing-keda }} + TEST_UPGRADE_CHART: ${{ matrix.test-upgrade }} steps: - uses: actions/checkout@main - name: Output Docker info @@ -138,6 +144,10 @@ jobs: max_attempts: 3 command: | NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} TEST_EXISTING_KEDA=${TEST_EXISTING_KEDA} make chart_test_autoscaling_${{ matrix.test-strategy }} + - name: Test chart upgrade + if: (matrix.test-upgrade == true) + run: | + NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} TEST_EXISTING_KEDA=${TEST_EXISTING_KEDA} SET_MAX_REPLICAS=10 TEST_UPGRADE_CHART=${TEST_UPGRADE_CHART} make chart_test_autoscaling_${{ matrix.test-strategy }} - name: Cleanup Kubernetes cluster if: always() run: CLUSTER=${CLUSTER} make chart_cluster_cleanup diff --git a/charts/selenium-grid/templates/chrome-node-hpa.yaml b/charts/selenium-grid/templates/chrome-node-hpa.yaml index 36d6c3f43..8690e0a8b 100644 --- a/charts/selenium-grid/templates/chrome-node-hpa.yaml +++ b/charts/selenium-grid/templates/chrome-node-hpa.yaml @@ -5,7 +5,6 @@ metadata: name: {{ template "seleniumGrid.chromeNode.fullname" . }} namespace: {{ .Release.Namespace }} annotations: - helm.sh/resource-policy: delete {{- with .Values.autoscaling.annotations }} {{- toYaml . | nindent 4 }} {{- end }} diff --git a/charts/selenium-grid/templates/edge-node-hpa.yaml b/charts/selenium-grid/templates/edge-node-hpa.yaml index 604b89156..c937bc9fb 100644 --- a/charts/selenium-grid/templates/edge-node-hpa.yaml +++ b/charts/selenium-grid/templates/edge-node-hpa.yaml @@ -5,7 +5,6 @@ metadata: name: {{ template "seleniumGrid.edgeNode.fullname" . }} namespace: {{ .Release.Namespace }} annotations: - helm.sh/resource-policy: delete {{- with .Values.autoscaling.annotations }} {{- toYaml . | nindent 4 }} {{- end }} diff --git a/charts/selenium-grid/templates/firefox-node-hpa.yaml b/charts/selenium-grid/templates/firefox-node-hpa.yaml index 490e16949..4ed715e67 100644 --- a/charts/selenium-grid/templates/firefox-node-hpa.yaml +++ b/charts/selenium-grid/templates/firefox-node-hpa.yaml @@ -5,7 +5,6 @@ metadata: name: {{ template "seleniumGrid.firefoxNode.fullname" . }} namespace: {{ .Release.Namespace }} annotations: - helm.sh/resource-policy: delete {{- with .Values.autoscaling.annotations }} {{- toYaml . | nindent 4 }} {{- end }} diff --git a/charts/selenium-grid/values.yaml b/charts/selenium-grid/values.yaml index be089c895..ef704edc2 100644 --- a/charts/selenium-grid/values.yaml +++ b/charts/selenium-grid/values.yaml @@ -546,7 +546,7 @@ autoscaling: scalingType: job # Annotations for KEDA resources: ScaledObject and ScaledJob annotations: - "helm.sh/hook": post-install,post-upgrade,post-rollback + "helm.sh/hook": post-install # Options for KEDA scaled resources (keep only common options used for both ScaledJob and ScaledObject) scaledOptions: minReplicaCount: 0 @@ -1221,19 +1221,19 @@ prometheus-stack: defaultRules: create: true annotations: - "helm.sh/hook": post-install,post-upgrade,post-rollback + "helm.sh/hook": post-install alertmanager: enabled: true annotations: - "helm.sh/hook": post-install,post-upgrade,post-rollback + "helm.sh/hook": post-install grafana: enabled: true adminPassword: admin forceDeployDatasources: true forceDeployDashboards: true annotations: - "helm.sh/hook": post-install,post-upgrade,post-rollback + "helm.sh/hook": post-install prometheus: enabled: true annotations: - "helm.sh/hook": post-install,post-upgrade,post-rollback + "helm.sh/hook": post-install diff --git a/tests/charts/make/chart_test.sh b/tests/charts/make/chart_test.sh index 1a6db4cf2..152f41cc1 100755 --- a/tests/charts/make/chart_test.sh +++ b/tests/charts/make/chart_test.sh @@ -35,6 +35,7 @@ BASIC_AUTH_USERNAME=${BASIC_AUTH_USERNAME:-"sysAdminUser"} BASIC_AUTH_PASSWORD=${BASIC_AUTH_PASSWORD:-"myStrongPassword"} LOG_LEVEL=${LOG_LEVEL:-"INFO"} TEST_EXISTING_KEDA=${TEST_EXISTING_KEDA:-"true"} +TEST_UPGRADE_CHART=${TEST_UPGRADE_CHART:-"false"} cleanup() { # Get the list of pods @@ -195,6 +196,11 @@ helm upgrade --install ${HELM_COMMAND_ARGS} kubectl get pods -A +if [ "${TEST_UPGRADE_CHART}" = "true" ]; then + echo "Focus on verify chart upgrade, skip Selenium tests" + exit 0 +fi + echo "Run Tests" export CHART_CERT_PATH=$(readlink -f ${CHART_CERT_PATH}) export SELENIUM_GRID_PROTOCOL=${SELENIUM_GRID_PROTOCOL}