From 43fff434870b39f4ff86756ed04092254575fd37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adnan=20Rahi=C4=87?= Date: Fri, 11 Aug 2023 08:51:43 +0200 Subject: [PATCH] examples+recipes(tekton): update tekton (#3054) --- .../recipes/running-tracetest-with-tekton.md | 27 +++++++++++++------ ...tall-and-run-tracetest-event-listener.yaml | 2 +- .../install-and-run-tracetest.yaml | 5 ++-- .../tekton-dashboard-init.bash | 2 ++ .../tekton-pipelines-init.bash | 0 .../tekton-triggers-init.bash | 0 .../quick-start-tekton/tests/test-api.yaml | 2 +- go.work.sum | 2 ++ 8 files changed, 28 insertions(+), 12 deletions(-) create mode 100755 examples/quick-start-tekton/tekton-dashboard-init.bash mode change 100644 => 100755 examples/quick-start-tekton/tekton-pipelines-init.bash mode change 100644 => 100755 examples/quick-start-tekton/tekton-triggers-init.bash diff --git a/docs/docs/examples-tutorials/recipes/running-tracetest-with-tekton.md b/docs/docs/examples-tutorials/recipes/running-tracetest-with-tekton.md index 0dca0f810a..5e5619bbad 100644 --- a/docs/docs/examples-tutorials/recipes/running-tracetest-with-tekton.md +++ b/docs/docs/examples-tutorials/recipes/running-tracetest-with-tekton.md @@ -250,6 +250,10 @@ spec: emptyDir: {} ``` +```bash +kubectl apply -f ./install-and-run-tracetest.yaml +``` + Make sure to use the Tracetest service as the endpoint for your `tracetest configure` command. This may vary depending on your installation. ```bash @@ -260,7 +264,7 @@ http://tracetest.tracetest.svc.cluster.local:11633/ Finally, to run the test, create a `TaskRun`. -Create a file called `install-and-run-tracetest-run-yaml`. +Create a file called `install-and-run-tracetest-run.yaml`. ```yaml apiVersion: tekton.dev/v1beta1 @@ -273,7 +277,7 @@ spec: ``` ```bash -kubectl apply -f ./install-and-run-tracetest-run-yaml +kubectl apply -f ./install-and-run-tracetest-run.yaml ``` Here's how to check the logs: @@ -290,9 +294,16 @@ tkn task start install-and-run-tracetest ```text title="Expected output" TaskRun started: install-and-run-tracetest-run-xmhfg +``` In order to track the TaskRun progress run: -tkn taskrun logs install-and-run-tracetest-run-xmhfg -f -n default + +```bash +tkn taskrun logs install-and-run-tracetest-run-gccjk -f -n default + +[install-and-run-tracetest] ✔ Pokeshop - List (http://tracetest.tracetest.svc.cluster.local:11633/test/RUkKQ_aVR/run/3/test) - trace id: 0549641531d3221ded696f2fd3b20ce6 +[install-and-run-tracetest] ✔ Database queries less than 500 ms +[install-and-run-tracetest] ``` To preview which tasks failed or succeeded, use this command: @@ -350,11 +361,11 @@ kubectl apply -f install-and-run-tracetest-trigger-template.yaml ### Create an EventListener -```yaml title="install-and-run-tracetest-listener.yaml" +```yaml title="install-and-run-tracetest-event-listener.yaml" apiVersion: triggers.tekton.dev/v1beta1 kind: EventListener metadata: - name: install-and-run-tracetest-listener + name: install-and-run-tracetest-event-listener spec: serviceAccountName: tekton-robot triggers: @@ -401,13 +412,13 @@ roleRef: ```bash kubectl apply -f tekton-robot-rbac.yaml -kubectl apply -f install-and-run-tracetest-listener.yaml +kubectl apply -f install-and-run-tracetest-event-listener.yaml ``` Enable port forwarding. ```bash -kubectl port-forward service/el-hello-listener 8080 +kubectl port-forward service/el-install-and-run-tracetest-event-listener 8080 ``` Hitting the port forwarded endpoint will trigger the task. @@ -419,7 +430,7 @@ curl -v \ http://localhost:8080 ``` -Checking the taskruns will confirm this. +Checking the `taskruns` will confirm this. ```bash tkn taskrun list diff --git a/examples/quick-start-tekton/install-and-run-tracetest-event-listener.yaml b/examples/quick-start-tekton/install-and-run-tracetest-event-listener.yaml index 72e7936f58..ea4a0a671d 100644 --- a/examples/quick-start-tekton/install-and-run-tracetest-event-listener.yaml +++ b/examples/quick-start-tekton/install-and-run-tracetest-event-listener.yaml @@ -1,7 +1,7 @@ apiVersion: triggers.tekton.dev/v1beta1 kind: EventListener metadata: - name: install-and-run-tracetest-listener + name: install-and-run-tracetest-event-listener spec: serviceAccountName: tekton-robot triggers: diff --git a/examples/quick-start-tekton/install-and-run-tracetest.yaml b/examples/quick-start-tekton/install-and-run-tracetest.yaml index 5996676bb8..d841d5a7a3 100644 --- a/examples/quick-start-tekton/install-and-run-tracetest.yaml +++ b/examples/quick-start-tekton/install-and-run-tracetest.yaml @@ -32,11 +32,12 @@ spec: - name: custom mountPath: /workspace - name: install-and-run-tracetest - image: kubeshop/tracetest:v0.11.9 # The official Tracetest image comes with the Tracetest CLI installed + image: kubeshop/tracetest:v0.13.3 + # The official Tracetest image comes with the Tracetest CLI installed script: | # Configure and Run Tracetest CLI tracetest configure -g --endpoint http://tracetest.tracetest.svc.cluster.local:11633/ - tracetest run test -f /workspace/test-api.yaml + tracetest run test --file /workspace/test-api.yaml --required-gates test-specs --output pretty volumeMounts: - name: custom mountPath: /workspace diff --git a/examples/quick-start-tekton/tekton-dashboard-init.bash b/examples/quick-start-tekton/tekton-dashboard-init.bash new file mode 100755 index 0000000000..38534f2cb9 --- /dev/null +++ b/examples/quick-start-tekton/tekton-dashboard-init.bash @@ -0,0 +1,2 @@ +kubectl apply --filename \ +https://storage.googleapis.com/tekton-releases/dashboard/latest/release.yaml diff --git a/examples/quick-start-tekton/tekton-pipelines-init.bash b/examples/quick-start-tekton/tekton-pipelines-init.bash old mode 100644 new mode 100755 diff --git a/examples/quick-start-tekton/tekton-triggers-init.bash b/examples/quick-start-tekton/tekton-triggers-init.bash old mode 100644 new mode 100755 diff --git a/examples/quick-start-tekton/tests/test-api.yaml b/examples/quick-start-tekton/tests/test-api.yaml index a6658efa03..2002f9fec5 100644 --- a/examples/quick-start-tekton/tests/test-api.yaml +++ b/examples/quick-start-tekton/tests/test-api.yaml @@ -15,4 +15,4 @@ spec: - name: Database queries less than 500 ms selector: span[tracetest.span.type="database"] assertions: - - attr:tracetest.span.duration < 10ms \ No newline at end of file + - attr:tracetest.span.duration < 500ms \ No newline at end of file diff --git a/go.work.sum b/go.work.sum index e25a401c25..94fd8f529c 100644 --- a/go.work.sum +++ b/go.work.sum @@ -1,3 +1,4 @@ +atomicgo.dev/assert v0.0.2/go.mod h1:ut4NcI3QDdJtlmAxQULOmA13Gz6e2DWbSAS8RUOmNYQ= cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= cloud.google.com/go v0.105.0/go.mod h1:PrLgOJNe5nfE9UMxKxgXj4mD3voiP+YQ6gdt6KMFOKM= cloud.google.com/go v0.107.0/go.mod h1:wpc2eNrD7hXUTy8EKS10jkxpZBjASrORK7goS+3YX2I= @@ -142,6 +143,7 @@ github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe/go.mod h1:6pvJx4me5XP github.com/cncf/xds/go v0.0.0-20220314180256-7f1daf1720fc/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20230105202645-06c439db220b/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= +github.com/containerd/containerd v1.6.18/go.mod h1:1RdCUu95+gc2v9t3IL+zIlpClSmew7/0YS8O5eQZrOw= github.com/docker/go-metrics v0.0.1 h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQV8= github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE=