Skip to content

Commit

Permalink
Add OTEL sidecar injector annotation together with ENV from CM
Browse files Browse the repository at this point in the history
- ConfigMap created by OTEL chart and contains global tracing configuration, Sidecar will be injected by OTEL operator.
- Add metrics port to k8s manifest. Metrics exposed but not yet configured
  • Loading branch information
astreter committed Feb 11, 2022
1 parent 2b6a492 commit 2074c5e
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .helm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,6 @@ Create the name of the service account to use
value: "true"
- name: CONFIG_PATH
value: "/"
- name: HTTPHANDLER_PORT
- name: HTTP_PORT
value: "8080"
{{- end -}}
10 changes: 10 additions & 0 deletions .helm/templates/deployment-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ spec:
role: api
template:
metadata:
annotations:
sidecar.opentelemetry.io/inject: "true"
labels:
{{- include "jiraclick.selectorLabels" . | nindent 8 }}
role: api
Expand All @@ -36,10 +38,18 @@ spec:
{{ include "jiraclick.common_env" . | nindent 12 }}
- name: HTTPHANDLER_PORT
value: "8080"
- name: METRICS_PORT
value: "9090"
envFrom:
- configMapRef:
name: opentelemetry-config
ports:
- name: http-handler
containerPort: 8080
protocol: TCP
- name: http-metrics
containerPort: 9090
protocol: TCP
livenessProbe:
httpGet:
path: /health-check
Expand Down
11 changes: 11 additions & 0 deletions .helm/templates/deployment-worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ spec:
role: worker
template:
metadata:
annotations:
sidecar.opentelemetry.io/inject: "true"
labels:
{{- include "jiraclick.selectorLabels" . | nindent 8 }}
role: worker
Expand All @@ -34,6 +36,15 @@ spec:
- worker
env:
{{ include "jiraclick.common_env" . | nindent 12 }}
- name: METRICS_PORT
value: "9090"
envFrom:
- configMapRef:
name: opentelemetry-config
ports:
- name: http-metrics
containerPort: 9090
protocol: TCP
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
Expand Down
4 changes: 4 additions & 0 deletions .helm/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ spec:
targetPort: http-handler
protocol: TCP
name: http-handler
- port: 9090
targetPort: http-metrics
protocol: TCP
name: http-metrics
selector:
{{- include "jiraclick.selectorLabels" . | nindent 4 }}
role: api

0 comments on commit 2074c5e

Please sign in to comment.