Skip to content

Commit

Permalink
adding optional to expose tetragon-operator metrics
Browse files Browse the repository at this point in the history
Signed-off-by: hungran <[email protected]>
  • Loading branch information
hungran committed Nov 26, 2023
1 parent 2d9c11e commit b8e981b
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
6 changes: 6 additions & 0 deletions install/kubernetes/templates/operator_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ spec:
capabilities:
drop:
- "ALL"
{{- if .Values.tetragonOperator.metrics.enabled }}
ports:
- containerPort: {{ .Values.tetragonOperator.metrics.port }}
name: metrics
protocol: TCP
{{- end }}
livenessProbe:
httpGet:
path: /healthz
Expand Down
19 changes: 19 additions & 0 deletions install/kubernetes/templates/operator_service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{{- if .Values.tetragonOperator.metrics.enabled -}}
---
apiVersion: v1
kind: Service
metadata:
namespace: {{ .Release.Namespace }}
name: {{ .Release.Name }}-operator-metrics
labels:
{{- include "tetragon-operator.labels" . | nindent 4 }}
spec:
ports:
- name: metrics
port: {{ .Values.tetragonOperator.metrics.port }}
targetPort: {{ .Values.tetragonOperator.metrics.port }}
protocol: TCP
selector:
{{- include "tetragon-operator.selectorLabels" . | nindent 6 }}
type: ClusterIP
{{- end }}
5 changes: 5 additions & 0 deletions install/kubernetes/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,11 @@ tetragonOperator:
# -- Enables the PodInfo CRD and the controller that reconciles PodInfo
# custom resources.
enabled: false
# -- Enables the Tetragon Operator metrics.
metrics:
enabled: true
# -- The port at which to expose metrics.
port: 2113
export:
# "stdout". "" to disable.
mode: "stdout"
Expand Down

0 comments on commit b8e981b

Please sign in to comment.