From 4993c4335572bec023518fad98934672bf74e48a Mon Sep 17 00:00:00 2001 From: Natalie Serrino Date: Wed, 16 Feb 2022 11:01:05 -0800 Subject: [PATCH] PP-3248: Add K8s deployment for Go profiler load tester Summary: This diff adds the K8s YAML files to deploy the Go profiler load tester to a cluster. When we have other language profilers, we can add a profile to the skaffold file that gets passed in as an input argument. Test Plan: ran it on my cluster Reviewers: zasgar, vihang, oazizi, jamesbartlett Reviewed By: vihang JIRA Issues: PP-3248 Signed-off-by: Natalie Serrino Differential Revision: https://phab.corp.pixielabs.ai/D10789 GitOrigin-RevId: 6d83bca36930a91b0efb78cfd9f3ab4d6d6c6ec0 --- src/e2e_test/profiler_loadtest/go/BUILD.bazel | 2 +- .../k8s/go_loadtest_deployment.yaml | 28 +++++++++++++++++++ .../profiler_loadtest/k8s/kustomization.yaml | 6 ++++ .../profiler_loadtest/skaffold_loadtest.yaml | 17 +++++++++++ 4 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 src/e2e_test/profiler_loadtest/k8s/go_loadtest_deployment.yaml create mode 100644 src/e2e_test/profiler_loadtest/k8s/kustomization.yaml create mode 100644 src/e2e_test/profiler_loadtest/skaffold_loadtest.yaml diff --git a/src/e2e_test/profiler_loadtest/go/BUILD.bazel b/src/e2e_test/profiler_loadtest/go/BUILD.bazel index 6ba5b4541fd..42dd5511f6c 100644 --- a/src/e2e_test/profiler_loadtest/go/BUILD.bazel +++ b/src/e2e_test/profiler_loadtest/go/BUILD.bazel @@ -46,7 +46,7 @@ container_push( format = "Docker", image = ":profiler_loadtest_golang_image", registry = "gcr.io", - repository = "pixie-oss/pixie-dev/experimental/profiler_loadtest_golang", + repository = "gcr.io/pixie-oss/pixie-dev/src/e2e_test/profiler_loadtest/profiler_loadtest_golang", tag = "{STABLE_BUILD_TAG}", tags = ["manual"], ) diff --git a/src/e2e_test/profiler_loadtest/k8s/go_loadtest_deployment.yaml b/src/e2e_test/profiler_loadtest/k8s/go_loadtest_deployment.yaml new file mode 100644 index 00000000000..27a7203c01d --- /dev/null +++ b/src/e2e_test/profiler_loadtest/k8s/go_loadtest_deployment.yaml @@ -0,0 +1,28 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: server + namespace: px-profiler-loadtest +spec: + replicas: 1 + selector: + matchLabels: + name: go-app + template: + metadata: + labels: + name: go-app + spec: + containers: + - name: app + image: gcr.io/pixie-oss/pixie-dev/src/e2e_test/profiler_loadtest/profiler_loadtest_golang:latest + env: + - name: NUM_GOROUTINES + value: "50" + - name: PAUSE_TIME_NS + value: "100000" + - name: NUM_FUNCTIONS + value: "5" + - name: CALL_STACK_DEPTH + value: "30" diff --git a/src/e2e_test/profiler_loadtest/k8s/kustomization.yaml b/src/e2e_test/profiler_loadtest/k8s/kustomization.yaml new file mode 100644 index 00000000000..6f125f4a70c --- /dev/null +++ b/src/e2e_test/profiler_loadtest/k8s/kustomization.yaml @@ -0,0 +1,6 @@ +--- +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: px-profiler-loadtest +resources: +- go_loadtest_deployment.yaml diff --git a/src/e2e_test/profiler_loadtest/skaffold_loadtest.yaml b/src/e2e_test/profiler_loadtest/skaffold_loadtest.yaml new file mode 100644 index 00000000000..2da64cb6952 --- /dev/null +++ b/src/e2e_test/profiler_loadtest/skaffold_loadtest.yaml @@ -0,0 +1,17 @@ +--- +apiVersion: skaffold/v2alpha3 +kind: Config +build: + artifacts: + - image: gcr.io/pixie-oss/pixie-dev/src/e2e_test/profiler_loadtest/profiler_loadtest_golang + context: . + bazel: + target: //src/e2e_test/profiler_loadtest/go:profiler_loadtest_golang_image.tar + tagPolicy: + dateTime: {} + local: + push: true +deploy: + kustomize: + paths: + - k8s/