diff --git a/charts/virtual-kubelet/templates/deployment.yaml b/charts/virtual-kubelet/templates/deployment.yaml index 961c1d351..8279816c7 100644 --- a/charts/virtual-kubelet/templates/deployment.yaml +++ b/charts/virtual-kubelet/templates/deployment.yaml @@ -14,6 +14,17 @@ spec: checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }} spec: containers: +{{- if eq .Values.trace.exporter "jaeger" }} +{{- with .Values.traceExporters.jaeger }} +{{- if eq .endpoint "" }} + - name: {{ tpl .name $ }} + image: {{ .image.repository}}:{{.image.tag}} + imagePullPolicy: {{ .image.pullPolicy }} + ports: + - containerPort: 16686 +{{- end }} +{{- end }} +{{- end }} - name: {{ template "vk.fullname" . }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} @@ -88,6 +99,16 @@ spec: value: {{ .masterUri }} {{- end }} {{- end }} +{{- end }} +{{- if eq .Values.trace.exporter "jaeger" }} + - name: JAEGER_ENDPOINT +{{- with .Values.traceExporters.jaeger }} +{{- if eq .endpoint "" }} + value: "http://127.0.0.1:14268" +{{- else }} + value: {{.endpoint}} +{{- end }} +{{- end }} {{- end }} volumeMounts: - name: credentials @@ -109,6 +130,16 @@ spec: {{- if .Values.logLevel }} "--log-level", "{{.Values.logLevel}}", {{- end }} +{{- if ne .Values.trace.exporter "" }} + "--trace-exporter", "{{ .Values.trace.exporter }}", +{{- if gt .Values.trace.sampleRate 0.0 }} + "--trace-sample-rate", "{{ .Values.trace.sampleRate }}", +{{- end }} +{{- $serviceName := tpl .Values.trace.serviceName $ }} +{{- if ne $serviceName "" }} + "--trace-service-name", "{{ $serviceName }}", +{{- end}} +{{- end}} "--os", "{{ .Values.nodeOsType }}" ] volumes: diff --git a/charts/virtual-kubelet/values.yaml b/charts/virtual-kubelet/values.yaml index 0f31686a1..4b6cbc79f 100644 --- a/charts/virtual-kubelet/values.yaml +++ b/charts/virtual-kubelet/values.yaml @@ -19,6 +19,20 @@ taint: ## `effect` must be `NoSchedule`, `PreferNoSchedule` or `NoExecute`. effect: NoSchedule +trace: + exporter: "" + serviceName: "{{ .Values.nodeName }}" + sampleRate: 0 + +traceExporters: + jaeger: + name: "{{ .Values.trace.exporter }}" + endpoint: "" + image: + repository: jaegertracing/all-in-one + tag: 1.8 + pullPolicy: Always + providers: azure: ## Set to true if deploying to Azure Kubernetes Service (AKS), otherwise false