Skip to content

Commit 6baeb2e

Browse files
avinalgabemontero
authored andcommitted
add Service for chains metrics
- Add Service for observalibilty in Tekton Chains - Add metrics test pipelinerun - Manully adding until PLNSRVCE-1359 is fixed Signed-off-by: Avinal Kumar <[email protected]>
1 parent 8619a4e commit 6baeb2e

File tree

5 files changed

+57
-7
lines changed

5 files changed

+57
-7
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
apiVersion: v1
3+
kind: Service
4+
metadata:
5+
name: tekton-chains
6+
namespace: openshift-pipelines
7+
labels:
8+
app.kubernetes.io/instance: default
9+
app.kubernetes.io/part-of: tekton-chains
10+
spec:
11+
ports:
12+
- name: metrics
13+
port: 9090
14+
protocol: TCP
15+
targetPort: 9090
16+
selector:
17+
app.kubernetes.io/name: controller
18+
app.kubernetes.io/component: controller
19+
app.kubernetes.io/instance: default
20+
app.kubernetes.io/part-of: tekton-chains

operator/gitops/argocd/pipeline-service/openshift-pipelines/kustomization.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ resources:
88
- tekton-config.yaml
99
- config-pac.yaml
1010
- config-logging.yaml
11+
# Manully add ConfigMap and Service until PLNSRVCE-1359 is fixed
12+
- chains-observability-service.yaml

operator/gitops/argocd/pipeline-service/tekton-chains/kustomization.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@
22
apiVersion: kustomize.config.k8s.io/v1beta1
33
kind: Kustomization
44
resources:
5-
#
6-
# For now we'll use the official release directly rather than downloading
7-
# it and checking it in.
8-
#
9-
# To list available releases:
10-
# curl -s https://storage.googleapis.com/tekton-releases/ | xq | grep -E 'chains/.*/release.yaml'
11-
#
125
- namespace.yaml
136
- chains-secrets-config.yaml
147
- public-key.yaml
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
kind: PipelineRun
3+
apiVersion: tekton.dev/v1beta1
4+
metadata:
5+
generateName: tekton-chains-metrics-
6+
spec:
7+
serviceAccountName: chains-test
8+
pipelineSpec:
9+
tasks:
10+
- name: chains-metrics-curl
11+
taskSpec:
12+
steps:
13+
- image: registry.access.redhat.com/ubi8/ubi-minimal:8.7
14+
name: chains-metrics-curl
15+
securityContext:
16+
runAsNonRoot: true
17+
script: |
18+
stats="$(curl http://tekton-chains.openshift-pipelines.svc.cluster.local:9090/metrics 2> /dev/null | grep 'github.com.tektoncd.chains')"
19+
if [ -z "$stats" ]; then
20+
echo "FAILED: tekton chains metrics is not available/working"
21+
exit 1
22+
fi
23+
echo "SUCCESS: tekton chains metrics is available/working"

operator/test/test.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,18 @@ test_chains() {
228228
# exit 1
229229
# fi
230230

231+
echo -n " - Metrics: "
232+
prName="$(kubectl create -n "$NAMESPACE" -f "$SCRIPT_DIR/manifests/test/tekton-chains/tekton-chains-metrics.yaml" | awk '{print $1}')"
233+
wait_for_pipeline "$prName" "$NAMESPACE"
234+
if [ "$(kubectl get "$prName" -n "$NAMESPACE" \
235+
-o 'jsonpath={.status.conditions[0].reason}')" = "Succeeded" ]; then
236+
echo "OK"
237+
else
238+
echo "Failed"
239+
echo "[ERROR] Tekton Chains metrics is not available/working" >&2
240+
exit 1
241+
fi
242+
231243
echo
232244
}
233245

0 commit comments

Comments
 (0)