Skip to content

Commit 312e4a5

Browse files
committed
chart(test): test scenario on existing KEDA
Signed-off-by: Viet Nguyen Duc <[email protected]>
1 parent 27cd8d8 commit 312e4a5

File tree

5 files changed

+22
-38
lines changed

5 files changed

+22
-38
lines changed

.circleci/config.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ workflows:
1111
test-strategy: disabled
1212
cluster: 'minikube'
1313
helm-version: 'v3.10.3'
14-
test-existing-keda: false
1514
test-upgrade: true
1615
- kubernetes-test:
1716
name: "K8s test - Autoscaling Jobs"
@@ -21,7 +20,6 @@ workflows:
2120
test-strategy: job
2221
cluster: 'minikube'
2322
helm-version: 'v3.11.3'
24-
test-existing-keda: true
2523
test-upgrade: true
2624
- kubernetes-test:
2725
name: "K8s test - Autoscaling Deployments"
@@ -31,7 +29,6 @@ workflows:
3129
test-strategy: deployment
3230
cluster: 'minikube'
3331
helm-version: 'v3.12.3'
34-
test-existing-keda: true
3532
test-upgrade: true
3633
- kubernetes-test:
3734
name: "K8s test - Autoscaling Jobs - HTTPS"
@@ -41,7 +38,6 @@ workflows:
4138
test-strategy: job_https
4239
cluster: 'minikube'
4340
helm-version: 'v3.13.3'
44-
test-existing-keda: true
4541
test-upgrade: true
4642
- kubernetes-test:
4743
name: "K8s test - Autoscaling Jobs - Ingress hostname"
@@ -51,7 +47,6 @@ workflows:
5147
test-strategy: job_hostname
5248
cluster: 'minikube'
5349
helm-version: 'v3.14.4'
54-
test-existing-keda: false
5550
test-upgrade: true
5651
- kubernetes-test:
5752
name: "K8s test - Autoscaling Deployments - HTTPS"
@@ -61,7 +56,6 @@ workflows:
6156
test-strategy: deployment_https
6257
cluster: 'minikube'
6358
helm-version: 'v3.15.3'
64-
test-existing-keda: false
6559
test-upgrade: true
6660
- docker-test:
6761
name: "Docker test - Use random user (true)"
@@ -194,8 +188,6 @@ jobs:
194188
type: string
195189
helm-version:
196190
type: string
197-
test-existing-keda:
198-
type: boolean
199191
test-upgrade:
200192
type: boolean
201193
executor: << parameters.machine-type >>
@@ -207,7 +199,6 @@ jobs:
207199
CLUSTER: << parameters.cluster >>
208200
KUBERNETES_VERSION: << parameters.k8s-version >>
209201
HELM_VERSION: << parameters.helm-version >>
210-
TEST_EXISTING_KEDA: << parameters.test-existing-keda >>
211202
TEST_UPGRADE_CHART: << parameters.test-upgrade >>
212203
steps:
213204
- run:
@@ -228,7 +219,7 @@ jobs:
228219
make chart_setup_env
229220
make set_containerd_image_store
230221
CLUSTER=${CLUSTER} KUBERNETES_VERSION=${KUBERNETES_VERSION} NAME=${NAMESPACE} VERSION=${BRANCH} \
231-
BUILD_DATE=${BUILD_DATE} TEST_EXISTING_KEDA=${TEST_EXISTING_KEDA} make chart_cluster_setup
222+
BUILD_DATE=${BUILD_DATE} make chart_cluster_setup
232223
- run:
233224
name: "Build Docker images"
234225
no_output_timeout: 30m
@@ -260,7 +251,7 @@ jobs:
260251
N=3
261252
while [ $N -gt 0 ]; do
262253
PLATFORMS=${PLATFORMS} NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} \
263-
TEST_EXISTING_KEDA=${TEST_EXISTING_KEDA} TEST_UPGRADE_CHART=false make chart_test_autoscaling_${TEST_STRATEGY} \
254+
TEST_UPGRADE_CHART=false make chart_test_autoscaling_${TEST_STRATEGY} \
264255
&& make test_video_integrity || true
265256
if [ $? -eq 0 ]; then
266257
echo "Tests passed"

