diff --git a/tests/e2e/multi-apps/04-add-destination.yaml b/tests/common/apply/add-tempo-traces-destination.yaml similarity index 88% rename from tests/e2e/multi-apps/04-add-destination.yaml rename to tests/common/apply/add-tempo-traces-destination.yaml index a847f9e44..1c9615039 100644 --- a/tests/e2e/multi-apps/04-add-destination.yaml +++ b/tests/common/apply/add-tempo-traces-destination.yaml @@ -2,7 +2,7 @@ apiVersion: odigos.io/v1alpha1 kind: Destination metadata: name: odigos.io.dest.tempo-123123 - namespace: odigos-system + namespace: odigos-test spec: data: TEMPO_URL: e2e-tests-tempo.traces:4317 diff --git a/tests/e2e/cli-upgrade/05-generate-traffic.yaml b/tests/common/apply/generate-traffic-job.yaml similarity index 100% rename from tests/e2e/cli-upgrade/05-generate-traffic.yaml rename to tests/common/apply/generate-traffic-job.yaml diff --git a/tests/e2e/cli-upgrade/02-install-simple-demo.yaml b/tests/common/apply/install-simple-demo.yaml similarity index 100% rename from tests/e2e/cli-upgrade/02-install-simple-demo.yaml rename to tests/common/apply/install-simple-demo.yaml diff --git a/tests/e2e/cli-upgrade/03-instrument-ns.yaml b/tests/common/apply/instrument-default-ns.yaml similarity index 100% rename from tests/e2e/cli-upgrade/03-instrument-ns.yaml rename to tests/common/apply/instrument-default-ns.yaml diff --git a/tests/e2e/multi-apps/assert-odigos-installed.yaml b/tests/common/assert/odigos-installed.yaml similarity index 93% rename from tests/e2e/multi-apps/assert-odigos-installed.yaml rename to tests/common/assert/odigos-installed.yaml index 341bebe41..15ccf986c 100644 --- a/tests/e2e/multi-apps/assert-odigos-installed.yaml +++ b/tests/common/assert/odigos-installed.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: Namespace metadata: - name: odigos-system + name: odigos-test labels: odigos.io/system-object: 'true' --- @@ -10,7 +10,7 @@ kind: Pod metadata: labels: app.kubernetes.io/name: odigos-autoscaler - namespace: odigos-system + namespace: odigos-test status: containerStatuses: - name: manager @@ -24,7 +24,7 @@ kind: Pod metadata: labels: app.kubernetes.io/name: odigos-scheduler - namespace: odigos-system + namespace: odigos-test status: containerStatuses: - name: manager @@ -38,7 +38,7 @@ kind: Pod metadata: labels: app.kubernetes.io/name: odigos-instrumentor - namespace: odigos-system + namespace: odigos-test status: containerStatuses: - name: manager @@ -52,7 +52,7 @@ kind: Pod metadata: labels: app.kubernetes.io/name: odiglet - namespace: odigos-system + namespace: odigos-test ownerReferences: - apiVersion: apps/v1 blockOwnerDeletion: true @@ -85,7 +85,7 @@ apiVersion: v1 kind: Service metadata: name: ui - namespace: odigos-system + namespace: odigos-test spec: ports: - name: ui @@ -110,7 +110,7 @@ metadata: odigos.io/config: '1' odigos.io/system-object: 'true' name: odigos-config - namespace: odigos-system + namespace: odigos-test --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition diff --git a/tests/e2e/workload-lifecycle/01-assert-pipeline.yaml b/tests/common/assert/pipeline-ready.yaml similarity index 95% rename from tests/e2e/workload-lifecycle/01-assert-pipeline.yaml rename to tests/common/assert/pipeline-ready.yaml index ec54b094f..b44e37162 100644 --- a/tests/e2e/workload-lifecycle/01-assert-pipeline.yaml +++ b/tests/common/assert/pipeline-ready.yaml @@ -2,7 +2,7 @@ apiVersion: odigos.io/v1alpha1 kind: CollectorsGroup metadata: name: odigos-data-collection - namespace: odigos-system + namespace: odigos-test spec: role: NODE_COLLECTOR status: @@ -12,7 +12,7 @@ apiVersion: odigos.io/v1alpha1 kind: CollectorsGroup metadata: name: odigos-gateway - namespace: odigos-system + namespace: odigos-test spec: role: CLUSTER_GATEWAY status: @@ -24,7 +24,7 @@ metadata: labels: odigos.io/collector-role: "CLUSTER_GATEWAY" name: odigos-gateway - namespace: odigos-system + namespace: odigos-test ownerReferences: - apiVersion: odigos.io/v1alpha1 blockOwnerDeletion: true @@ -79,7 +79,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: odigos-gateway - namespace: odigos-system + namespace: odigos-test ownerReferences: - apiVersion: odigos.io/v1alpha1 blockOwnerDeletion: true @@ -92,7 +92,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: odigos-data-collection - namespace: odigos-system + namespace: odigos-test ownerReferences: - apiVersion: odigos.io/v1alpha1 blockOwnerDeletion: true @@ -107,7 +107,7 @@ metadata: labels: odigos.io/collector-role: "NODE_COLLECTOR" name: odigos-data-collection - namespace: odigos-system + namespace: odigos-test ownerReferences: - apiVersion: odigos.io/v1alpha1 blockOwnerDeletion: true @@ -178,5 +178,4 @@ spec: name: kubeletpodresources status: numberAvailable: 1 - numberReady: 1 ---- + numberReady: 1 \ No newline at end of file diff --git a/tests/e2e/cli-upgrade/assert-apps-installed.yaml b/tests/common/assert/simple-demo-installed.yaml similarity index 100% rename from tests/e2e/cli-upgrade/assert-apps-installed.yaml rename to tests/common/assert/simple-demo-installed.yaml diff --git a/tests/common/assert/simple-demo-instrumented.yaml b/tests/common/assert/simple-demo-instrumented.yaml new file mode 100644 index 000000000..5086b2319 --- /dev/null +++ b/tests/common/assert/simple-demo-instrumented.yaml @@ -0,0 +1,271 @@ +### Simple-demo Pods ### +apiVersion: v1 +kind: Pod +metadata: + namespace: default + labels: + app: frontend +spec: + containers: + - name: frontend + resources: + limits: + instrumentation.odigos.io/java-native-community: "1" + requests: + instrumentation.odigos.io/java-native-community: "1" +status: + containerStatuses: + - name: frontend + ready: true + restartCount: 0 + started: true + phase: Running +--- +apiVersion: v1 +kind: Pod +metadata: + namespace: default + labels: + app: coupon +spec: + containers: + - name: coupon + resources: + limits: + instrumentation.odigos.io/javascript-native-community: "1" + requests: + instrumentation.odigos.io/javascript-native-community: "1" +status: + containerStatuses: + - name: coupon + ready: true + restartCount: 0 + started: true + phase: Running +--- +apiVersion: v1 +kind: Pod +metadata: + namespace: default + labels: + app: inventory +spec: + containers: + - name: inventory + resources: + limits: + instrumentation.odigos.io/python-native-community: "1" + requests: + instrumentation.odigos.io/python-native-community: "1" +status: + containerStatuses: + - name: inventory + ready: true + restartCount: 0 + started: true + phase: Running +--- +apiVersion: v1 +kind: Pod +metadata: + namespace: default + labels: + app: membership +spec: + containers: + - name: membership + resources: + limits: + instrumentation.odigos.io/go-ebpf-community: "1" + requests: + instrumentation.odigos.io/go-ebpf-community: "1" +status: + containerStatuses: + - name: membership + ready: true + restartCount: 0 + started: true + phase: Running +--- +apiVersion: v1 +kind: Pod +metadata: + namespace: default + labels: + app: pricing +spec: + containers: + - name: pricing + resources: + limits: + instrumentation.odigos.io/dotnet-native-community: "1" + requests: + instrumentation.odigos.io/dotnet-native-community: "1" +status: + containerStatuses: + - name: pricing + ready: true + restartCount: 0 + started: true + phase: Running +--- +#### Instrumentation Configs #### +apiVersion: odigos.io/v1alpha1 +kind: InstrumentationConfig +metadata: + name: deployment-coupon + namespace: default + ownerReferences: + - apiVersion: apps/v1 + blockOwnerDeletion: true + controller: true + kind: Deployment + name: coupon +status: + observedWorkloadGeneration: 2 # pod has been restarted after destination was added + runtimeDetailsByContainer: + - containerName: coupon + envVars: + - name: NODE_OPTIONS + value: --require /var/odigos/nodejs/autoinstrumentation.js + language: javascript + runtimeVersion: 18.3.0 +--- +apiVersion: odigos.io/v1alpha1 +kind: InstrumentationConfig +metadata: + name: deployment-frontend + namespace: default + ownerReferences: + - apiVersion: apps/v1 + blockOwnerDeletion: true + controller: true + kind: Deployment + name: frontend +status: + observedWorkloadGeneration: 2 # pod has been restarted after destination was added + runtimeDetailsByContainer: + - containerName: frontend + (sort_by(envVars, &name)): + - name: JAVA_OPTS + value: -javaagent:/var/odigos/java/javaagent.jar + - name: JAVA_TOOL_OPTIONS + value: -javaagent:/var/odigos/java/javaagent.jar + language: java + runtimeVersion: 17.0.11+9 +--- +apiVersion: odigos.io/v1alpha1 +kind: InstrumentationConfig +metadata: + name: deployment-inventory + namespace: default + ownerReferences: + - apiVersion: apps/v1 + blockOwnerDeletion: true + controller: true + kind: Deployment + name: inventory +status: + observedWorkloadGeneration: 2 # pod has been restarted after destination was added + runtimeDetailsByContainer: + - containerName: inventory + envVars: + - name: PYTHONPATH + # The image contains /bar in PYTHONPATH so this is concatenated with odigos value + value: /bar:/var/odigos/python:/var/odigos/python/opentelemetry/instrumentation/auto_instrumentation + language: python + runtimeVersion: 3.11.9 +--- +apiVersion: odigos.io/v1alpha1 +kind: InstrumentationConfig +metadata: + name: deployment-membership + namespace: default + ownerReferences: + - apiVersion: apps/v1 + blockOwnerDeletion: true + controller: true + kind: Deployment + name: membership +status: + observedWorkloadGeneration: 2 # pod has been restarted after destination was added + runtimeDetailsByContainer: + - containerName: membership + language: go + runtimeVersion: 1.21.4 +--- +apiVersion: odigos.io/v1alpha1 +kind: InstrumentationConfig +metadata: + name: deployment-pricing + namespace: default + ownerReferences: + - apiVersion: apps/v1 + blockOwnerDeletion: true + controller: true + kind: Deployment + name: pricing +status: + observedWorkloadGeneration: 2 + runtimeDetailsByContainer: + - containerName: pricing + language: dotnet +--- +### Instrumentation Instances ### +apiVersion: odigos.io/v1alpha1 +kind: InstrumentationInstance +metadata: + namespace: default + labels: + instrumented-app: deployment-coupon +status: + healthy: true + identifyingAttributes: + - key: service.instance.id + (value != null): true + - key: telemetry.sdk.language + value: nodejs + - key: process.runtime.version + (value != null): true + - key: telemetry.distro.version + (value != null): true + - key: process.pid + (value != null): true + - key: k8s.namespace.name + (value != null): true + - key: k8s.container.name + (value != null): true + - key: k8s.pod.name + (value != null): true +--- +apiVersion: odigos.io/v1alpha1 +kind: InstrumentationInstance +metadata: + namespace: default + labels: + instrumented-app: deployment-inventory +status: + healthy: true + identifyingAttributes: + - key: service.instance.id + (value != null): true + - key: process.pid + (value != null): true + - key: telemetry.sdk.language + value: python + - key: k8s.namespace.name + (value != null): true + - key: k8s.container.name + (value != null): true + - key: k8s.pod.name + (value != null): true +--- +apiVersion: odigos.io/v1alpha1 +kind: InstrumentationInstance +metadata: + namespace: default + labels: + instrumented-app: deployment-membership +status: + healthy: true + reason: LoadedSuccessfully \ No newline at end of file diff --git a/tests/e2e/helm-chart/assert-runtime-detected.yaml b/tests/common/assert/simple-demo-runtime-detected.yaml similarity index 100% rename from tests/e2e/helm-chart/assert-runtime-detected.yaml rename to tests/common/assert/simple-demo-runtime-detected.yaml diff --git a/tests/e2e/cli-upgrade/assert-tempo-running.yaml b/tests/common/assert/tempo-running.yaml similarity index 100% rename from tests/e2e/cli-upgrade/assert-tempo-running.yaml rename to tests/common/assert/tempo-running.yaml diff --git a/tests/e2e/cli-upgrade/04-add-destination.yaml b/tests/e2e/cli-upgrade/04-add-destination.yaml deleted file mode 100644 index 92ad6a49f..000000000 --- a/tests/e2e/cli-upgrade/04-add-destination.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: odigos.io/v1alpha1 -kind: Destination -metadata: - name: odigos.io.dest.tempo-123123 - namespace: odigos-test-cli-upgrade -spec: - data: - TEMPO_URL: e2e-tests-tempo.traces:4317 - destinationName: e2e-tests - signals: - - TRACES - type: tempo \ No newline at end of file diff --git a/tests/e2e/cli-upgrade/assert-instrumented-and-pipeline.yaml b/tests/e2e/cli-upgrade/assert-instrumented-and-pipeline.yaml deleted file mode 100644 index 41a81fac8..000000000 --- a/tests/e2e/cli-upgrade/assert-instrumented-and-pipeline.yaml +++ /dev/null @@ -1,349 +0,0 @@ -apiVersion: odigos.io/v1alpha1 -kind: CollectorsGroup -metadata: - name: odigos-data-collection - namespace: odigos-test-cli-upgrade -spec: - role: NODE_COLLECTOR -status: - ready: true ---- -apiVersion: odigos.io/v1alpha1 -kind: CollectorsGroup -metadata: - name: odigos-gateway - namespace: odigos-test-cli-upgrade -spec: - role: CLUSTER_GATEWAY -status: - ready: true ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - odigos.io/collector-role: 'CLUSTER_GATEWAY' - name: odigos-gateway - namespace: odigos-test-cli-upgrade - ownerReferences: - - apiVersion: odigos.io/v1alpha1 - blockOwnerDeletion: true - controller: true - kind: CollectorsGroup - name: odigos-gateway -spec: - replicas: 1 - selector: - matchLabels: - odigos.io/collector-role: 'CLUSTER_GATEWAY' - template: - metadata: - labels: - odigos.io/collector-role: 'CLUSTER_GATEWAY' - spec: - containers: - - env: - - name: ODIGOS_VERSION - valueFrom: - configMapKeyRef: - key: ODIGOS_VERSION - name: odigos-deployment - - name: POD_NAME - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: metadata.name - - name: GOMEMLIMIT - (value != null): true - name: gateway - resources: - requests: - (memory != null): true - volumeMounts: - - mountPath: /conf - name: collector-conf - volumes: - - configMap: - defaultMode: 420 - items: - - key: collector-conf - path: collector-conf.yaml - name: odigos-gateway - name: collector-conf -status: - availableReplicas: 1 - readyReplicas: 1 - replicas: 1 ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: odigos-gateway - namespace: odigos-test-cli-upgrade - ownerReferences: - - apiVersion: odigos.io/v1alpha1 - blockOwnerDeletion: true - controller: true - kind: CollectorsGroup - name: odigos-gateway -(data != null): true ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: odigos-data-collection - namespace: odigos-test-cli-upgrade - ownerReferences: - - apiVersion: odigos.io/v1alpha1 - blockOwnerDeletion: true - controller: true - kind: CollectorsGroup - name: odigos-data-collection -(data != null): true ---- -apiVersion: apps/v1 -kind: DaemonSet -metadata: - labels: - odigos.io/collector-role: 'NODE_COLLECTOR' - name: odigos-data-collection - namespace: odigos-test-cli-upgrade - ownerReferences: - - apiVersion: odigos.io/v1alpha1 - blockOwnerDeletion: true - controller: true - kind: CollectorsGroup - name: odigos-data-collection -spec: - selector: - matchLabels: - odigos.io/collector-role: 'NODE_COLLECTOR' - template: - metadata: - labels: - odigos.io/collector-role: 'NODE_COLLECTOR' - spec: - containers: - - name: data-collection - securityContext: - privileged: true - volumeMounts: - - mountPath: /conf - name: conf - - mountPath: /var/lib/docker/containers - name: varlibdockercontainers - readOnly: true - - mountPath: /var/log - name: varlog - readOnly: true - - mountPath: /var/lib/kubelet/pod-resources - name: kubeletpodresources - readOnly: true - env: - - name: NODE_NAME - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: spec.nodeName - - name: POD_NAME - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: metadata.name - hostNetwork: true - nodeSelector: - kubernetes.io/os: linux - securityContext: {} - serviceAccount: odigos-data-collection - serviceAccountName: odigos-data-collection - volumes: - - configMap: - defaultMode: 420 - items: - - key: conf - path: conf.yaml - name: odigos-data-collection - name: conf - - hostPath: - path: /var/log - type: '' - name: varlog - - hostPath: - path: /var/lib/docker/containers - type: '' - name: varlibdockercontainers - - hostPath: - path: /var/lib/kubelet/pod-resources - type: '' - name: kubeletpodresources -status: - numberAvailable: 1 - numberReady: 1 ---- -apiVersion: v1 -kind: Pod -metadata: - namespace: default - labels: - app: frontend -spec: - containers: - - name: frontend - resources: - limits: - instrumentation.odigos.io/java-native-community: '1' - requests: - instrumentation.odigos.io/java-native-community: '1' -status: - containerStatuses: - - name: frontend - ready: true - restartCount: 0 - started: true - phase: Running ---- -apiVersion: v1 -kind: Pod -metadata: - namespace: default - labels: - app: coupon -spec: - containers: - - name: coupon - resources: - limits: - instrumentation.odigos.io/javascript-native-community: '1' - requests: - instrumentation.odigos.io/javascript-native-community: '1' -status: - containerStatuses: - - name: coupon - ready: true - restartCount: 0 - started: true - phase: Running ---- -apiVersion: v1 -kind: Pod -metadata: - namespace: default - labels: - app: inventory -spec: - containers: - - name: inventory - resources: - limits: - instrumentation.odigos.io/python-native-community: '1' - requests: - instrumentation.odigos.io/python-native-community: '1' -status: - containerStatuses: - - name: inventory - ready: true - restartCount: 0 - started: true - phase: Running ---- -apiVersion: v1 -kind: Pod -metadata: - namespace: default - labels: - app: membership -spec: - containers: - - name: membership - resources: - limits: - instrumentation.odigos.io/go-ebpf-community: '1' - requests: - instrumentation.odigos.io/go-ebpf-community: '1' -status: - containerStatuses: - - name: membership - ready: true - restartCount: 0 - started: true - phase: Running ---- -apiVersion: v1 -kind: Pod -metadata: - namespace: default - labels: - app: pricing -spec: - containers: - - name: pricing - resources: - limits: - instrumentation.odigos.io/dotnet-native-community: '1' - requests: - instrumentation.odigos.io/dotnet-native-community: '1' -status: - containerStatuses: - - name: pricing - ready: true - restartCount: 0 - started: true - phase: Running ---- -apiVersion: odigos.io/v1alpha1 -kind: InstrumentationInstance -metadata: - namespace: default - labels: - instrumented-app: deployment-coupon -status: - healthy: true - identifyingAttributes: - - key: service.instance.id - (value != null): true - - key: telemetry.sdk.language - value: nodejs - - key: process.runtime.version - (value != null): true - - key: telemetry.distro.version - (value != null): true # This will hold the version before the upgrade - - key: process.pid - (value != null): true - - key: k8s.namespace.name - (value != null): true - - key: k8s.container.name - (value != null): true - - key: k8s.pod.name - (value != null): true ---- -apiVersion: odigos.io/v1alpha1 -kind: InstrumentationInstance -metadata: - namespace: default - labels: - instrumented-app: deployment-inventory -status: - healthy: true - identifyingAttributes: - - key: service.instance.id - (value != null): true - - key: process.pid - (value != null): true - - key: telemetry.sdk.language - value: python - - key: k8s.namespace.name - (value != null): true - - key: k8s.container.name - (value != null): true - - key: k8s.pod.name - (value != null): true ---- -apiVersion: odigos.io/v1alpha1 -kind: InstrumentationInstance -metadata: - namespace: default - labels: - instrumented-app: deployment-membership -status: - healthy: true - reason: LoadedSuccessfully diff --git a/tests/e2e/cli-upgrade/assert-odigos-installed.yaml b/tests/e2e/cli-upgrade/assert-odigos-installed.yaml deleted file mode 100644 index 412a2f4c3..000000000 --- a/tests/e2e/cli-upgrade/assert-odigos-installed.yaml +++ /dev/null @@ -1,114 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: odigos-test-cli-upgrade - labels: - odigos.io/system-object: "true" ---- -apiVersion: v1 -kind: Pod -metadata: - labels: - app.kubernetes.io/name: odigos-autoscaler - namespace: odigos-test-cli-upgrade -status: - containerStatuses: - - name: manager - ready: true - restartCount: 0 - started: true - phase: Running ---- -apiVersion: v1 -kind: Pod -metadata: - labels: - app.kubernetes.io/name: odigos-scheduler - namespace: odigos-test-cli-upgrade -status: - containerStatuses: - - name: manager - ready: true - restartCount: 0 - started: true - phase: Running ---- -apiVersion: v1 -kind: Pod -metadata: - labels: - app.kubernetes.io/name: odigos-instrumentor - namespace: odigos-test-cli-upgrade -status: - containerStatuses: - - name: manager - ready: true - restartCount: 0 - started: true - phase: Running ---- -apiVersion: v1 -kind: Pod -metadata: - labels: - app.kubernetes.io/name: odiglet - namespace: odigos-test-cli-upgrade - ownerReferences: - - apiVersion: apps/v1 - blockOwnerDeletion: true - controller: true - kind: DaemonSet - name: odiglet -spec: - containers: - - name: odiglet - resources: {} - securityContext: - capabilities: - add: - - SYS_PTRACE - privileged: true - hostNetwork: true - hostPID: true - nodeSelector: - kubernetes.io/os: linux - serviceAccount: odiglet - serviceAccountName: odiglet -status: - containerStatuses: - - name: odiglet - ready: true - restartCount: 0 - started: true ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - labels: - odigos.io/config: "1" - odigos.io/system-object: "true" - name: destinations.odigos.io ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - labels: - odigos.io/config: "1" - odigos.io/system-object: "true" - name: instrumentedapplications.odigos.io ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - labels: - odigos.io/config: "1" - odigos.io/system-object: "true" - name: odigosconfigurations.odigos.io ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - labels: - odigos.io/config: "1" - odigos.io/system-object: "true" - name: processors.odigos.io diff --git a/tests/e2e/cli-upgrade/assert-odigos-upgraded.yaml b/tests/e2e/cli-upgrade/assert-odigos-upgraded.yaml index c26a2699e..4749cd2c8 100644 --- a/tests/e2e/cli-upgrade/assert-odigos-upgraded.yaml +++ b/tests/e2e/cli-upgrade/assert-odigos-upgraded.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: Namespace metadata: - name: odigos-test-cli-upgrade + name: odigos-test labels: odigos.io/system-object: "true" --- @@ -10,7 +10,7 @@ kind: Pod metadata: labels: app.kubernetes.io/name: odigos-autoscaler - namespace: odigos-test-cli-upgrade + namespace: odigos-test spec: containers: - name: manager @@ -28,7 +28,7 @@ kind: Pod metadata: labels: app.kubernetes.io/name: odigos-scheduler - namespace: odigos-test-cli-upgrade + namespace: odigos-test spec: containers: - name: manager @@ -46,7 +46,7 @@ kind: Pod metadata: labels: app.kubernetes.io/name: odigos-instrumentor - namespace: odigos-test-cli-upgrade + namespace: odigos-test spec: containers: - name: manager @@ -64,7 +64,7 @@ kind: Pod metadata: labels: app.kubernetes.io/name: odiglet - namespace: odigos-test-cli-upgrade + namespace: odigos-test ownerReferences: - apiVersion: apps/v1 blockOwnerDeletion: true @@ -99,7 +99,7 @@ kind: Pod metadata: labels: odigos.io/collector-role: NODE_COLLECTOR - namespace: odigos-test-cli-upgrade + namespace: odigos-test ownerReferences: - apiVersion: apps/v1 blockOwnerDeletion: true @@ -128,7 +128,7 @@ kind: Pod metadata: labels: odigos.io/collector-role: CLUSTER_GATEWAY - namespace: odigos-test-cli-upgrade + namespace: odigos-test spec: containers: - name: gateway @@ -145,7 +145,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: odigos-gateway - namespace: odigos-test-cli-upgrade + namespace: odigos-test labels: odigos.io/collector-role: CLUSTER_GATEWAY status: diff --git a/tests/e2e/cli-upgrade/assert-runtime-detected.yaml b/tests/e2e/cli-upgrade/assert-runtime-detected.yaml deleted file mode 100644 index f0894f78a..000000000 --- a/tests/e2e/cli-upgrade/assert-runtime-detected.yaml +++ /dev/null @@ -1,79 +0,0 @@ -apiVersion: odigos.io/v1alpha1 -kind: InstrumentedApplication -metadata: - name: deployment-coupon - namespace: default - ownerReferences: - - apiVersion: apps/v1 - blockOwnerDeletion: true - controller: true - kind: Deployment - name: coupon -spec: - runtimeDetails: - - containerName: coupon - language: javascript ---- -apiVersion: odigos.io/v1alpha1 -kind: InstrumentedApplication -metadata: - name: deployment-frontend - namespace: default - ownerReferences: - - apiVersion: apps/v1 - blockOwnerDeletion: true - controller: true - kind: Deployment - name: frontend -spec: - runtimeDetails: - - containerName: frontend - language: java ---- -apiVersion: odigos.io/v1alpha1 -kind: InstrumentedApplication -metadata: - name: deployment-inventory - namespace: default - ownerReferences: - - apiVersion: apps/v1 - blockOwnerDeletion: true - controller: true - kind: Deployment - name: inventory -spec: - runtimeDetails: - - containerName: inventory - language: python ---- -apiVersion: odigos.io/v1alpha1 -kind: InstrumentedApplication -metadata: - name: deployment-membership - namespace: default - ownerReferences: - - apiVersion: apps/v1 - blockOwnerDeletion: true - controller: true - kind: Deployment - name: membership -spec: - runtimeDetails: - - containerName: membership - language: go ---- -apiVersion: odigos.io/v1alpha1 -kind: InstrumentedApplication -metadata: - name: deployment-pricing - namespace: default - ownerReferences: - - apiVersion: apps/v1 - blockOwnerDeletion: true - controller: true - kind: Deployment - name: pricing -spec: - runtimeDetails: - - containerName: pricing - language: dotnet diff --git a/tests/e2e/cli-upgrade/chainsaw-test.yaml b/tests/e2e/cli-upgrade/chainsaw-test.yaml index b899a8e43..9ced3e463 100644 --- a/tests/e2e/cli-upgrade/chainsaw-test.yaml +++ b/tests/e2e/cli-upgrade/chainsaw-test.yaml @@ -22,7 +22,7 @@ spec: --version 1.10.1 fi - assert: - file: assert-tempo-running.yaml + file: ../../common/assert/tempo-running.yaml - name: Wait for destination to be ready try: - script: @@ -67,10 +67,10 @@ spec: # cleanup any existing installation of odigos the might be left over from previous runs while developing ./odigos uninstall --yes # Run the Odigos CLI installation - ./odigos install --namespace odigos-test-cli-upgrade + ./odigos install --namespace odigos-test timeout: 120s # longer timeout since the images are being pulled from dockerhub - assert: - file: assert-odigos-installed.yaml + file: ../../common/assert/odigos-installed.yaml - name: Install Demo App try: - script: @@ -87,21 +87,30 @@ spec: kind load docker-image keyval/odigos-demo-inventory:v0.1 kind load docker-image keyval/odigos-demo-frontend:v0.2 - apply: - file: 02-install-simple-demo.yaml + file: ../../common/apply/install-simple-demo.yaml - assert: - file: assert-apps-installed.yaml - - name: Detect Languages + file: ../../common/assert/simple-demo-installed.yaml + - name: Instrument Namespace try: - apply: - file: 03-instrument-ns.yaml + file: ../../common/apply/instrument-default-ns.yaml + - name: Assert Runtime Detected + try: - assert: - file: assert-runtime-detected.yaml + timeout: 2m + file: ../../common/assert/simple-demo-runtime-detected.yaml - name: Add Destination try: - apply: - file: 04-add-destination.yaml + file: ../../common/apply/add-tempo-traces-destination.yaml + - name: Odigos pipeline ready + try: + - assert: + file: ../../common/assert/pipeline-ready.yaml + - name: Simple-demo instrumented after destination added + try: - assert: - file: assert-instrumented-and-pipeline.yaml + file: ../../common/assert/simple-demo-instrumented.yaml - name: Upgrade to HEAD version with the current compiled cli try: - script: @@ -109,24 +118,28 @@ spec: timeout: 60s - assert: file: assert-odigos-upgraded.yaml - - name: Instrumented and pipeline ready after upgrade + - name: Odigos pipeline ready after upgrade + try: + - assert: + file: ../../common/assert/pipeline-ready.yaml + - name: Simple-demo instrumented after upgrade try: - assert: - file: assert-instrumented-and-pipeline.yaml + file: ../../common/assert/simple-demo-instrumented.yaml - name: Generate Traffic try: - script: timeout: 300s content: | # Apply the job - kubectl apply -f 05-generate-traffic.yaml + kubectl apply -f ../../common/apply/generate-traffic-job.yaml # Wait for the job to complete - job_name=$(kubectl get -f 05-generate-traffic.yaml -o=jsonpath='{.metadata.name}') + job_name=$(kubectl get -f ../../common/apply/generate-traffic-job.yaml -o=jsonpath='{.metadata.name}') kubectl wait --for=condition=complete job/$job_name # Delete the job - kubectl delete -f 05-generate-traffic.yaml + kubectl delete -f ../../common/apply/generate-traffic-job.yaml while true; do # wait for traces to be available @@ -151,7 +164,7 @@ spec: catch: - podLogs: name: odiglet - namespace: odigos-test-cli-upgrade + namespace: odigos-test - name: Verify Trace - Resource Attributes try: - script: @@ -160,7 +173,7 @@ spec: catch: - podLogs: name: odiglet - namespace: odigos-test-cli-upgrade + namespace: odigos-test - name: Verify Trace - Span Attributes try: - script: @@ -170,4 +183,4 @@ spec: catch: - podLogs: name: odiglet - namespace: odigos-test-cli-upgrade + namespace: odigos-test diff --git a/tests/e2e/helm-chart/02-install-simple-demo.yaml b/tests/e2e/helm-chart/02-install-simple-demo.yaml deleted file mode 100644 index d12e8abd4..000000000 --- a/tests/e2e/helm-chart/02-install-simple-demo.yaml +++ /dev/null @@ -1,203 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: coupon - namespace: default - labels: - app: coupon -spec: - selector: - matchLabels: - app: coupon - template: - metadata: - labels: - app: coupon - spec: - containers: - - name: coupon - image: keyval/odigos-demo-coupon:v0.1 - imagePullPolicy: IfNotPresent - env: - - name: MEMBERSHIP_SERVICE_HOST - value: "membership:8080" - ports: - - containerPort: 8080 ---- -kind: Service -apiVersion: v1 -metadata: - name: coupon - namespace: default -spec: - selector: - app: coupon - ports: - - protocol: TCP - port: 8080 - targetPort: 8080 ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: frontend - namespace: default - labels: - app: frontend -spec: - selector: - matchLabels: - app: frontend - template: - metadata: - labels: - app: frontend - spec: - containers: - - name: frontend - image: keyval/odigos-demo-frontend:v0.2 - imagePullPolicy: IfNotPresent - securityContext: - runAsUser: 1000 - env: - - name: INVENTORY_SERVICE_HOST - value: inventory:8080 - - name: PRICING_SERVICE_HOST - value: pricing:8080 - - name: COUPON_SERVICE_HOST - value: coupon:8080 - ports: - - containerPort: 8080 - readinessProbe: - httpGet: - path: /actuator/health/readiness - port: 8080 - initialDelaySeconds: 5 - periodSeconds: 5 - livenessProbe: - httpGet: - path: /actuator/health/liveness - port: 8080 - initialDelaySeconds: 5 - periodSeconds: 5 ---- -kind: Service -apiVersion: v1 -metadata: - name: frontend - namespace: default -spec: - selector: - app: frontend - ports: - - protocol: TCP - port: 8080 - targetPort: 8080 ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: inventory - namespace: default - labels: - app: inventory -spec: - selector: - matchLabels: - app: inventory - template: - metadata: - labels: - app: inventory - spec: - containers: - - name: inventory - image: keyval/odigos-demo-inventory:v0.1 - imagePullPolicy: IfNotPresent - ports: - - containerPort: 8080 ---- -kind: Service -apiVersion: v1 -metadata: - name: inventory - namespace: default -spec: - selector: - app: inventory - ports: - - protocol: TCP - port: 8080 - targetPort: 8080 ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: membership - namespace: default - labels: - app: membership -spec: - selector: - matchLabels: - app: membership - template: - metadata: - labels: - app: membership - spec: - containers: - - name: membership - image: keyval/odigos-demo-membership:v0.1 - imagePullPolicy: IfNotPresent - ports: - - containerPort: 8080 ---- -kind: Service -apiVersion: v1 -metadata: - name: membership - namespace: default -spec: - selector: - app: membership - ports: - - protocol: TCP - port: 8080 - targetPort: 8080 ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: pricing - namespace: default - labels: - app: pricing -spec: - selector: - matchLabels: - app: pricing - template: - metadata: - labels: - app: pricing - spec: - containers: - - name: pricing - image: keyval/odigos-demo-pricing:v0.1 - imagePullPolicy: IfNotPresent - ports: - - containerPort: 8080 ---- -kind: Service -apiVersion: v1 -metadata: - name: pricing - namespace: default -spec: - selector: - app: pricing - ports: - - protocol: TCP - port: 8080 - targetPort: 8080 \ No newline at end of file diff --git a/tests/e2e/helm-chart/03-instrument-ns.yaml b/tests/e2e/helm-chart/03-instrument-ns.yaml deleted file mode 100644 index 6814c325f..000000000 --- a/tests/e2e/helm-chart/03-instrument-ns.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: default - labels: - odigos-instrumentation: enabled \ No newline at end of file diff --git a/tests/e2e/helm-chart/04-add-destination.yaml b/tests/e2e/helm-chart/04-add-destination.yaml deleted file mode 100644 index 7a637f3f6..000000000 --- a/tests/e2e/helm-chart/04-add-destination.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: odigos.io/v1alpha1 -kind: Destination -metadata: - name: odigos.io.dest.tempo-123123 - namespace: odigos-test-ns -spec: - data: - TEMPO_URL: e2e-tests-tempo.traces:4317 - destinationName: e2e-tests - signals: - - TRACES - type: tempo \ No newline at end of file diff --git a/tests/e2e/helm-chart/05-generate-traffic.yaml b/tests/e2e/helm-chart/05-generate-traffic.yaml deleted file mode 100644 index fb94d0f53..000000000 --- a/tests/e2e/helm-chart/05-generate-traffic.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: batch/v1 -kind: Job -metadata: - name: buybot-job - namespace: default -spec: - template: - metadata: - annotations: - workload: job - labels: - app: buybot - spec: - restartPolicy: Never - schedulerName: default-scheduler - securityContext: {} - terminationGracePeriodSeconds: 30 - containers: - - name: curl - image: curlimages/curl:8.4.0 - imagePullPolicy: IfNotPresent - command: [ "curl" ] - args: [ "-s","-X","POST","http://frontend:8080/buy?id=123" ] diff --git a/tests/e2e/helm-chart/assert-apps-installed.yaml b/tests/e2e/helm-chart/assert-apps-installed.yaml deleted file mode 100644 index c78756927..000000000 --- a/tests/e2e/helm-chart/assert-apps-installed.yaml +++ /dev/null @@ -1,69 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - labels: - app: frontend - namespace: default -status: - containerStatuses: - - name: frontend - ready: true - restartCount: 0 - started: true - phase: Running ---- -apiVersion: v1 -kind: Pod -metadata: - labels: - app: coupon - namespace: default -status: - containerStatuses: - - name: coupon - ready: true - restartCount: 0 - started: true - phase: Running ---- -apiVersion: v1 -kind: Pod -metadata: - labels: - app: inventory - namespace: default -status: - containerStatuses: - - name: inventory - ready: true - restartCount: 0 - started: true - phase: Running ---- -apiVersion: v1 -kind: Pod -metadata: - labels: - app: membership - namespace: default -status: - containerStatuses: - - name: membership - ready: true - restartCount: 0 - started: true - phase: Running ---- -apiVersion: v1 -kind: Pod -metadata: - labels: - app: pricing - namespace: default -status: - containerStatuses: - - name: pricing - ready: true - restartCount: 0 - started: true - phase: Running \ No newline at end of file diff --git a/tests/e2e/helm-chart/assert-instrumented-and-pipeline.yaml b/tests/e2e/helm-chart/assert-instrumented-and-pipeline.yaml deleted file mode 100644 index 49d45bca6..000000000 --- a/tests/e2e/helm-chart/assert-instrumented-and-pipeline.yaml +++ /dev/null @@ -1,349 +0,0 @@ -apiVersion: odigos.io/v1alpha1 -kind: CollectorsGroup -metadata: - name: odigos-data-collection - namespace: odigos-test-ns -spec: - role: NODE_COLLECTOR -status: - ready: true ---- -apiVersion: odigos.io/v1alpha1 -kind: CollectorsGroup -metadata: - name: odigos-gateway - namespace: odigos-test-ns -spec: - role: CLUSTER_GATEWAY -status: - ready: true ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - odigos.io/collector-role: "CLUSTER_GATEWAY" - name: odigos-gateway - namespace: odigos-test-ns - ownerReferences: - - apiVersion: odigos.io/v1alpha1 - blockOwnerDeletion: true - controller: true - kind: CollectorsGroup - name: odigos-gateway -spec: - replicas: 1 - selector: - matchLabels: - odigos.io/collector-role: "CLUSTER_GATEWAY" - template: - metadata: - labels: - odigos.io/collector-role: "CLUSTER_GATEWAY" - spec: - containers: - - env: - - name: ODIGOS_VERSION - valueFrom: - configMapKeyRef: - key: ODIGOS_VERSION - name: odigos-deployment - - name: POD_NAME - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: metadata.name - - name: GOMEMLIMIT - (value != null): true - name: gateway - resources: - requests: - (memory != null): true - volumeMounts: - - mountPath: /conf - name: collector-conf - volumes: - - configMap: - defaultMode: 420 - items: - - key: collector-conf - path: collector-conf.yaml - name: odigos-gateway - name: collector-conf -status: - availableReplicas: 1 - readyReplicas: 1 - replicas: 1 ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: odigos-gateway - namespace: odigos-test-ns - ownerReferences: - - apiVersion: odigos.io/v1alpha1 - blockOwnerDeletion: true - controller: true - kind: CollectorsGroup - name: odigos-gateway -(data != null): true ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: odigos-data-collection - namespace: odigos-test-ns - ownerReferences: - - apiVersion: odigos.io/v1alpha1 - blockOwnerDeletion: true - controller: true - kind: CollectorsGroup - name: odigos-data-collection -(data != null): true ---- -apiVersion: apps/v1 -kind: DaemonSet -metadata: - labels: - odigos.io/collector-role: "NODE_COLLECTOR" - name: odigos-data-collection - namespace: odigos-test-ns - ownerReferences: - - apiVersion: odigos.io/v1alpha1 - blockOwnerDeletion: true - controller: true - kind: CollectorsGroup - name: odigos-data-collection -spec: - selector: - matchLabels: - odigos.io/collector-role: "NODE_COLLECTOR" - template: - metadata: - labels: - odigos.io/collector-role: "NODE_COLLECTOR" - spec: - containers: - - name: data-collection - securityContext: - privileged: true - volumeMounts: - - mountPath: /conf - name: conf - - mountPath: /var/lib/docker/containers - name: varlibdockercontainers - readOnly: true - - mountPath: /var/log - name: varlog - readOnly: true - - mountPath: /var/lib/kubelet/pod-resources - name: kubeletpodresources - readOnly: true - env: - - name: NODE_NAME - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: spec.nodeName - - name: POD_NAME - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: metadata.name - hostNetwork: true - nodeSelector: - kubernetes.io/os: linux - securityContext: {} - serviceAccount: odigos-data-collection - serviceAccountName: odigos-data-collection - volumes: - - configMap: - defaultMode: 420 - items: - - key: conf - path: conf.yaml - name: odigos-data-collection - name: conf - - hostPath: - path: /var/log - type: "" - name: varlog - - hostPath: - path: /var/lib/docker/containers - type: "" - name: varlibdockercontainers - - hostPath: - path: /var/lib/kubelet/pod-resources - type: "" - name: kubeletpodresources -status: - numberAvailable: 1 - numberReady: 1 ---- -apiVersion: v1 -kind: Pod -metadata: - namespace: default - labels: - app: frontend -spec: - containers: - - name: frontend - resources: - limits: - instrumentation.odigos.io/java-native-community: "1" - requests: - instrumentation.odigos.io/java-native-community: "1" -status: - containerStatuses: - - name: frontend - ready: true - restartCount: 0 - started: true - phase: Running ---- -apiVersion: v1 -kind: Pod -metadata: - namespace: default - labels: - app: coupon -spec: - containers: - - name: coupon - resources: - limits: - instrumentation.odigos.io/javascript-native-community: "1" - requests: - instrumentation.odigos.io/javascript-native-community: "1" -status: - containerStatuses: - - name: coupon - ready: true - restartCount: 0 - started: true - phase: Running ---- -apiVersion: v1 -kind: Pod -metadata: - namespace: default - labels: - app: inventory -spec: - containers: - - name: inventory - resources: - limits: - instrumentation.odigos.io/python-native-community: "1" - requests: - instrumentation.odigos.io/python-native-community: "1" -status: - containerStatuses: - - name: inventory - ready: true - restartCount: 0 - started: true - phase: Running ---- -apiVersion: v1 -kind: Pod -metadata: - namespace: default - labels: - app: membership -spec: - containers: - - name: membership - resources: - limits: - instrumentation.odigos.io/go-ebpf-community: "1" - requests: - instrumentation.odigos.io/go-ebpf-community: "1" -status: - containerStatuses: - - name: membership - ready: true - restartCount: 0 - started: true - phase: Running ---- -apiVersion: v1 -kind: Pod -metadata: - namespace: default - labels: - app: pricing -spec: - containers: - - name: pricing - resources: - limits: - instrumentation.odigos.io/dotnet-native-community: "1" - requests: - instrumentation.odigos.io/dotnet-native-community: "1" -status: - containerStatuses: - - name: pricing - ready: true - restartCount: 0 - started: true - phase: Running ---- -apiVersion: odigos.io/v1alpha1 -kind: InstrumentationInstance -metadata: - namespace: default - labels: - instrumented-app: deployment-coupon -status: - healthy: true - identifyingAttributes: - - key: service.instance.id - (value != null): true - - key: telemetry.sdk.language - value: nodejs - - key: process.runtime.version - (value != null): true - - key: telemetry.distro.version - (value != null): true - - key: process.pid - (value != null): true - - key: k8s.namespace.name - (value != null): true - - key: k8s.container.name - (value != null): true - - key: k8s.pod.name - (value != null): true ---- -apiVersion: odigos.io/v1alpha1 -kind: InstrumentationInstance -metadata: - namespace: default - labels: - instrumented-app: deployment-inventory -status: - healthy: true - identifyingAttributes: - - key: service.instance.id - (value != null): true - - key: process.pid - (value != null): true - - key: telemetry.sdk.language - value: python - - key: k8s.namespace.name - (value != null): true - - key: k8s.container.name - (value != null): true - - key: k8s.pod.name - (value != null): true ---- -apiVersion: odigos.io/v1alpha1 -kind: InstrumentationInstance -metadata: - namespace: default - labels: - instrumented-app: deployment-membership -status: - healthy: true - reason: LoadedSuccessfully diff --git a/tests/e2e/helm-chart/assert-odigos-installed.yaml b/tests/e2e/helm-chart/assert-odigos-installed.yaml deleted file mode 100644 index 0ad7b5b6d..000000000 --- a/tests/e2e/helm-chart/assert-odigos-installed.yaml +++ /dev/null @@ -1,145 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: odigos-test-ns - labels: - odigos.io/system-object: 'true' ---- -apiVersion: v1 -kind: Pod -metadata: - labels: - app.kubernetes.io/name: odigos-autoscaler - namespace: odigos-test-ns -status: - containerStatuses: - - name: manager - ready: true - restartCount: 0 - started: true - phase: Running ---- -apiVersion: v1 -kind: Pod -metadata: - labels: - app.kubernetes.io/name: odigos-scheduler - namespace: odigos-test-ns -status: - containerStatuses: - - name: manager - ready: true - restartCount: 0 - started: true - phase: Running ---- -apiVersion: v1 -kind: Pod -metadata: - labels: - app.kubernetes.io/name: odigos-instrumentor - namespace: odigos-test-ns -status: - containerStatuses: - - name: manager - ready: true - restartCount: 0 - started: true - phase: Running ---- -apiVersion: v1 -kind: Pod -metadata: - labels: - app.kubernetes.io/name: odiglet - namespace: odigos-test-ns - ownerReferences: - - apiVersion: apps/v1 - blockOwnerDeletion: true - controller: true - kind: DaemonSet - name: odiglet -spec: - containers: - - name: odiglet - resources: {} - securityContext: - capabilities: - add: - - SYS_PTRACE - privileged: true - hostNetwork: true - hostPID: true - nodeSelector: - kubernetes.io/os: linux - serviceAccount: odiglet - serviceAccountName: odiglet -status: - containerStatuses: - - name: odiglet - ready: true - restartCount: 0 - started: true ---- -apiVersion: v1 -kind: Service -metadata: - name: ui - namespace: odigos-test-ns -spec: - ports: - - name: ui - port: 3000 - protocol: TCP - targetPort: 3000 - - name: beta-ui - port: 3001 - protocol: TCP - targetPort: 3001 - - name: otlp - port: 4317 - protocol: TCP - targetPort: 4317 - selector: - app: odigos-ui ---- -apiVersion: v1 -kind: ConfigMap -metadata: - labels: - odigos.io/config: '1' - odigos.io/system-object: 'true' - name: odigos-config - namespace: odigos-test-ns ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - labels: - odigos.io/config: '1' - odigos.io/system-object: 'true' - name: destinations.odigos.io ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - labels: - odigos.io/config: '1' - odigos.io/system-object: 'true' - name: instrumentedapplications.odigos.io ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - labels: - odigos.io/config: '1' - odigos.io/system-object: 'true' - name: odigosconfigurations.odigos.io ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - labels: - odigos.io/config: '1' - odigos.io/system-object: 'true' - name: processors.odigos.io diff --git a/tests/e2e/helm-chart/assert-post-dest-runtime-details.yaml b/tests/e2e/helm-chart/assert-post-dest-runtime-details.yaml deleted file mode 100644 index 6f7dbb1eb..000000000 --- a/tests/e2e/helm-chart/assert-post-dest-runtime-details.yaml +++ /dev/null @@ -1,101 +0,0 @@ ---- -apiVersion: odigos.io/v1alpha1 -kind: InstrumentationConfig -metadata: - name: deployment-coupon - namespace: default - ownerReferences: - - apiVersion: apps/v1 - blockOwnerDeletion: true - controller: true - kind: Deployment - name: coupon -status: - observedWorkloadGeneration: 2 # pod has been restarted after destination was added - runtimeDetailsByContainer: - - containerName: coupon - envVars: - - name: NODE_OPTIONS - value: --require /var/odigos/nodejs/autoinstrumentation.js - language: javascript - runtimeVersion: 18.3.0 ---- -apiVersion: odigos.io/v1alpha1 -kind: InstrumentationConfig -metadata: - name: deployment-frontend - namespace: default - ownerReferences: - - apiVersion: apps/v1 - blockOwnerDeletion: true - controller: true - kind: Deployment - name: frontend -status: - observedWorkloadGeneration: 2 # pod has been restarted after destination was added - runtimeDetailsByContainer: - - containerName: frontend - (sort_by(envVars, &name)): - - name: JAVA_OPTS - value: -javaagent:/var/odigos/java/javaagent.jar - - name: JAVA_TOOL_OPTIONS - value: -javaagent:/var/odigos/java/javaagent.jar - language: java - runtimeVersion: 17.0.11+9 ---- -apiVersion: odigos.io/v1alpha1 -kind: InstrumentationConfig -metadata: - name: deployment-inventory - namespace: default - ownerReferences: - - apiVersion: apps/v1 - blockOwnerDeletion: true - controller: true - kind: Deployment - name: inventory -status: - observedWorkloadGeneration: 2 # pod has been restarted after destination was added - runtimeDetailsByContainer: - - containerName: inventory - envVars: - - name: PYTHONPATH - # The image contains /bar in PYTHONPATH so this is concatenated with odigos value - value: /bar:/var/odigos/python:/var/odigos/python/opentelemetry/instrumentation/auto_instrumentation - language: python - runtimeVersion: 3.11.9 ---- -apiVersion: odigos.io/v1alpha1 -kind: InstrumentationConfig -metadata: - name: deployment-membership - namespace: default - ownerReferences: - - apiVersion: apps/v1 - blockOwnerDeletion: true - controller: true - kind: Deployment - name: membership -status: - observedWorkloadGeneration: 2 # pod has been restarted after destination was added - runtimeDetailsByContainer: - - containerName: membership - language: go - runtimeVersion: 1.21.4 ---- -apiVersion: odigos.io/v1alpha1 -kind: InstrumentationConfig -metadata: - name: deployment-pricing - namespace: default - ownerReferences: - - apiVersion: apps/v1 - blockOwnerDeletion: true - controller: true - kind: Deployment - name: pricing -status: - observedWorkloadGeneration: 2 - runtimeDetailsByContainer: - - containerName: pricing - language: dotnet diff --git a/tests/e2e/helm-chart/assert-tempo-running.yaml b/tests/e2e/helm-chart/assert-tempo-running.yaml deleted file mode 100644 index f4653f4a3..000000000 --- a/tests/e2e/helm-chart/assert-tempo-running.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: e2e-tests-tempo-0 - namespace: traces -status: - phase: Running - containerStatuses: - - name: tempo - ready: true - restartCount: 0 \ No newline at end of file diff --git a/tests/e2e/helm-chart/assert-traffic-job-running.yaml b/tests/e2e/helm-chart/assert-traffic-job-running.yaml deleted file mode 100644 index 0557b2742..000000000 --- a/tests/e2e/helm-chart/assert-traffic-job-running.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: batch/v1 -kind: Job -metadata: - name: buybot-job - namespace: default -status: - conditions: - - status: "True" - type: Complete - succeeded: 1 diff --git a/tests/e2e/helm-chart/chainsaw-test.yaml b/tests/e2e/helm-chart/chainsaw-test.yaml index 959431e49..95eb57c54 100644 --- a/tests/e2e/helm-chart/chainsaw-test.yaml +++ b/tests/e2e/helm-chart/chainsaw-test.yaml @@ -18,7 +18,7 @@ spec: --set tempo.ingester.max_block_duration=20s \ --version 1.10.1 - assert: - file: assert-tempo-running.yaml + file: ../../common/assert/tempo-running.yaml - name: Wait for destination to be ready try: - script: @@ -33,11 +33,11 @@ spec: # "build" complete helm chart by copying CRDs into the template folder cp -r $P/api/config/crd/bases/* $P/helm/odigos/templates/crds/ if [ "$MODE" = "cross-cloud-tests" ]; then - helm upgrade --install odigos $P/helm/odigos --create-namespace --namespace odigos-test-ns --set image.tag="$COMMIT_HASH" --set imagePrefix=public.ecr.aws/y2v0v6s7 + helm upgrade --install odigos $P/helm/odigos --create-namespace --namespace odigos-test --set image.tag="$COMMIT_HASH" --set imagePrefix=public.ecr.aws/y2v0v6s7 else - helm upgrade --install odigos $P/helm/odigos --create-namespace --namespace odigos-test-ns --set image.tag=e2e-test + helm upgrade --install odigos $P/helm/odigos --create-namespace --namespace odigos-test --set image.tag=e2e-test fi - kubectl label namespace odigos-test-ns odigos.io/system-object="true" + kubectl label namespace odigos-test odigos.io/system-object="true" timeout: 60s - name: Verify Odigos Installation try: @@ -54,7 +54,7 @@ spec: exit 1 fi - kubectl wait --for=condition=ready pods --all -n odigos-test-ns --timeout=40s + kubectl wait --for=condition=ready pods --all -n odigos-test --timeout=40s else if [ "$ACTUAL_VERSION" != "e2e-test" ]; then @@ -63,7 +63,7 @@ spec: fi fi - assert: - file: assert-odigos-installed.yaml + file: ../../common/assert/odigos-installed.yaml - name: Install Demo App try: - script: @@ -82,7 +82,7 @@ spec: echo "Skipping docker pull and kind load for cross-cloud-tests mode" fi - apply: - file: 02-install-simple-demo.yaml + file: ../../common/apply/install-simple-demo.yaml - script: timeout: 70s content: | @@ -93,59 +93,42 @@ spec: kubectl wait --for=condition=ready pod -l app=pricing --timeout=60s kubectl wait --for=condition=ready pod -l app=membership --timeout=60s - assert: - file: assert-apps-installed.yaml - + file: ../../common/assert/simple-demo-installed.yaml - name: Instrument Namespace try: - apply: - file: 03-instrument-ns.yaml - + file: ../../common/apply/instrument-default-ns.yaml - name: Assert Runtime Detected try: - assert: timeout: 2m - file: assert-runtime-detected.yaml - + file: ../../common/assert/simple-demo-runtime-detected.yaml - name: Add Destination try: - apply: - file: 04-add-destination.yaml - - - name: Assert Instrumented and Pipeline + file: ../../common/apply/add-tempo-traces-destination.yaml + - name: Odigos pipeline ready try: - assert: - file: assert-instrumented-and-pipeline.yaml - - - name: Verify InstrumentationConfig Generation Status - try: - - script: - timeout: 65s - content: | - kubectl wait --for=jsonpath='{.status.observedWorkloadGeneration}'=2 -n default instrumentationconfig/deployment-frontend --timeout=60s - kubectl wait --for=jsonpath='{.status.observedWorkloadGeneration}'=2 -n default instrumentationconfig/deployment-coupon --timeout=60s - kubectl wait --for=jsonpath='{.status.observedWorkloadGeneration}'=2 -n default instrumentationconfig/deployment-inventory --timeout=60s - kubectl wait --for=jsonpath='{.status.observedWorkloadGeneration}'=2 -n default instrumentationconfig/deployment-pricing --timeout=60s - kubectl wait --for=jsonpath='{.status.observedWorkloadGeneration}'=2 -n default instrumentationconfig/deployment-membership --timeout=60s - - - name: Assert Post Destination Runtime Details + file: ../../common/assert/pipeline-ready.yaml + - name: Simple-demo instrumented after destination added try: - assert: - file: assert-post-dest-runtime-details.yaml - + file: ../../common/assert/simple-demo-instrumented.yaml - name: Generate Traffic try: - script: timeout: 300s content: | # Apply the job - kubectl apply -f 05-generate-traffic.yaml + kubectl apply -f ../../common/apply/generate-traffic-job.yaml # Wait for the job to complete - job_name=$(kubectl get -f 05-generate-traffic.yaml -o=jsonpath='{.metadata.name}') + job_name=$(kubectl get -f ../../common/apply/generate-traffic-job.yaml -o=jsonpath='{.metadata.name}') kubectl wait --for=condition=complete job/$job_name # Delete the job - kubectl delete -f 05-generate-traffic.yaml + kubectl delete -f ../../common/apply/generate-traffic-job.yaml while true; do # wait for traces to be available @@ -171,7 +154,7 @@ spec: catch: - podLogs: name: odiglet - namespace: odigos-test-ns + namespace: odigos-test - name: Verify Trace - Resource Attributes try: - script: @@ -180,7 +163,7 @@ spec: catch: - podLogs: name: odiglet - namespace: odigos-test-ns + namespace: odigos-test - name: Verify Trace - Span Attributes try: - script: @@ -189,4 +172,4 @@ spec: catch: - podLogs: name: odiglet - namespace: odigos-test-ns + namespace: odigos-test diff --git a/tests/e2e/multi-apps/02-install-simple-demo.yaml b/tests/e2e/multi-apps/02-install-simple-demo.yaml deleted file mode 100644 index d12e8abd4..000000000 --- a/tests/e2e/multi-apps/02-install-simple-demo.yaml +++ /dev/null @@ -1,203 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: coupon - namespace: default - labels: - app: coupon -spec: - selector: - matchLabels: - app: coupon - template: - metadata: - labels: - app: coupon - spec: - containers: - - name: coupon - image: keyval/odigos-demo-coupon:v0.1 - imagePullPolicy: IfNotPresent - env: - - name: MEMBERSHIP_SERVICE_HOST - value: "membership:8080" - ports: - - containerPort: 8080 ---- -kind: Service -apiVersion: v1 -metadata: - name: coupon - namespace: default -spec: - selector: - app: coupon - ports: - - protocol: TCP - port: 8080 - targetPort: 8080 ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: frontend - namespace: default - labels: - app: frontend -spec: - selector: - matchLabels: - app: frontend - template: - metadata: - labels: - app: frontend - spec: - containers: - - name: frontend - image: keyval/odigos-demo-frontend:v0.2 - imagePullPolicy: IfNotPresent - securityContext: - runAsUser: 1000 - env: - - name: INVENTORY_SERVICE_HOST - value: inventory:8080 - - name: PRICING_SERVICE_HOST - value: pricing:8080 - - name: COUPON_SERVICE_HOST - value: coupon:8080 - ports: - - containerPort: 8080 - readinessProbe: - httpGet: - path: /actuator/health/readiness - port: 8080 - initialDelaySeconds: 5 - periodSeconds: 5 - livenessProbe: - httpGet: - path: /actuator/health/liveness - port: 8080 - initialDelaySeconds: 5 - periodSeconds: 5 ---- -kind: Service -apiVersion: v1 -metadata: - name: frontend - namespace: default -spec: - selector: - app: frontend - ports: - - protocol: TCP - port: 8080 - targetPort: 8080 ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: inventory - namespace: default - labels: - app: inventory -spec: - selector: - matchLabels: - app: inventory - template: - metadata: - labels: - app: inventory - spec: - containers: - - name: inventory - image: keyval/odigos-demo-inventory:v0.1 - imagePullPolicy: IfNotPresent - ports: - - containerPort: 8080 ---- -kind: Service -apiVersion: v1 -metadata: - name: inventory - namespace: default -spec: - selector: - app: inventory - ports: - - protocol: TCP - port: 8080 - targetPort: 8080 ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: membership - namespace: default - labels: - app: membership -spec: - selector: - matchLabels: - app: membership - template: - metadata: - labels: - app: membership - spec: - containers: - - name: membership - image: keyval/odigos-demo-membership:v0.1 - imagePullPolicy: IfNotPresent - ports: - - containerPort: 8080 ---- -kind: Service -apiVersion: v1 -metadata: - name: membership - namespace: default -spec: - selector: - app: membership - ports: - - protocol: TCP - port: 8080 - targetPort: 8080 ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: pricing - namespace: default - labels: - app: pricing -spec: - selector: - matchLabels: - app: pricing - template: - metadata: - labels: - app: pricing - spec: - containers: - - name: pricing - image: keyval/odigos-demo-pricing:v0.1 - imagePullPolicy: IfNotPresent - ports: - - containerPort: 8080 ---- -kind: Service -apiVersion: v1 -metadata: - name: pricing - namespace: default -spec: - selector: - app: pricing - ports: - - protocol: TCP - port: 8080 - targetPort: 8080 \ No newline at end of file diff --git a/tests/e2e/multi-apps/03-instrument-ns.yaml b/tests/e2e/multi-apps/03-instrument-ns.yaml deleted file mode 100644 index 6814c325f..000000000 --- a/tests/e2e/multi-apps/03-instrument-ns.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: default - labels: - odigos-instrumentation: enabled \ No newline at end of file diff --git a/tests/e2e/multi-apps/05-generate-traffic.yaml b/tests/e2e/multi-apps/05-generate-traffic.yaml deleted file mode 100644 index fb94d0f53..000000000 --- a/tests/e2e/multi-apps/05-generate-traffic.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: batch/v1 -kind: Job -metadata: - name: buybot-job - namespace: default -spec: - template: - metadata: - annotations: - workload: job - labels: - app: buybot - spec: - restartPolicy: Never - schedulerName: default-scheduler - securityContext: {} - terminationGracePeriodSeconds: 30 - containers: - - name: curl - image: curlimages/curl:8.4.0 - imagePullPolicy: IfNotPresent - command: [ "curl" ] - args: [ "-s","-X","POST","http://frontend:8080/buy?id=123" ] diff --git a/tests/e2e/multi-apps/assert-apps-installed.yaml b/tests/e2e/multi-apps/assert-apps-installed.yaml deleted file mode 100644 index c78756927..000000000 --- a/tests/e2e/multi-apps/assert-apps-installed.yaml +++ /dev/null @@ -1,69 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - labels: - app: frontend - namespace: default -status: - containerStatuses: - - name: frontend - ready: true - restartCount: 0 - started: true - phase: Running ---- -apiVersion: v1 -kind: Pod -metadata: - labels: - app: coupon - namespace: default -status: - containerStatuses: - - name: coupon - ready: true - restartCount: 0 - started: true - phase: Running ---- -apiVersion: v1 -kind: Pod -metadata: - labels: - app: inventory - namespace: default -status: - containerStatuses: - - name: inventory - ready: true - restartCount: 0 - started: true - phase: Running ---- -apiVersion: v1 -kind: Pod -metadata: - labels: - app: membership - namespace: default -status: - containerStatuses: - - name: membership - ready: true - restartCount: 0 - started: true - phase: Running ---- -apiVersion: v1 -kind: Pod -metadata: - labels: - app: pricing - namespace: default -status: - containerStatuses: - - name: pricing - ready: true - restartCount: 0 - started: true - phase: Running \ No newline at end of file diff --git a/tests/e2e/multi-apps/assert-instrumented-and-pipeline.yaml b/tests/e2e/multi-apps/assert-instrumented-and-pipeline.yaml deleted file mode 100644 index 61fcce346..000000000 --- a/tests/e2e/multi-apps/assert-instrumented-and-pipeline.yaml +++ /dev/null @@ -1,349 +0,0 @@ -apiVersion: odigos.io/v1alpha1 -kind: CollectorsGroup -metadata: - name: odigos-data-collection - namespace: odigos-system -spec: - role: NODE_COLLECTOR -status: - ready: true ---- -apiVersion: odigos.io/v1alpha1 -kind: CollectorsGroup -metadata: - name: odigos-gateway - namespace: odigos-system -spec: - role: CLUSTER_GATEWAY -status: - ready: true ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - odigos.io/collector-role: "CLUSTER_GATEWAY" - name: odigos-gateway - namespace: odigos-system - ownerReferences: - - apiVersion: odigos.io/v1alpha1 - blockOwnerDeletion: true - controller: true - kind: CollectorsGroup - name: odigos-gateway -spec: - replicas: 1 - selector: - matchLabels: - odigos.io/collector-role: "CLUSTER_GATEWAY" - template: - metadata: - labels: - odigos.io/collector-role: "CLUSTER_GATEWAY" - spec: - containers: - - env: - - name: ODIGOS_VERSION - valueFrom: - configMapKeyRef: - key: ODIGOS_VERSION - name: odigos-deployment - - name: POD_NAME - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: metadata.name - - name: GOMEMLIMIT - (value != null): true - name: gateway - resources: - requests: - (memory != null): true - volumeMounts: - - mountPath: /conf - name: collector-conf - volumes: - - configMap: - defaultMode: 420 - items: - - key: collector-conf - path: collector-conf.yaml - name: odigos-gateway - name: collector-conf -status: - availableReplicas: 1 - readyReplicas: 1 - replicas: 1 ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: odigos-gateway - namespace: odigos-system - ownerReferences: - - apiVersion: odigos.io/v1alpha1 - blockOwnerDeletion: true - controller: true - kind: CollectorsGroup - name: odigos-gateway -(data != null): true ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: odigos-data-collection - namespace: odigos-system - ownerReferences: - - apiVersion: odigos.io/v1alpha1 - blockOwnerDeletion: true - controller: true - kind: CollectorsGroup - name: odigos-data-collection -(data != null): true ---- -apiVersion: apps/v1 -kind: DaemonSet -metadata: - labels: - odigos.io/collector-role: "NODE_COLLECTOR" - name: odigos-data-collection - namespace: odigos-system - ownerReferences: - - apiVersion: odigos.io/v1alpha1 - blockOwnerDeletion: true - controller: true - kind: CollectorsGroup - name: odigos-data-collection -spec: - selector: - matchLabels: - odigos.io/collector-role: "NODE_COLLECTOR" - template: - metadata: - labels: - odigos.io/collector-role: "NODE_COLLECTOR" - spec: - containers: - - name: data-collection - securityContext: - privileged: true - volumeMounts: - - mountPath: /conf - name: conf - - mountPath: /var/lib/docker/containers - name: varlibdockercontainers - readOnly: true - - mountPath: /var/log - name: varlog - readOnly: true - - mountPath: /var/lib/kubelet/pod-resources - name: kubeletpodresources - readOnly: true - env: - - name: NODE_NAME - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: spec.nodeName - - name: POD_NAME - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: metadata.name - hostNetwork: true - nodeSelector: - kubernetes.io/os: linux - securityContext: {} - serviceAccount: odigos-data-collection - serviceAccountName: odigos-data-collection - volumes: - - configMap: - defaultMode: 420 - items: - - key: conf - path: conf.yaml - name: odigos-data-collection - name: conf - - hostPath: - path: /var/log - type: "" - name: varlog - - hostPath: - path: /var/lib/docker/containers - type: "" - name: varlibdockercontainers - - hostPath: - path: /var/lib/kubelet/pod-resources - type: "" - name: kubeletpodresources -status: - numberAvailable: 1 - numberReady: 1 ---- -apiVersion: v1 -kind: Pod -metadata: - namespace: default - labels: - app: frontend -spec: - containers: - - name: frontend - resources: - limits: - instrumentation.odigos.io/java-native-community: "1" - requests: - instrumentation.odigos.io/java-native-community: "1" -status: - containerStatuses: - - name: frontend - ready: true - restartCount: 0 - started: true - phase: Running ---- -apiVersion: v1 -kind: Pod -metadata: - namespace: default - labels: - app: coupon -spec: - containers: - - name: coupon - resources: - limits: - instrumentation.odigos.io/javascript-native-community: "1" - requests: - instrumentation.odigos.io/javascript-native-community: "1" -status: - containerStatuses: - - name: coupon - ready: true - restartCount: 0 - started: true - phase: Running ---- -apiVersion: v1 -kind: Pod -metadata: - namespace: default - labels: - app: inventory -spec: - containers: - - name: inventory - resources: - limits: - instrumentation.odigos.io/python-native-community: "1" - requests: - instrumentation.odigos.io/python-native-community: "1" -status: - containerStatuses: - - name: inventory - ready: true - restartCount: 0 - started: true - phase: Running ---- -apiVersion: v1 -kind: Pod -metadata: - namespace: default - labels: - app: membership -spec: - containers: - - name: membership - resources: - limits: - instrumentation.odigos.io/go-ebpf-community: "1" - requests: - instrumentation.odigos.io/go-ebpf-community: "1" -status: - containerStatuses: - - name: membership - ready: true - restartCount: 0 - started: true - phase: Running ---- -apiVersion: v1 -kind: Pod -metadata: - namespace: default - labels: - app: pricing -spec: - containers: - - name: pricing - resources: - limits: - instrumentation.odigos.io/dotnet-native-community: "1" - requests: - instrumentation.odigos.io/dotnet-native-community: "1" -status: - containerStatuses: - - name: pricing - ready: true - restartCount: 0 - started: true - phase: Running ---- -apiVersion: odigos.io/v1alpha1 -kind: InstrumentationInstance -metadata: - namespace: default - labels: - instrumented-app: deployment-coupon -status: - healthy: true - identifyingAttributes: - - key: service.instance.id - (value != null): true - - key: telemetry.sdk.language - value: nodejs - - key: process.runtime.version - (value != null): true - - key: telemetry.distro.version - (value != null): true - - key: process.pid - (value != null): true - - key: k8s.namespace.name - (value != null): true - - key: k8s.container.name - (value != null): true - - key: k8s.pod.name - (value != null): true ---- -apiVersion: odigos.io/v1alpha1 -kind: InstrumentationInstance -metadata: - namespace: default - labels: - instrumented-app: deployment-inventory -status: - healthy: true - identifyingAttributes: - - key: service.instance.id - (value != null): true - - key: process.pid - (value != null): true - - key: telemetry.sdk.language - value: python - - key: k8s.namespace.name - (value != null): true - - key: k8s.container.name - (value != null): true - - key: k8s.pod.name - (value != null): true ---- -apiVersion: odigos.io/v1alpha1 -kind: InstrumentationInstance -metadata: - namespace: default - labels: - instrumented-app: deployment-membership -status: - healthy: true - reason: LoadedSuccessfully diff --git a/tests/e2e/multi-apps/assert-post-dest-runtime-details.yaml b/tests/e2e/multi-apps/assert-post-dest-runtime-details.yaml deleted file mode 100644 index 6f7dbb1eb..000000000 --- a/tests/e2e/multi-apps/assert-post-dest-runtime-details.yaml +++ /dev/null @@ -1,101 +0,0 @@ ---- -apiVersion: odigos.io/v1alpha1 -kind: InstrumentationConfig -metadata: - name: deployment-coupon - namespace: default - ownerReferences: - - apiVersion: apps/v1 - blockOwnerDeletion: true - controller: true - kind: Deployment - name: coupon -status: - observedWorkloadGeneration: 2 # pod has been restarted after destination was added - runtimeDetailsByContainer: - - containerName: coupon - envVars: - - name: NODE_OPTIONS - value: --require /var/odigos/nodejs/autoinstrumentation.js - language: javascript - runtimeVersion: 18.3.0 ---- -apiVersion: odigos.io/v1alpha1 -kind: InstrumentationConfig -metadata: - name: deployment-frontend - namespace: default - ownerReferences: - - apiVersion: apps/v1 - blockOwnerDeletion: true - controller: true - kind: Deployment - name: frontend -status: - observedWorkloadGeneration: 2 # pod has been restarted after destination was added - runtimeDetailsByContainer: - - containerName: frontend - (sort_by(envVars, &name)): - - name: JAVA_OPTS - value: -javaagent:/var/odigos/java/javaagent.jar - - name: JAVA_TOOL_OPTIONS - value: -javaagent:/var/odigos/java/javaagent.jar - language: java - runtimeVersion: 17.0.11+9 ---- -apiVersion: odigos.io/v1alpha1 -kind: InstrumentationConfig -metadata: - name: deployment-inventory - namespace: default - ownerReferences: - - apiVersion: apps/v1 - blockOwnerDeletion: true - controller: true - kind: Deployment - name: inventory -status: - observedWorkloadGeneration: 2 # pod has been restarted after destination was added - runtimeDetailsByContainer: - - containerName: inventory - envVars: - - name: PYTHONPATH - # The image contains /bar in PYTHONPATH so this is concatenated with odigos value - value: /bar:/var/odigos/python:/var/odigos/python/opentelemetry/instrumentation/auto_instrumentation - language: python - runtimeVersion: 3.11.9 ---- -apiVersion: odigos.io/v1alpha1 -kind: InstrumentationConfig -metadata: - name: deployment-membership - namespace: default - ownerReferences: - - apiVersion: apps/v1 - blockOwnerDeletion: true - controller: true - kind: Deployment - name: membership -status: - observedWorkloadGeneration: 2 # pod has been restarted after destination was added - runtimeDetailsByContainer: - - containerName: membership - language: go - runtimeVersion: 1.21.4 ---- -apiVersion: odigos.io/v1alpha1 -kind: InstrumentationConfig -metadata: - name: deployment-pricing - namespace: default - ownerReferences: - - apiVersion: apps/v1 - blockOwnerDeletion: true - controller: true - kind: Deployment - name: pricing -status: - observedWorkloadGeneration: 2 - runtimeDetailsByContainer: - - containerName: pricing - language: dotnet diff --git a/tests/e2e/multi-apps/assert-runtime-detected.yaml b/tests/e2e/multi-apps/assert-runtime-detected.yaml deleted file mode 100644 index fc6ee1249..000000000 --- a/tests/e2e/multi-apps/assert-runtime-detected.yaml +++ /dev/null @@ -1,171 +0,0 @@ -apiVersion: odigos.io/v1alpha1 -kind: InstrumentedApplication -metadata: - name: deployment-coupon - namespace: default - ownerReferences: - - apiVersion: apps/v1 - blockOwnerDeletion: true - controller: true - kind: Deployment - name: coupon -spec: - runtimeDetails: - - containerName: coupon - language: javascript ---- -apiVersion: odigos.io/v1alpha1 -kind: InstrumentedApplication -metadata: - name: deployment-frontend - namespace: default - ownerReferences: - - apiVersion: apps/v1 - blockOwnerDeletion: true - controller: true - kind: Deployment - name: frontend -spec: - runtimeDetails: - - containerName: frontend - language: java ---- -apiVersion: odigos.io/v1alpha1 -kind: InstrumentedApplication -metadata: - name: deployment-inventory - namespace: default - ownerReferences: - - apiVersion: apps/v1 - blockOwnerDeletion: true - controller: true - kind: Deployment - name: inventory -spec: - runtimeDetails: - - containerName: inventory - language: python ---- -apiVersion: odigos.io/v1alpha1 -kind: InstrumentedApplication -metadata: - name: deployment-membership - namespace: default - ownerReferences: - - apiVersion: apps/v1 - blockOwnerDeletion: true - controller: true - kind: Deployment - name: membership -spec: - runtimeDetails: - - containerName: membership - language: go ---- -apiVersion: odigos.io/v1alpha1 -kind: InstrumentedApplication -metadata: - name: deployment-pricing - namespace: default - ownerReferences: - - apiVersion: apps/v1 - blockOwnerDeletion: true - controller: true - kind: Deployment - name: pricing -spec: - runtimeDetails: - - containerName: pricing - language: dotnet ---- -apiVersion: odigos.io/v1alpha1 -kind: InstrumentationConfig -metadata: - name: deployment-coupon - namespace: default - ownerReferences: - - apiVersion: apps/v1 - blockOwnerDeletion: true - controller: true - kind: Deployment - name: coupon -status: - observedWorkloadGeneration: 1 # destination not yet added so pod not yet restarted - runtimeDetailsByContainer: - - containerName: coupon - language: javascript - runtimeVersion: 18.3.0 ---- -apiVersion: odigos.io/v1alpha1 -kind: InstrumentationConfig -metadata: - name: deployment-frontend - namespace: default - ownerReferences: - - apiVersion: apps/v1 - blockOwnerDeletion: true - controller: true - kind: Deployment - name: frontend -status: - observedWorkloadGeneration: 1 # destination not yet added so pod not yet restarted - runtimeDetailsByContainer: - - containerName: frontend - language: java - runtimeVersion: 17.0.11+9 ---- -apiVersion: odigos.io/v1alpha1 -kind: InstrumentationConfig -metadata: - name: deployment-inventory - namespace: default - ownerReferences: - - apiVersion: apps/v1 - blockOwnerDeletion: true - controller: true - kind: Deployment - name: inventory -status: - observedWorkloadGeneration: 1 # destination not yet added so pod not yet restarted - runtimeDetailsByContainer: - - containerName: inventory - envVars: - - name: PYTHONPATH - value: /bar # this env exists in the test image - language: python - runtimeVersion: 3.11.9 ---- -apiVersion: odigos.io/v1alpha1 -kind: InstrumentationConfig -metadata: - name: deployment-membership - namespace: default - ownerReferences: - - apiVersion: apps/v1 - blockOwnerDeletion: true - controller: true - kind: Deployment - name: membership -status: - observedWorkloadGeneration: 1 - runtimeDetailsByContainer: - - containerName: membership - language: go - runtimeVersion: 1.21.4 ---- -apiVersion: odigos.io/v1alpha1 -kind: InstrumentationConfig -metadata: - name: deployment-pricing - namespace: default - ownerReferences: - - apiVersion: apps/v1 - blockOwnerDeletion: true - controller: true - kind: Deployment - name: pricing -status: - observedWorkloadGeneration: 1 - runtimeDetailsByContainer: - - containerName: pricing - language: dotnet diff --git a/tests/e2e/multi-apps/assert-tempo-running.yaml b/tests/e2e/multi-apps/assert-tempo-running.yaml deleted file mode 100644 index f4653f4a3..000000000 --- a/tests/e2e/multi-apps/assert-tempo-running.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: e2e-tests-tempo-0 - namespace: traces -status: - phase: Running - containerStatuses: - - name: tempo - ready: true - restartCount: 0 \ No newline at end of file diff --git a/tests/e2e/multi-apps/assert-traffic-job-running.yaml b/tests/e2e/multi-apps/assert-traffic-job-running.yaml deleted file mode 100644 index 0557b2742..000000000 --- a/tests/e2e/multi-apps/assert-traffic-job-running.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: batch/v1 -kind: Job -metadata: - name: buybot-job - namespace: default -status: - conditions: - - status: "True" - type: Complete - succeeded: 1 diff --git a/tests/e2e/multi-apps/chainsaw-test.yaml b/tests/e2e/multi-apps/chainsaw-test.yaml index 6c241fb37..e03b8efce 100644 --- a/tests/e2e/multi-apps/chainsaw-test.yaml +++ b/tests/e2e/multi-apps/chainsaw-test.yaml @@ -18,7 +18,7 @@ spec: --set tempo.ingester.max_block_duration=20s \ --version 1.10.1 - assert: - file: assert-tempo-running.yaml + file: ../../common/assert/tempo-running.yaml - name: Wait for destination to be ready try: - script: @@ -29,13 +29,13 @@ spec: - script: content: | if [ "$MODE" = "cross-cloud-tests" ]; then - ../../../cli/odigos install --version "$COMMIT_HASH" --image-prefix=public.ecr.aws/y2v0v6s7 + ../../../cli/odigos install --namespace odigos-test --version "$COMMIT_HASH" --image-prefix=public.ecr.aws/y2v0v6s7 else - ../../../cli/odigos install --version e2e-test + ../../../cli/odigos install --namespace odigos-test --version e2e-test fi timeout: 60s - assert: - file: assert-odigos-installed.yaml + file: ../../common/assert/odigos-installed.yaml - name: Install Demo App try: @@ -57,7 +57,7 @@ spec: echo "Skipping docker pull and kind load for cross-cloud-tests mode" fi - apply: - file: 02-install-simple-demo.yaml + file: ../../common/apply/install-simple-demo.yaml - script: timeout: 70s content: | @@ -67,48 +67,42 @@ spec: kubectl wait --for=condition=ready pod -l app=pricing --timeout=60s kubectl wait --for=condition=ready pod -l app=membership --timeout=60s - assert: - file: assert-apps-installed.yaml - + file: ../../common/assert/simple-demo-installed.yaml - name: Instrument Namespace try: - apply: - file: 03-instrument-ns.yaml - + file: ../../common/apply/instrument-default-ns.yaml - name: Assert Runtime Detected try: - assert: timeout: 2m - file: assert-runtime-detected.yaml - + file: ../../common/assert/simple-demo-runtime-detected.yaml - name: Add Destination try: - apply: - file: 04-add-destination.yaml - - - name: Assert Instrumented and Pipeline + file: ../../common/apply/add-tempo-traces-destination.yaml + - name: Odigos pipeline ready try: - assert: - file: assert-instrumented-and-pipeline.yaml - - - name: Assert Post Destination Runtime Details + file: ../../common/assert/pipeline-ready.yaml + - name: Simple-demo instrumented after destination added try: - assert: - file: assert-post-dest-runtime-details.yaml - + file: ../../common/assert/simple-demo-instrumented.yaml - name: Generate Traffic try: - script: timeout: 300s content: | # Apply the job - kubectl apply -f 05-generate-traffic.yaml + kubectl apply -f ../../common/apply/generate-traffic-job.yaml # Wait for the job to complete - job_name=$(kubectl get -f 05-generate-traffic.yaml -o=jsonpath='{.metadata.name}') + job_name=$(kubectl get -f ../../common/apply/generate-traffic-job.yaml -o=jsonpath='{.metadata.name}') kubectl wait --for=condition=complete job/$job_name # Delete the job - kubectl delete -f 05-generate-traffic.yaml + kubectl delete -f ../../common/apply/generate-traffic-job.yaml while true; do # wait for traces to be available diff --git a/tests/e2e/workload-lifecycle/01-add-destination.yaml b/tests/e2e/workload-lifecycle/01-add-destination.yaml deleted file mode 100644 index a847f9e44..000000000 --- a/tests/e2e/workload-lifecycle/01-add-destination.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: odigos.io/v1alpha1 -kind: Destination -metadata: - name: odigos.io.dest.tempo-123123 - namespace: odigos-system -spec: - data: - TEMPO_URL: e2e-tests-tempo.traces:4317 - destinationName: e2e-tests - signals: - - TRACES - type: tempo \ No newline at end of file diff --git a/tests/e2e/workload-lifecycle/01-instrument-ns.yaml b/tests/e2e/workload-lifecycle/01-instrument-ns.yaml deleted file mode 100644 index 6814c325f..000000000 --- a/tests/e2e/workload-lifecycle/01-instrument-ns.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: default - labels: - odigos-instrumentation: enabled \ No newline at end of file diff --git a/tests/e2e/workload-lifecycle/assert-odigos-installed.yaml b/tests/e2e/workload-lifecycle/assert-odigos-installed.yaml deleted file mode 100644 index 341bebe41..000000000 --- a/tests/e2e/workload-lifecycle/assert-odigos-installed.yaml +++ /dev/null @@ -1,145 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: odigos-system - labels: - odigos.io/system-object: 'true' ---- -apiVersion: v1 -kind: Pod -metadata: - labels: - app.kubernetes.io/name: odigos-autoscaler - namespace: odigos-system -status: - containerStatuses: - - name: manager - ready: true - restartCount: 0 - started: true - phase: Running ---- -apiVersion: v1 -kind: Pod -metadata: - labels: - app.kubernetes.io/name: odigos-scheduler - namespace: odigos-system -status: - containerStatuses: - - name: manager - ready: true - restartCount: 0 - started: true - phase: Running ---- -apiVersion: v1 -kind: Pod -metadata: - labels: - app.kubernetes.io/name: odigos-instrumentor - namespace: odigos-system -status: - containerStatuses: - - name: manager - ready: true - restartCount: 0 - started: true - phase: Running ---- -apiVersion: v1 -kind: Pod -metadata: - labels: - app.kubernetes.io/name: odiglet - namespace: odigos-system - ownerReferences: - - apiVersion: apps/v1 - blockOwnerDeletion: true - controller: true - kind: DaemonSet - name: odiglet -spec: - containers: - - name: odiglet - resources: {} - securityContext: - capabilities: - add: - - SYS_PTRACE - privileged: true - hostNetwork: true - hostPID: true - nodeSelector: - kubernetes.io/os: linux - serviceAccount: odiglet - serviceAccountName: odiglet -status: - containerStatuses: - - name: odiglet - ready: true - restartCount: 0 - started: true ---- -apiVersion: v1 -kind: Service -metadata: - name: ui - namespace: odigos-system -spec: - ports: - - name: ui - port: 3000 - protocol: TCP - targetPort: 3000 - - name: beta-ui - port: 3001 - protocol: TCP - targetPort: 3001 - - name: otlp - port: 4317 - protocol: TCP - targetPort: 4317 - selector: - app: odigos-ui ---- -apiVersion: v1 -kind: ConfigMap -metadata: - labels: - odigos.io/config: '1' - odigos.io/system-object: 'true' - name: odigos-config - namespace: odigos-system ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - labels: - odigos.io/config: '1' - odigos.io/system-object: 'true' - name: destinations.odigos.io ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - labels: - odigos.io/config: '1' - odigos.io/system-object: 'true' - name: instrumentedapplications.odigos.io ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - labels: - odigos.io/config: '1' - odigos.io/system-object: 'true' - name: odigosconfigurations.odigos.io ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - labels: - odigos.io/config: '1' - odigos.io/system-object: 'true' - name: processors.odigos.io diff --git a/tests/e2e/workload-lifecycle/assert-tempo-running.yaml b/tests/e2e/workload-lifecycle/assert-tempo-running.yaml deleted file mode 100644 index f4653f4a3..000000000 --- a/tests/e2e/workload-lifecycle/assert-tempo-running.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: e2e-tests-tempo-0 - namespace: traces -status: - phase: Running - containerStatuses: - - name: tempo - ready: true - restartCount: 0 \ No newline at end of file diff --git a/tests/e2e/workload-lifecycle/chainsaw-test.yaml b/tests/e2e/workload-lifecycle/chainsaw-test.yaml index bba67aec9..9479dbcc8 100644 --- a/tests/e2e/workload-lifecycle/chainsaw-test.yaml +++ b/tests/e2e/workload-lifecycle/chainsaw-test.yaml @@ -6,221 +6,214 @@ spec: description: This e2e test runs various scenarios to test the lifecycle of the workload skipDelete: true steps: - - name: Build and Load Test App Images - try: - - script: - timeout: 450s - content: | - docker build -t nodejs-unsupported-version:v0.0.1 -f services/nodejs-http-server/unsupported-version.Dockerfile services/nodejs-http-server - kind load docker-image nodejs-unsupported-version:v0.0.1 - docker build -t nodejs-very-old-version:v0.0.1 -f services/nodejs-http-server/very-old-version.Dockerfile services/nodejs-http-server - kind load docker-image nodejs-very-old-version:v0.0.1 - docker build -t nodejs-minimum-version:v0.0.1 -f services/nodejs-http-server/minimum-version.Dockerfile services/nodejs-http-server - kind load docker-image nodejs-minimum-version:v0.0.1 - docker build -t nodejs-latest-version:v0.0.1 -f services/nodejs-http-server/latest-version.Dockerfile services/nodejs-http-server - kind load docker-image nodejs-latest-version:v0.0.1 - docker build -t nodejs-dockerfile-env:v0.0.1 -f services/nodejs-http-server/dockerfile-env.Dockerfile services/nodejs-http-server - kind load docker-image nodejs-dockerfile-env:v0.0.1 - docker build -t nodejs-manifest-env:v0.0.1 -f services/nodejs-http-server/manifest-env.Dockerfile services/nodejs-http-server - kind load docker-image nodejs-manifest-env:v0.0.1 - - docker build -t cpp-http-server:v0.0.1 -f services/cpp-http-server/Dockerfile services/cpp-http-server - kind load docker-image cpp-http-server:v0.0.1 - - docker build -t java-supported-version:v0.0.1 -f services/java-http-server/java-supported-version.Dockerfile services/java-http-server - kind load docker-image java-supported-version:v0.0.1 - docker build -t java-azul:v0.0.1 -f services/java-http-server/java-azul.Dockerfile services/java-http-server - kind load docker-image java-azul:v0.0.1 - docker build -t java-supported-docker-env:v0.0.1 -f services/java-http-server/java-supported-docker-env.Dockerfile services/java-http-server - kind load docker-image java-supported-docker-env:v0.0.1 - docker build -t java-supported-manifest-env:v0.0.1 -f services/java-http-server/java-supported-manifest-env.Dockerfile services/java-http-server - kind load docker-image java-supported-manifest-env:v0.0.1 - docker build -t java-latest-version:v0.0.1 -f services/java-http-server/java-latest-version.Dockerfile services/java-http-server - kind load docker-image java-latest-version:v0.0.1 - docker build -t java-old-version:v0.0.1 -f services/java-http-server/java-old-version.Dockerfile services/java-http-server - kind load docker-image java-old-version:v0.0.1 - - docker build -t python-latest-version:v0.0.1 -f services/python-http-server/Dockerfile.python-latest services/python-http-server - kind load docker-image python-latest-version:v0.0.1 - docker build -t python-alpine:v0.0.1 -f services/python-http-server/Dockerfile.python-alpine services/python-http-server - kind load docker-image python-alpine:v0.0.1 - docker build -t python-not-supported:v0.0.1 -f services/python-http-server/Dockerfile.python-not-supported-version services/python-http-server - kind load docker-image python-not-supported:v0.0.1 - docker build -t python-min-version:v0.0.1 -f services/python-http-server/Dockerfile.python-min-version services/python-http-server - kind load docker-image python-min-version:v0.0.1 - - - name: Prepare destination - try: - - script: - timeout: 60s - content: | - helm repo add grafana https://grafana.github.io/helm-charts - helm repo update - helm install e2e-tests grafana/tempo \ - -n traces --create-namespace \ - --set tempo.storage.trace.block.version=vParquet4 \ - --set tempo.ingester.trace_idle_period=5s \ - --set tempo.ingester.max_block_duration=20s \ - --version 1.10.1 - - assert: - file: assert-tempo-running.yaml - - name: Wait for destination to be ready - try: - - script: - timeout: 60s - content: ../../common/wait_for_dest.sh - - name: Install Odigos - try: - - script: - content: ../../../cli/odigos install --version e2e-test - timeout: 60s - - assert: - file: assert-odigos-installed.yaml - - name: '01 - Install Test Apps' - try: - - apply: - file: 01-install-test-apps.yaml - - - name: '01 - Assert Apps installed' - try: - - assert: - file: 01-assert-apps-installed.yaml - - - name: '01 Instrument Namespaces' - try: - - apply: - file: 01-instrument-ns.yaml - - - name: '01 Assert runtime detection' - try: - - assert: - file: 01-assert-runtime-detected.yaml - - - name: '01 Add Destination' - try: - - apply: - file: 01-add-destination.yaml - - - name: "01 Assert Pipeline" - try: - - assert: - file: 01-assert-pipeline.yaml - - - name: "01 Assert Instrumented" - try: - - assert: - file: 01-assert-instrumented.yaml - - - name: "01 Assert Workloads" - try: - - assert: - file: 01-assert-workloads.yaml - - - name: '01 - Generate Traffic' - # at this point, we know the expected services are instrumented because we asserted the instrumentation instance - # send traffic to all services to verify they are working as expected and verify traces for instrumented ones - try: - - script: - timeout: 200s - content: | - set -e - - NAMESPACE="default" - DEPLOYMENTS=$(kubectl get deployments -n $NAMESPACE -o jsonpath='{.items[*].metadata.name}') - - - for DEPLOYMENT in $DEPLOYMENTS; do - echo "Waiting for deployment $DEPLOYMENT to finish rollout..." - kubectl rollout status deployment/$DEPLOYMENT -n $NAMESPACE - if [ $? -ne 0 ]; then - echo "Deployment $DEPLOYMENT failed to finish rollout." - exit 1 - fi - done - - - # Apply the job - kubectl apply -f 01-generate-traffic.yaml - - # Wait for the job to complete - job_name=$(kubectl get -f 01-generate-traffic.yaml -o=jsonpath='{.metadata.name}') - kubectl wait --for=condition=complete job/$job_name - - # Delete the job - kubectl delete -f 01-generate-traffic.yaml - - - - - name: '01 - Wait for Traces' - try: - - script: - timeout: 60s - content: | - sleep 20 - while true; do - ../../common/traceql_runner.sh 01-wait-for-trace.yaml - if [ $? -eq 0 ]; then - break - else - sleep 3 - ../../common/flush_traces.sh - fi - done - - - name: '02 - Update workload manifest template spec' - try: - - apply: - file: 02-update-workload-manifests.yaml - - script: - timeout: 60s - content: | - # this is temporary and is here to trigger runtime detection after the language-change deployment is updated to simulate this scenario. - # after the migration to the new runtime detection mechanism, we will no longer need to restart the instrumentor. - kubectl rollout restart deployment odigos-instrumentor -n odigos-system - sleep 30 - - assert: - file: 02-assert-workload-update.yaml - - - name: '02 - Generate Traffic' - try: - - script: - timeout: 200s - content: | - set -e - - NAMESPACE="default" - DEPLOYMENTS=$(kubectl get deployments -n $NAMESPACE -o jsonpath='{.items[*].metadata.name}') - - - for DEPLOYMENT in $DEPLOYMENTS; do - echo "Waiting for deployment $DEPLOYMENT to finish rollout..." - kubectl rollout status deployment/$DEPLOYMENT -n $NAMESPACE - if [ $? -ne 0 ]; then - echo "Deployment $DEPLOYMENT failed to finish rollout." - exit 1 - fi - done - - - kubectl apply -f 01-generate-traffic.yaml - job_name=$(kubectl get -f 01-generate-traffic.yaml -o=jsonpath='{.metadata.name}') - kubectl wait --for=condition=complete job/$job_name - kubectl delete -f 01-generate-traffic.yaml - - - name: '02 - Wait for Traces' - try: - - script: - timeout: 60s - content: | - - sleep 20 - - while true; do - ../../common/traceql_runner.sh 02-wait-for-trace.yaml - if [ $? -eq 0 ]; then - break - else - sleep 3 - ../../common/flush_traces.sh - fi - done + - name: Build and Load Test App Images + try: + - script: + timeout: 450s + content: | + docker build -t nodejs-unsupported-version:v0.0.1 -f services/nodejs-http-server/unsupported-version.Dockerfile services/nodejs-http-server + kind load docker-image nodejs-unsupported-version:v0.0.1 + docker build -t nodejs-very-old-version:v0.0.1 -f services/nodejs-http-server/very-old-version.Dockerfile services/nodejs-http-server + kind load docker-image nodejs-very-old-version:v0.0.1 + docker build -t nodejs-minimum-version:v0.0.1 -f services/nodejs-http-server/minimum-version.Dockerfile services/nodejs-http-server + kind load docker-image nodejs-minimum-version:v0.0.1 + docker build -t nodejs-latest-version:v0.0.1 -f services/nodejs-http-server/latest-version.Dockerfile services/nodejs-http-server + kind load docker-image nodejs-latest-version:v0.0.1 + docker build -t nodejs-dockerfile-env:v0.0.1 -f services/nodejs-http-server/dockerfile-env.Dockerfile services/nodejs-http-server + kind load docker-image nodejs-dockerfile-env:v0.0.1 + docker build -t nodejs-manifest-env:v0.0.1 -f services/nodejs-http-server/manifest-env.Dockerfile services/nodejs-http-server + kind load docker-image nodejs-manifest-env:v0.0.1 + + docker build -t cpp-http-server:v0.0.1 -f services/cpp-http-server/Dockerfile services/cpp-http-server + kind load docker-image cpp-http-server:v0.0.1 + + docker build -t java-supported-version:v0.0.1 -f services/java-http-server/java-supported-version.Dockerfile services/java-http-server + kind load docker-image java-supported-version:v0.0.1 + docker build -t java-azul:v0.0.1 -f services/java-http-server/java-azul.Dockerfile services/java-http-server + kind load docker-image java-azul:v0.0.1 + docker build -t java-supported-docker-env:v0.0.1 -f services/java-http-server/java-supported-docker-env.Dockerfile services/java-http-server + kind load docker-image java-supported-docker-env:v0.0.1 + docker build -t java-supported-manifest-env:v0.0.1 -f services/java-http-server/java-supported-manifest-env.Dockerfile services/java-http-server + kind load docker-image java-supported-manifest-env:v0.0.1 + docker build -t java-latest-version:v0.0.1 -f services/java-http-server/java-latest-version.Dockerfile services/java-http-server + kind load docker-image java-latest-version:v0.0.1 + docker build -t java-old-version:v0.0.1 -f services/java-http-server/java-old-version.Dockerfile services/java-http-server + kind load docker-image java-old-version:v0.0.1 + + docker build -t python-latest-version:v0.0.1 -f services/python-http-server/Dockerfile.python-latest services/python-http-server + kind load docker-image python-latest-version:v0.0.1 + docker build -t python-alpine:v0.0.1 -f services/python-http-server/Dockerfile.python-alpine services/python-http-server + kind load docker-image python-alpine:v0.0.1 + docker build -t python-not-supported:v0.0.1 -f services/python-http-server/Dockerfile.python-not-supported-version services/python-http-server + kind load docker-image python-not-supported:v0.0.1 + docker build -t python-min-version:v0.0.1 -f services/python-http-server/Dockerfile.python-min-version services/python-http-server + kind load docker-image python-min-version:v0.0.1 + + - name: Prepare destination + try: + - script: + timeout: 60s + content: | + helm repo add grafana https://grafana.github.io/helm-charts + helm repo update + helm install e2e-tests grafana/tempo \ + -n traces --create-namespace \ + --set tempo.storage.trace.block.version=vParquet4 \ + --set tempo.ingester.trace_idle_period=5s \ + --set tempo.ingester.max_block_duration=20s \ + --version 1.10.1 + - assert: + file: ../../common/assert/tempo-running.yaml + - name: Wait for destination to be ready + try: + - script: + timeout: 60s + content: ../../common/wait_for_dest.sh + - name: Install Odigos + try: + - script: + content: ../../../cli/odigos install --namespace odigos-test --version e2e-test + timeout: 60s + - assert: + file: ../../common/assert/odigos-installed.yaml + - name: "01 - Install Test Apps" + try: + - apply: + file: 01-install-test-apps.yaml + - name: "01 - Assert Apps installed" + try: + - assert: + file: 01-assert-apps-installed.yaml + - name: "01 Instrument Namespaces" + try: + - apply: + file: ../../common/apply/instrument-default-ns.yaml + - name: "01 Assert runtime detection" + try: + - assert: + file: 01-assert-runtime-detected.yaml + - name: "01 Add Destination" + try: + - apply: + file: ../../common/apply/add-tempo-traces-destination.yaml + - name: "01 Assert Pipeline" + try: + - assert: + file: ../../common/assert/pipeline-ready.yaml + + - name: "01 Assert Instrumented" + try: + - assert: + file: 01-assert-instrumented.yaml + + - name: "01 Assert Workloads" + try: + - assert: + file: 01-assert-workloads.yaml + + - name: "01 - Generate Traffic" + # at this point, we know the expected services are instrumented because we asserted the instrumentation instance + # send traffic to all services to verify they are working as expected and verify traces for instrumented ones + try: + - script: + timeout: 200s + content: | + set -e + + NAMESPACE="default" + DEPLOYMENTS=$(kubectl get deployments -n $NAMESPACE -o jsonpath='{.items[*].metadata.name}') + + + for DEPLOYMENT in $DEPLOYMENTS; do + echo "Waiting for deployment $DEPLOYMENT to finish rollout..." + kubectl rollout status deployment/$DEPLOYMENT -n $NAMESPACE + if [ $? -ne 0 ]; then + echo "Deployment $DEPLOYMENT failed to finish rollout." + exit 1 + fi + done + + + # Apply the job + kubectl apply -f 01-generate-traffic.yaml + + # Wait for the job to complete + job_name=$(kubectl get -f 01-generate-traffic.yaml -o=jsonpath='{.metadata.name}') + kubectl wait --for=condition=complete job/$job_name + + # Delete the job + kubectl delete -f 01-generate-traffic.yaml + + - name: "01 - Wait for Traces" + try: + - script: + timeout: 60s + content: | + sleep 20 + while true; do + ../../common/traceql_runner.sh 01-wait-for-trace.yaml + if [ $? -eq 0 ]; then + break + else + sleep 3 + ../../common/flush_traces.sh + fi + done + + - name: "02 - Update workload manifest template spec" + try: + - apply: + file: 02-update-workload-manifests.yaml + - script: + timeout: 60s + content: | + # this is temporary and is here to trigger runtime detection after the language-change deployment is updated to simulate this scenario. + # after the migration to the new runtime detection mechanism, we will no longer need to restart the instrumentor. + kubectl rollout restart deployment odigos-instrumentor -n odigos-test + sleep 30 + - assert: + file: 02-assert-workload-update.yaml + + - name: "02 - Generate Traffic" + try: + - script: + timeout: 200s + content: | + set -e + + NAMESPACE="default" + DEPLOYMENTS=$(kubectl get deployments -n $NAMESPACE -o jsonpath='{.items[*].metadata.name}') + + + for DEPLOYMENT in $DEPLOYMENTS; do + echo "Waiting for deployment $DEPLOYMENT to finish rollout..." + kubectl rollout status deployment/$DEPLOYMENT -n $NAMESPACE + if [ $? -ne 0 ]; then + echo "Deployment $DEPLOYMENT failed to finish rollout." + exit 1 + fi + done + + + kubectl apply -f 01-generate-traffic.yaml + job_name=$(kubectl get -f 01-generate-traffic.yaml -o=jsonpath='{.metadata.name}') + kubectl wait --for=condition=complete job/$job_name + kubectl delete -f 01-generate-traffic.yaml + + - name: "02 - Wait for Traces" + try: + - script: + timeout: 60s + content: | + + sleep 20 + + while true; do + ../../common/traceql_runner.sh 02-wait-for-trace.yaml + if [ $? -eq 0 ]; then + break + else + sleep 3 + ../../common/flush_traces.sh + fi + done