linkerd2/charts/add-ons/tracing/templates/tracing.yaml

247 lines
9.3 KiB
YAML

---
###
### Tracing Collector Service
###
---
apiVersion: v1
kind: ConfigMap
metadata:
name: linkerd-collector-config
namespace: {{.Values.global.namespace}}
labels:
{{.Values.global.controllerComponentLabel}}: linkerd-collector
{{.Values.global.controllerNamespaceLabel}}: {{.Values.global.namespace}}
annotations:
{{.Values.global.createdByAnnotation}}: {{default (printf "linkerd/helm %s" .Values.global.linkerdVersion) .Values.global.cliVersion}}
data:
linkerd-collector-config: |
receivers:
opencensus:
port: 55678
zipkin:
port: 9411
jaeger:
jaeger-thrift-http-port: 14268
queued-exporters:
jaeger-all-in-one:
num-workers: 4
queue-size: 100
retry-on-failure: true
sender-type: jaeger-thrift-http
jaeger-thrift-http:
collector-endpoint: {{printf "http://%s.%s:14268/api/traces" "linkerd-jaeger" .Values.global.namespace }}
timeout: 5s
---
apiVersion: v1
kind: Service
metadata:
name: linkerd-collector
namespace: {{.Values.global.namespace}}
labels:
{{.Values.global.controllerComponentLabel}}: linkerd-collector
{{.Values.global.controllerNamespaceLabel}}: {{.Values.global.namespace}}
annotations:
{{.Values.global.createdByAnnotation}}: {{default (printf "linkerd/helm %s" .Values.global.linkerdVersion) .Values.global.cliVersion}}
spec:
type: ClusterIP
ports:
- name: opencensus
port: 55678
protocol: TCP
targetPort: 55678
- name: zipkin
port: 9411
protocol: TCP
targetPort: 9411
- name: jaeger
port: 14268
protocol: TCP
targetPort: 14268
selector:
{{.Values.global.controllerComponentLabel}}: linkerd-collector
---
{{- $tree := deepCopy . }}
{{ $_ := set $tree.Values.global.proxy "workloadKind" "deployment" -}}
{{ $_ := set $tree.Values.global.proxy "component" "linkerd-collector" -}}
{{ include "linkerd.proxy.validation" $tree.Values.global.proxy -}}
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
{{.Values.global.createdByAnnotation}}: {{default (printf "linkerd/helm %s" .Values.global.linkerdVersion) .Values.global.cliVersion}}
labels:
app.kubernetes.io/name: linkerd-collector
app.kubernetes.io/part-of: Linkerd
app.kubernetes.io/version: {{default .Values.global.linkerdVersion .Values.global.controllerImageVersion}}
{{.Values.global.controllerComponentLabel}}: linkerd-collector
{{.Values.global.controllerNamespaceLabel}}: {{.Values.global.namespace}}
name: linkerd-collector
namespace: {{.Values.global.namespace}}
spec:
replicas: 1
selector:
matchLabels:
{{.Values.global.controllerComponentLabel}}: linkerd-collector
{{.Values.global.controllerNamespaceLabel}}: {{.Values.global.namespace}}
{{- include "partials.proxy.labels" $tree.Values.global.proxy | nindent 6}}
minReadySeconds: 5
progressDeadlineSeconds: 120
template:
metadata:
annotations:
{{.Values.global.createdByAnnotation}}: {{default (printf "linkerd/helm %s" .Values.global.linkerdVersion) .Values.global.cliVersion}}
{{- include "partials.proxy.annotations" .Values.global.proxy| nindent 8}}
{{- with .Values.global.podAnnotations }}{{ toYaml . | trim | nindent 8 }}{{- end }}
prometheus.io/path: /metrics
prometheus.io/port: "8888"
prometheus.io/scrape: "true"
labels:
{{.Values.global.controllerComponentLabel}}: linkerd-collector
{{.Values.global.controllerNamespaceLabel}}: {{.Values.global.namespace}}
{{.Values.global.workloadNamespaceLabel}}: {{.Values.global.namespace}}
{{- include "partials.proxy.labels" $tree.Values.global.proxy | nindent 8}}
{{- with .Values.global.podLabels }}{{ toYaml . | trim | nindent 8 }}{{- end }}
spec:
containers:
- command:
- /occollector_linux
- --config=/conf/linkerd-collector-config.yaml
env:
- name: GOGC
value: "80"
image: {{.Values.collector.image}}
imagePullPolicy: {{.Values.global.imagePullPolicy}}
livenessProbe:
httpGet:
path: /
port: 13133
name: oc-collector
ports:
- containerPort: 55678
- containerPort: 9411
- containerPort: 14268
readinessProbe:
httpGet:
path: /
port: 13133
{{- if .Values.collector.resources -}}
{{- include "partials.resources" .Values.collector.resources | nindent 8 }}
{{- end }}
volumeMounts:
- mountPath: /conf
name: linkerd-collector-config-val
- {{- include "partials.proxy" $tree | indent 8 | trimPrefix (repeat 7 " ") }}
{{ if not .Values.global.cniEnabled -}}
initContainers:
- {{- include "partials.proxy-init" . | indent 8 | trimPrefix (repeat 7 " ") }}
{{ end -}}
serviceAccountName: linkerd-collector
volumes:
- configMap:
items:
- key: linkerd-collector-config
path: linkerd-collector-config.yaml
name: linkerd-collector-config
name: linkerd-collector-config-val
{{ if .Values.global.controlPlaneTracing -}}
- {{- include "partials.proxy.volumes.labels" . | indent 8 | trimPrefix (repeat 7 " ") }}
{{ end -}}
{{ if not .Values.global.cniEnabled -}}
- {{- include "partials.proxyInit.volumes.xtables" . | indent 8 | trimPrefix (repeat 7 " ") }}
{{ end -}}
- {{- include "partials.proxy.volumes.identity" . | indent 8 | trimPrefix (repeat 7 " ") }}
---
###
### Tracing Jaeger Service
###
---
apiVersion: v1
kind: Service
metadata:
name: linkerd-jaeger
namespace: {{.Values.global.namespace}}
labels:
{{.Values.global.controllerComponentLabel}}: linkerd-jaeger
{{.Values.global.controllerNamespaceLabel}}: {{.Values.global.namespace}}
annotations:
{{.Values.global.createdByAnnotation}}: {{default (printf "linkerd/helm %s" .Values.global.linkerdVersion) .Values.global.cliVersion}}
spec:
type: ClusterIP
selector:
{{.Values.global.controllerComponentLabel}}: linkerd-jaeger
ports:
- name: collection
port: 14268
- name: ui
port: 16686
---
{{- $tree := deepCopy . }}
{{ $_ := set $tree.Values.global.proxy "workloadKind" "deployment" -}}
{{ $_ := set $tree.Values.global.proxy "component" "linkerd-jaeger" -}}
{{ include "linkerd.proxy.validation" $tree.Values.global.proxy -}}
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
{{.Values.global.createdByAnnotation}}: {{default (printf "linkerd/helm %s" .Values.global.linkerdVersion) .Values.global.cliVersion}}
labels:
app.kubernetes.io/name: linkerd-jaeger
app.kubernetes.io/part-of: Linkerd
app.kubernetes.io/version: {{default .Values.global.linkerdVersion .Values.global.controllerImageVersion}}
{{.Values.global.controllerComponentLabel}}: linkerd-jaeger
{{.Values.global.controllerNamespaceLabel}}: {{.Values.global.namespace}}
name: linkerd-jaeger
namespace: {{.Values.global.namespace}}
spec:
replicas: 1
selector:
matchLabels:
{{.Values.global.controllerComponentLabel}}: linkerd-jaeger
{{.Values.global.controllerNamespaceLabel}}: {{.Values.global.namespace}}
{{- include "partials.proxy.labels" $tree.Values.global.proxy | nindent 6}}
template:
metadata:
annotations:
{{.Values.global.createdByAnnotation}}: {{default (printf "linkerd/helm %s" .Values.global.linkerdVersion) .Values.global.cliVersion}}
{{- include "partials.proxy.annotations" .Values.global.proxy| nindent 8}}
{{- with .Values.global.podAnnotations }}{{ toYaml . | trim | nindent 8 }}{{- end }}
prometheus.io/path: /metrics
prometheus.io/port: "8888"
prometheus.io/scrape: "true"
labels:
{{.Values.global.controllerComponentLabel}}: linkerd-jaeger
{{.Values.global.controllerNamespaceLabel}}: {{.Values.global.namespace}}
{{.Values.global.workloadNamespaceLabel}}: {{.Values.global.namespace}}
{{- include "partials.proxy.labels" $tree.Values.global.proxy | nindent 8}}
{{- with .Values.global.podLabels }}{{ toYaml . | trim | nindent 8 }}{{- end }}
spec:
containers:
- args:
- --query.base-path=/jaeger
image: {{.Values.jaeger.image}}
imagePullPolicy: {{.Values.global.imagePullPolicy}}
name: jaeger
ports:
- containerPort: 14268
name: collection
- containerPort: 16686
name: ui
{{- if .Values.jaeger.resources -}}
{{- include "partials.resources" .Values.jaeger.resources | nindent 8 }}
{{- end }}
- {{- include "partials.proxy" $tree | indent 8 | trimPrefix (repeat 7 " ") }}
{{ if not .Values.global.cniEnabled -}}
initContainers:
- {{- include "partials.proxy-init" . | indent 8 | trimPrefix (repeat 7 " ") }}
{{ end -}}
dnsPolicy: ClusterFirst
serviceAccountName: linkerd-jaeger
volumes:
{{ if .Values.global.controlPlaneTracing -}}
- {{- include "partials.proxy.volumes.labels" . | indent 8 | trimPrefix (repeat 7 " ") }}
{{ end -}}
{{ if not .Values.global.cniEnabled -}}
- {{- include "partials.proxyInit.volumes.xtables" . | indent 8 | trimPrefix (repeat 7 " ") }}
{{ end -}}
- {{- include "partials.proxy.volumes.identity" . | indent 8 | trimPrefix (repeat 7 " ") }}