.github/workflows/helm-chart-test.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,44 +38,37 @@ jobs:
3838
test-strategy: disabled
3939
cluster: 'minikube'
4040
helm-version: 'v3.10.3'
41-
test-existing-keda: false
4241
test-upgrade: true
4342
- k8s-version: 'v1.26.15'
4443
test-strategy: job
4544
cluster: 'minikube'
4645
helm-version: 'v3.11.3'
47-
test-existing-keda: true
4846
test-upgrade: true
4947
- k8s-version: 'v1.27.16'
5048
test-strategy: deployment
5149
cluster: 'minikube'
5250
helm-version: 'v3.12.3'
53-
test-existing-keda: true
5451
test-upgrade: true
5552
- k8s-version: 'v1.28.12'
5653
test-strategy: job_https
5754
cluster: 'minikube'
5855
helm-version: 'v3.13.3'
59-
test-existing-keda: true
6056
test-upgrade: true
6157
- k8s-version: 'v1.29.7'
6258
test-strategy: job_hostname
6359
cluster: 'minikube'
6460
helm-version: 'v3.14.4'
65-
test-existing-keda: false
6661
test-upgrade: true
6762
- k8s-version: 'v1.30.3'
6863
test-strategy: deployment_https
6964
cluster: 'minikube'
7065
helm-version: 'v3.15.3'
71-
test-existing-keda: false
7266
test-upgrade: true
7367
env:
7468
CLUSTER: ${{ matrix.cluster }}
7569
KUBERNETES_VERSION: ${{ matrix.k8s-version }}
7670
ARTIFACT_NAME: "${{ matrix.k8s-version }}-${{ matrix.test-strategy }}"
7771
HELM_VERSION: ${{ matrix.helm-version }}
78-
TEST_EXISTING_KEDA: ${{ matrix.test-existing-keda }}
7972
TEST_UPGRADE_CHART: ${{ matrix.test-upgrade }}
8073
steps:
8174
- name: Free Disk Space (Ubuntu)
@@ -141,7 +134,7 @@ jobs:
141134
with:
142135
timeout_minutes: 10
143136
max_attempts: 3
144-
command: CLUSTER=${CLUSTER} KUBERNETES_VERSION=${KUBERNETES_VERSION} NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} TEST_EXISTING_KEDA=${TEST_EXISTING_KEDA} make chart_cluster_setup
137+
command: CLUSTER=${CLUSTER} KUBERNETES_VERSION=${KUBERNETES_VERSION} NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make chart_cluster_setup
145138
- name: Test chart template
146139
run: NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make chart_test_template
147140
- name: Test set custom CA certificate
@@ -162,12 +155,12 @@ jobs:
162155
timeout_minutes: 30
163156
max_attempts: 3
164157
command: |
165-
NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} TEST_EXISTING_KEDA=${TEST_EXISTING_KEDA} TEST_UPGRADE_CHART=false make chart_test_autoscaling_${{ matrix.test-strategy }} \
158+
NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} TEST_UPGRADE_CHART=false make chart_test_autoscaling_${{ matrix.test-strategy }} \
166159
&& make test_video_integrity
167160
- name: Test chart upgrade
168161
if: (matrix.test-upgrade == true)
169162
run: |
170-
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 }}
163+
NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} SET_MAX_REPLICAS=10 TEST_UPGRADE_CHART=${TEST_UPGRADE_CHART} make chart_test_autoscaling_${{ matrix.test-strategy }}
171164
- name: Cleanup Kubernetes cluster
172165
if: always()
173166
run: CLUSTER=${CLUSTER} make chart_cluster_cleanup

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -796,18 +796,18 @@ chart_test_autoscaling_deployment_https:
796796
./tests/charts/make/chart_test.sh DeploymentAutoscaling
797797

798798
chart_test_autoscaling_deployment:
799-
PLATFORMS=$(PLATFORMS) RELEASE_NAME=selenium CHART_ENABLE_TRACING=true \
799+
PLATFORMS=$(PLATFORMS) TEST_EXISTING_KEDA=true RELEASE_NAME=selenium CHART_ENABLE_TRACING=true \
800800
SECURE_CONNECTION_SERVER=true SECURE_USE_EXTERNAL_CERT=true SERVICE_TYPE_NODEPORT=true SELENIUM_GRID_PROTOCOL=https SELENIUM_GRID_HOST=$$(hostname -i) SELENIUM_GRID_PORT=31444 \
801801
SELENIUM_GRID_AUTOSCALING_MIN_REPLICA=1 \
802802
VERSION=$(TAG_VERSION) VIDEO_TAG=$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) NAMESPACE=$(NAMESPACE) BINDING_VERSION=$(BINDING_VERSION) \
803-
TEMPLATE_OUTPUT_FILENAME="k8s_prefixSelenium_enableTracing_secureServer_externalCerts_nodePort_autoScaling_scaledObject_subPath.yaml" \
803+
TEMPLATE_OUTPUT_FILENAME="k8s_prefixSelenium_enableTracing_secureServer_externalCerts_nodePort_autoScaling_scaledObject_existingKEDA_subPath.yaml" \
804804
./tests/charts/make/chart_test.sh DeploymentAutoscaling
805805

806806
chart_test_autoscaling_job_https:
807-
PLATFORMS=$(PLATFORMS) RELEASE_NAME=selenium CHART_ENABLE_BASIC_AUTH=true \
807+
PLATFORMS=$(PLATFORMS) TEST_EXISTING_KEDA=true RELEASE_NAME=selenium CHART_ENABLE_BASIC_AUTH=true \
808808
SECURE_CONNECTION_SERVER=true SELENIUM_GRID_PROTOCOL=https SELENIUM_GRID_PORT=443 SUB_PATH=/ \
809809
VERSION=$(TAG_VERSION) VIDEO_TAG=$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) NAMESPACE=$(NAMESPACE) BINDING_VERSION=$(BINDING_VERSION) \
810-
TEMPLATE_OUTPUT_FILENAME="k8s_prefixSelenium_basicAuth_secureServer_autoScaling_scaledJob.yaml" \
810+
TEMPLATE_OUTPUT_FILENAME="k8s_prefixSelenium_basicAuth_secureServer_autoScaling_scaledJob_existingKEDA.yaml" \
811811
./tests/charts/make/chart_test.sh JobAutoscaling
812812

