diff --git a/tests/e2e/elasticsearch/es-streaming-autoprovisioned/00-install.yaml b/tests/e2e/elasticsearch/es-streaming-autoprovisioned/00-install.yaml deleted file mode 100644 index 4830d4975..000000000 --- a/tests/e2e/elasticsearch/es-streaming-autoprovisioned/00-install.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: jaegertracing.io/v1 -kind: Jaeger -metadata: - name: auto-provisioned -spec: - strategy: streaming - storage: - type: elasticsearch - elasticsearch: - nodeCount: 1 - resources: - requests: - cpu: 200m - memory: 2Gi - limits: - memory: 2Gi diff --git a/tests/e2e/elasticsearch/es-streaming-autoprovisioned/03-assert.yaml b/tests/e2e/elasticsearch/es-streaming-autoprovisioned/03-assert.yaml deleted file mode 100644 index 5bbe76331..000000000 --- a/tests/e2e/elasticsearch/es-streaming-autoprovisioned/03-assert.yaml +++ /dev/null @@ -1,29 +0,0 @@ -# Assert the Jaeger collector is up and running -apiVersion: apps/v1 -kind: Deployment -metadata: - name: auto-provisioned-ingester -spec: - replicas: 1 -status: - readyReplicas: 1 ---- -# Assert the Jaeger query is up and running -apiVersion: apps/v1 -kind: Deployment -metadata: - name: auto-provisioned-query -spec: - replicas: 1 -status: - readyReplicas: 1 ---- -# Assert the Jaeger collector is up and running -apiVersion: apps/v1 -kind: Deployment -metadata: - name: auto-provisioned-collector -spec: - replicas: 1 -status: - readyReplicas: 1 diff --git a/tests/e2e/elasticsearch/es-streaming-autoprovisioned/README.md b/tests/e2e/elasticsearch/es-streaming-autoprovisioned/README.md deleted file mode 100644 index 550bd6fef..000000000 --- a/tests/e2e/elasticsearch/es-streaming-autoprovisioned/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Elasticsearch - ES autoprovisioned + Kafka autoprovisioned -## What is this test case testing? - -Test a Jaeger instance with an Elasticsearch instance autoprovisioned using -`streaming` as deployment strategy. The Kafka cluster is autoprovisioned too. diff --git a/tests/e2e/elasticsearch/render.sh b/tests/e2e/elasticsearch/render.sh index 69ec206eb..216eea491 100755 --- a/tests/e2e/elasticsearch/render.sh +++ b/tests/e2e/elasticsearch/render.sh @@ -277,17 +277,3 @@ else -f $TEMPLATES_DIR/wait-for-cronjob-execution.yaml.template \ -o ./02-wait-spark-job.yaml fi - - -############################################################################### -# TEST NAME: es-streaming-autoprovisioned -############################################################################### -if [[ $IS_OPENSHIFT = true && $SKIP_KAFKA = false ]]; then - start_test "es-streaming-autoprovisioned" - jaeger_name="auto-provisioned" - - render_assert_kafka "true" "$jaeger_name" "00" - render_smoke_test "$jaeger_name" "true" "04" -else - skip_test "es-streaming-autoprovisioned" "This test is only supported in OpenShift with SKIP_KAFKA is false" -fi diff --git a/tests/e2e/examples/examples-openshift-agent-as-daemonset/01-add-policy.yaml b/tests/e2e/examples/examples-agent-as-daemonset/01-add-policy.yaml similarity index 100% rename from tests/e2e/examples/examples-openshift-agent-as-daemonset/01-add-policy.yaml rename to tests/e2e/examples/examples-agent-as-daemonset/01-add-policy.yaml diff --git a/tests/e2e/examples/examples-agent-as-daemonset/01-assert.yaml b/tests/e2e/examples/examples-agent-as-daemonset/03-assert.yaml similarity index 90% rename from tests/e2e/examples/examples-agent-as-daemonset/01-assert.yaml rename to tests/e2e/examples/examples-agent-as-daemonset/03-assert.yaml index c3dbc1502..9163f5c11 100644 --- a/tests/e2e/examples/examples-agent-as-daemonset/01-assert.yaml +++ b/tests/e2e/examples/examples-agent-as-daemonset/03-assert.yaml @@ -1,6 +1,6 @@ apiVersion: apps/v1 kind: DaemonSet -metadata: +metadata: name: agent-as-daemonset-agent-daemonset status: numberReady: 1 diff --git a/tests/e2e/examples/examples-agent-with-priority-class/01-add-policy.yaml b/tests/e2e/examples/examples-agent-with-priority-class/01-add-policy.yaml new file mode 100644 index 000000000..91c37da00 --- /dev/null +++ b/tests/e2e/examples/examples-agent-with-priority-class/01-add-policy.yaml @@ -0,0 +1,10 @@ +# Add service account to user +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +commands: + - script: "oc adm policy --namespace $NAMESPACE add-scc-to-user daemonset-with-hostport -z jaeger-agent-daemonset" + # Sometimes, the previous command needs some time to take effect. If we create + # the Jaeger deployment before the command takes effect, the Jaeger instance + # is not deployed. There is not a way to verify it is there except wait some + # seconds + - script: "sleep 5" diff --git a/tests/e2e/examples/examples-openshift-agent-as-daemonset/README.md b/tests/e2e/examples/examples-openshift-agent-as-daemonset/README.md deleted file mode 100644 index 173523fee..000000000 --- a/tests/e2e/examples/examples-openshift-agent-as-daemonset/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# Examples - OpenShift Agent as Daemonset -## What is this test case testing? - -The OpenShift example `examples/openshift/agent-as-daemonset.yaml`. - - -[More information is available in the Jaeger Documentation](https://www.jaegertracing.io/docs/latest/operator/#installing-the-agent-as-daemonset). diff --git a/tests/e2e/examples/render.sh b/tests/e2e/examples/render.sh index 81de8b389..af52d53c9 100755 --- a/tests/e2e/examples/render.sh +++ b/tests/e2e/examples/render.sh @@ -2,24 +2,16 @@ source $(dirname "$0")/../render-utils.sh -############################################################################### -# TEST NAME: examples-agent-as-daemonset -############################################################################### -start_test "examples-agent-as-daemonset" -example_name="agent-as-daemonset" - -prepare_daemonset "00" -render_install_example "$example_name" "01" -render_smoke_test_example "$example_name" "02" - - ############################################################################### # TEST NAME: examples-agent-with-priority-class ############################################################################### start_test "examples-agent-with-priority-class" example_name="agent-with-priority-class" prepare_daemonset "00" -render_install_example "$example_name" "01" +if [ $IS_OPENSHIFT != true ]; then + rm ./01-add-policy.yaml # This is just for OpenShift +fi +render_install_example "$example_name" "02" render_smoke_test_example "$example_name" "02" @@ -39,30 +31,6 @@ else fi -############################################################################### -# TEST NAME: examples-auto-provision-kafka -############################################################################### -if [ $SKIP_KAFKA = true ]; then - skip_test "examples-auto-provision-kafka" "SKIP_KAFKA is true" -else - start_test "examples-auto-provision-kafka" - example_name="auto-provision-kafka" - render_install_kafka_operator "01" - render_install_example "$example_name" "02" - if [[ $IS_OPENSHIFT = true && $SKIP_ES_EXTERNAL = true ]]; then - $YQ e -i '.spec.storage.options={}' ./02-install.yaml - $YQ e -i '.spec.storage.elasticsearch={"nodeCount":1,"resources":{"limits":{"memory":"2Gi"}}}' ./02-install.yaml - else - render_install_elasticsearch "upstream" "00" - fi - # The Kafka cluster will be started before the Jaeger components. So, we do the - # Jaeger assertion later and the Kafka cluster assertion now - mv ./02-assert.yaml ./05-assert.yaml - render_assert_kafka "true" "$example_name" "02" - render_smoke_test_example "$example_name" "06" -fi - - ############################################################################### # TEST NAME: examples-business-application-injected-sidecar ############################################################################### @@ -176,23 +144,22 @@ render_install_cassandra "00" render_install_example "$example_name" "01" render_smoke_test_example "$example_name" "02" - ############################################################################### -# OpenShift examples ########################################################## +# TEST NAME: examples-agent-as-daemonset ############################################################################### +start_test "examples-agent-as-daemonset" if [ $IS_OPENSHIFT = true ]; then - start_test "examples-openshift-agent-as-daemonset" prepare_daemonset "00" $GOMPLATE -f $EXAMPLES_DIR/openshift/agent-as-daemonset.yaml -o 02-install.yaml - JAEGER_NAME="agent-as-daemonset" $GOMPLATE -f $TEMPLATES_DIR/allinone-jaeger-assert.yaml.template -o ./02-assert.yaml - render_install_vertx "03" - $YQ e -i '.spec.template.spec.containers[0].env=[{"name": "JAEGER_AGENT_HOST", "valueFrom": {"fieldRef": {"apiVersion": "v1", "fieldPath": "status.hostIP"}}}]' ./03-install.yaml - render_find_service "agent-as-daemonset" "production" "order" "00" "04" else - skip_test "examples-openshift-agent-as-daemonset" "This test is only supported in OpenShift" + rm ./01-add-policy.yaml # This is just for OpenShift + render_install_example "agent-as-daemonset" "02" fi +############################################################################### +# OpenShift examples ########################################################## +############################################################################### if [ $IS_OPENSHIFT = true ]; then start_test "examples-openshift-with-htpasswd" export JAEGER_NAME="with-htpasswd" diff --git a/tests/e2e/miscellaneous/collector-autoscale/04-assert.yaml b/tests/e2e/miscellaneous/collector-autoscale/02-assert.yaml similarity index 87% rename from tests/e2e/miscellaneous/collector-autoscale/04-assert.yaml rename to tests/e2e/miscellaneous/collector-autoscale/02-assert.yaml index e4c032071..2a5c0341b 100644 --- a/tests/e2e/miscellaneous/collector-autoscale/04-assert.yaml +++ b/tests/e2e/miscellaneous/collector-autoscale/02-assert.yaml @@ -1,4 +1,4 @@ -apiVersion: autoscaling/v1 +apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: labels: @@ -16,4 +16,3 @@ spec: apiVersion: apps/v1 kind: Deployment name: simple-prod-collector - targetCPUUtilizationPercentage: 90 diff --git a/tests/e2e/miscellaneous/collector-autoscale/02-wait-for-hpa.yaml b/tests/e2e/miscellaneous/collector-autoscale/02-wait-for-hpa.yaml deleted file mode 100644 index 28e51d5cd..000000000 --- a/tests/e2e/miscellaneous/collector-autoscale/02-wait-for-hpa.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: kuttl.dev/v1beta1 -kind: TestStep -commands: - - script: "./wait-for-hpa.sh" \ No newline at end of file diff --git a/tests/e2e/miscellaneous/collector-autoscale/03-assert.yaml b/tests/e2e/miscellaneous/collector-autoscale/03-assert.yaml index ab49fabea..9af22692c 100644 --- a/tests/e2e/miscellaneous/collector-autoscale/03-assert.yaml +++ b/tests/e2e/miscellaneous/collector-autoscale/03-assert.yaml @@ -1,4 +1,4 @@ -apiVersion: autoscaling/v2 +apiVersion: autoscaling/v1 kind: HorizontalPodAutoscaler metadata: labels: @@ -11,21 +11,9 @@ metadata: name: simple-prod-collector spec: maxReplicas: 2 - metrics: - - resource: - name: cpu - target: - averageUtilization: 90 - type: Utilization - type: Resource - - resource: - name: memory - target: - averageUtilization: 90 - type: Utilization - type: Resource minReplicas: 1 scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: simple-prod-collector + targetCPUUtilizationPercentage: 90 \ No newline at end of file diff --git a/tests/e2e/miscellaneous/collector-autoscale/wait-for-hpa.sh b/tests/e2e/miscellaneous/collector-autoscale/wait-for-hpa.sh deleted file mode 100755 index 047df785b..000000000 --- a/tests/e2e/miscellaneous/collector-autoscale/wait-for-hpa.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -exit_code=0 - -while [ "$exit_code" == 0 ] -do - kubectl get hpa -n $NAMESPACE | grep "/90% /90%" -q - exit_code=$? - echo "Some HPA metrics are not known yet" - sleep 1 -done \ No newline at end of file diff --git a/tests/e2e/miscellaneous/render.sh b/tests/e2e/miscellaneous/render.sh index 10ea7da0a..04405b241 100755 --- a/tests/e2e/miscellaneous/render.sh +++ b/tests/e2e/miscellaneous/render.sh @@ -50,12 +50,12 @@ $YQ e -i '.spec.collector.autoscale=true' 01-install.yaml $YQ e -i '.spec.collector.minReplicas=1' 01-install.yaml $YQ e -i '.spec.collector.maxReplicas=2' 01-install.yaml -if kubectl api-versions | grep "autoscaling/v2beta2" -q; then +if version_lt $KUBE_VERSION "1.23"; then # Use the autoscaling/v2beta2 file - rm ./03-assert.yaml + rm ./02-assert.yaml else # Use the autoscaling/v2 file - rm ./04-assert.yaml + rm ./03-assert.yaml fi ############################################################################### diff --git a/tests/e2e/render-utils.sh b/tests/e2e/render-utils.sh index 3c82c8817..cd82ad777 100644 --- a/tests/e2e/render-utils.sh +++ b/tests/e2e/render-utils.sh @@ -527,7 +527,7 @@ function render_assert_kafka(){ REPLICAS=$replicas \ $GOMPLATE \ -f $TEMPLATES_DIR/assert-kafka-cluster.yaml.template \ - -o ./$(expr $test_step + 1 )-assert.yaml + -o ./0$(expr $test_step + 1 )-assert.yaml CLUSTER_NAME=$cluster_name \ $GOMPLATE \ -f $TEMPLATES_DIR/assert-entity-operator.yaml.template \ diff --git a/tests/e2e/streaming/render.sh b/tests/e2e/streaming/render.sh index f779549e9..6806575ea 100755 --- a/tests/e2e/streaming/render.sh +++ b/tests/e2e/streaming/render.sh @@ -62,7 +62,9 @@ else # Assert the autoprovisioned Kafka deployment render_assert_kafka "true" "$jaeger_name" "03" - # Create the tracegen deployment - # Deploy Tracegen instance to generate load in the Jaeger collector - render_install_tracegen "$jaeger_name" "06" + if version_lt $KUBE_VERSION "1.23"; then + rm ./07-assert.yaml + else + rm ./08-assert.yaml + fi fi diff --git a/tests/e2e/streaming/streaming-with-autoprovisioning-autoscale/05-assert.yaml b/tests/e2e/streaming/streaming-with-autoprovisioning-autoscale/06-assert.yaml similarity index 100% rename from tests/e2e/streaming/streaming-with-autoprovisioning-autoscale/05-assert.yaml rename to tests/e2e/streaming/streaming-with-autoprovisioning-autoscale/06-assert.yaml diff --git a/tests/e2e/streaming/streaming-with-autoprovisioning-autoscale/07-assert.yaml b/tests/e2e/streaming/streaming-with-autoprovisioning-autoscale/07-assert.yaml index a2b4c4464..1f222e503 100644 --- a/tests/e2e/streaming/streaming-with-autoprovisioning-autoscale/07-assert.yaml +++ b/tests/e2e/streaming/streaming-with-autoprovisioning-autoscale/07-assert.yaml @@ -1,7 +1,23 @@ -# Assert the ingester scaled -apiVersion: apps/v1 -kind: Deployment +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: auto-provisioned-collector +spec: + maxReplicas: 100 + minReplicas: 1 + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: auto-provisioned-collector +--- +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler metadata: name: auto-provisioned-ingester -status: - readyReplicas: 2 +spec: + maxReplicas: 2 + minReplicas: 1 + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: auto-provisioned-ingester diff --git a/tests/e2e/streaming/streaming-with-autoprovisioning-autoscale/08-assert.yaml b/tests/e2e/streaming/streaming-with-autoprovisioning-autoscale/08-assert.yaml new file mode 100644 index 000000000..5b5d729a0 --- /dev/null +++ b/tests/e2e/streaming/streaming-with-autoprovisioning-autoscale/08-assert.yaml @@ -0,0 +1,12 @@ +apiVersion: autoscaling/v1 +kind: HorizontalPodAutoscaler +metadata: + name: auto-provisioned-ingester +spec: + maxReplicas: 2 + minReplicas: 1 + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: auto-provisioned-ingester + targetCPUUtilizationPercentage: 90