813813
chart_test_autoscaling_job_hostname:
@@ -818,10 +818,10 @@ chart_test_autoscaling_job_hostname:
818818
./tests/charts/make/chart_test.sh JobAutoscaling
819819

820820
chart_test_autoscaling_job:
821-
PLATFORMS=$(PLATFORMS) TEST_CHROMIUM=true RELEASE_NAME=selenium CHART_ENABLE_TRACING=true CHART_FULL_DISTRIBUTED_MODE=true \
821+
PLATFORMS=$(PLATFORMS) TEST_EXISTING_KEDA=true TEST_CHROMIUM=true RELEASE_NAME=selenium CHART_ENABLE_TRACING=true CHART_FULL_DISTRIBUTED_MODE=true \
822822
SECURE_INGRESS_ONLY_CONFIG_INLINE=true SECURE_USE_EXTERNAL_CERT=true CHART_ENABLE_INGRESS_HOSTNAME=true SELENIUM_GRID_PROTOCOL=https SELENIUM_GRID_HOST=selenium-grid.prod SUB_PATH=/ SELENIUM_GRID_PORT=443 \
823823
VERSION=$(TAG_VERSION) VIDEO_TAG=$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) NAMESPACE=$(NAMESPACE) BINDING_VERSION=$(BINDING_VERSION) \
824-
TEMPLATE_OUTPUT_FILENAME="k8s_prefixSelenium_nodeChromium_enableTracing_fullDistributed_secureIngress_externalCerts_ingressHostName_ingressTLSInline_autoScaling_scaledJob_.yaml" \
824+
TEMPLATE_OUTPUT_FILENAME="k8s_fullDistributed_secureIngress_externalCerts_ingressHostName_ingressTLSInline_autoScaling_scaledJob_existingKEDA_prefixSelenium_nodeChromium_enableTracing.yaml" \
825825
./tests/charts/make/chart_test.sh JobAutoscaling
826826

827827
chart_test_language_bindings:

tests/charts/make/chart_cluster_setup.sh

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,10 @@ elif [ "${CLUSTER}" = "minikube" ]; then
5050
sudo chown -R $USER $HOME/.kube $HOME/.minikube
5151
fi
5252

53-
if [ "${TEST_EXISTING_KEDA}" = "true" ]; then
54-
helm repo add kedacore https://kedacore.github.io/charts
55-
echo "Install KEDA core on kind kubernetes cluster"
56-
helm upgrade -i ${KEDA_NAMESPACE} -n ${KEDA_NAMESPACE} --create-namespace --set webhooks.enabled=false kedacore/keda
57-
fi
58-
5953
if [ "${CLUSTER}" = "kind" ]; then
6054
echo "Load built local Docker Images into Kind Cluster"
6155
image_list=$(docker images --format "{{.Repository}}:{{.Tag}}" | grep ${NAMESPACE} | grep ${BUILD_DATE:-$VERSION})
6256
for image in $image_list; do
6357
kind load docker-image --name ${CLUSTER_NAME} "$image"
6458
done
6559
fi
66-
67-
if [ "${TEST_EXISTING_KEDA}" = "true" ]; then
68-
echo "Wait for KEDA core to be ready"
69-
kubectl -n ${KEDA_NAMESPACE} wait --for=condition=ready pod -l app.kubernetes.io/instance=${KEDA_NAMESPACE} --timeout 180s
70-
fi

tests/charts/make/chart_test.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,17 @@ if [ "${RENDER_HELM_TEMPLATE_ONLY}" = "true" ]; then
315315
exit 0
316316
fi
317317

318+
if [ "${TEST_EXISTING_KEDA}" = "true" ] && [ "${TEST_UPGRADE_CHART}" != "true" ]; then
319+
helm repo add kedacore https://kedacore.github.io/charts
320+
echo "Install KEDA core on kind kubernetes cluster"
321+
helm upgrade -i ${KEDA_NAMESPACE} -n ${KEDA_NAMESPACE} --create-namespace --set webhooks.enabled=false kedacore/keda
322+
fi
323+
324+
if [ "${TEST_EXISTING_KEDA}" = "true" ] && [ "${TEST_UPGRADE_CHART}" != "true" ]; then
325+
echo "Wait for KEDA core to be ready"
326+
kubectl -n ${KEDA_NAMESPACE} wait --for=condition=ready pod -l app.kubernetes.io/instance=${KEDA_NAMESPACE} --timeout 180s
327+
fi
328+
318329
echo "Deploy Selenium Grid Chart"
319330
helm upgrade --install ${HELM_COMMAND_ARGS}
320331

0 commit comments

Comments
 (0)