Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

[incubator/jaeger] Improve the Jaeger chart #3109

Merged
merged 8 commits into from
Jan 23, 2018
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions incubator/jaeger/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v1
appVersion: 0.8.0
appVersion: 1.0.0
description: A Jaeger Helm chart for Kubernetes
name: jaeger
version: 0.2.4
version: 0.3.0
keywords:
- jaeger
- opentracing
Expand All @@ -15,3 +15,7 @@ sources:
maintainers:
- name: dvonthenen
email: david.vonthenen@dell.com
- name: mikelorant
email: michael.lorant@fairfaxmedia.com.au
- name: pavelnikolov
email: pavel.nikolov@fairfaxmedia.com.au
142 changes: 86 additions & 56 deletions incubator/jaeger/README.md

Large diffs are not rendered by default.

16 changes: 6 additions & 10 deletions incubator/jaeger/requirements.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
dependencies:
- name: elasticsearch
version: 0.3.0
repository: https://kubernetes-charts-incubator.storage.googleapis.com/
condition: elasticsearch.enable
tags:
- elasticsearch
- name: cassandra
version: 0.1.5
version: ^0.1.6
repository: https://kubernetes-charts-incubator.storage.googleapis.com/
condition: provisionDataStore.cassandra
- name: elasticsearch
version: ^0.4.1
repository: https://kubernetes-charts-incubator.storage.googleapis.com/
condition: cassandra.enable
tags:
- cassandra
condition: provisionDataStore.elasticsearch
2 changes: 1 addition & 1 deletion incubator/jaeger/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ You can log into the Jaeger Query UI here:
echo http://$SERVICE_IP/
{{- else if contains "ClusterIP" .Values.query.service.type }}

export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "jaeger.fullname" . }}-query" -o jsonpath="{.items[0].metadata.name}")
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "release={{ .Release.Name }},component=query" -o jsonpath="{.items[0].metadata.name}")
echo http://127.0.0.1:8080/
kubectl port-forward $POD_NAME 8080:16686
{{- end }}
65 changes: 58 additions & 7 deletions incubator/jaeger/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
{{/* vim: set filetype=mustache: */}}

{{/*
Return the appropriate apiVersion for cronjob APIs.
*/}}
{{- define "cronjob.apiVersion" -}}
{{- if ge .Capabilities.KubeVersion.Minor "8" -}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work once 1.10 is out. Also, this expects alpha features to be enabled for < 1.8. Better use Capabilities.APIVersions.Has.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. I didn't know this was possible! I just learned something new! 🎉

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As for:

Also, this expects alpha features to be enabled for...

This has been documented in the Prerequisites section of the README.md file and the spark cronjob is disabled by default.

"batch/v1beta1"
{{- else -}}
"batch/v2alpha1"
{{- end -}}
{{- end -}}

{{/*
Expand the name of the chart.
*/}}
Expand All @@ -19,6 +31,7 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
{{- end -}}
{{- end -}}

{{/*
Copy link
Collaborator Author

@pavelnikolov pavelnikolov Jan 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This opening comment was missing in the previous PR that got merged. I noticed it while I was resolving conflicts.

Create a fully qualified query name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
Expand All @@ -31,18 +44,56 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
{{- end -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "cassandra.fullname" -}}
{{- define "jaeger.agent.service.name" -}}
{{- $name := default .Chart.Name .Values.agent.service.nameOverride -}}
{{- if .Values.agent.service.nameOverride }}
{{- printf "%s" .Values.agent.service.nameOverride | trunc 63 | trimSuffix "-" }}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end -}}
{{- end -}}

{{- define "cassandra.host" -}}
{{- if .Values.provisionDataStore.cassandra -}}
{{- printf "%s-%s" .Release.Name "cassandra" | trunc 63 | trimSuffix "-" -}}
{{- else }}
{{- .Values.storage.cassandra.host }}
{{- end -}}
{{- end -}}

{{- define "cassandra.contact_points" -}}
{{- $port := .Values.storage.cassandra.port | toString }}
{{- if .Values.provisionDataStore.cassandra -}}
{{- $host := printf "%s-%s" .Release.Name "cassandra" | trunc 63 | trimSuffix "-" -}}
{{- printf "%s:%s" $host $port }}
{{- else }}
{{- printf "%s:%s" .Values.storage.cassandra.host $port }}
{{- end -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "elasticsearch.fullname" -}}
{{- printf "%s-%s" .Release.Name "elasticsearch" | trunc 63 | trimSuffix "-" -}}
{{- define "elasticsearch.client.url" -}}
{{- $port := .Values.storage.elasticsearch.port | toString -}}
{{- if .Values.provisionDataStore.elasticsearch -}}
{{- $host := printf "%s-%s-%s" .Release.Name "elasticsearch" "client" | trunc 63 | trimSuffix "-" -}}
{{- printf "%s://%s:%s" .Values.storage.elasticsearch.scheme $host $port }}
{{- else }}
{{- printf "%s://%s:%s" .Values.storage.elasticsearch.scheme .Values.storage.elasticsearch.host $port }}
{{- end -}}
{{- end -}}

{{- define "jaeger.collector.host-port" -}}
{{- if .Values.agent.collector.host }}
{{- printf "%s:%s" .Values.agent.collector.host (default .Values.collector.service.tchannelPort .Values.agent.collector.port | toString) }}
{{- else }}
{{- printf "%s-collector:%s" (include "jaeger.fullname" .) (default .Values.collector.service.tchannelPort .Values.agent.collector.port | toString) }}
{{- end -}}
{{- end -}}

{{- define "jaeger.hotrod.tracing.host" -}}
{{- $host := printf "%s-agent" (include "jaeger.agent.service.name" .) -}}
{{- default $host .Values.hotrod.tracing.host -}}
{{- end -}}
54 changes: 36 additions & 18 deletions incubator/jaeger/templates/agent-ds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: "{{ template "jaeger.fullname" . }}-agent"
name: {{ template "jaeger.fullname" . }}-agent
labels:
app: "{{ template "jaeger.name" . }}"
app: {{ template "jaeger.name" . }}
jaeger-infra: agent-daemonset
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
component: "agent"
heritage: "{{ .Release.Service }}"
release: "{{ .Release.Name }}"
component: agent
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
{{- if .Values.agent.annotations }}
annotations:
{{ toYaml .Values.agent.annotations | indent 6 }}
{{ toYaml .Values.agent.annotations | indent 4 }}
{{- end }}
spec:
template:
metadata:
labels:
app: "{{ template "jaeger.name" . }}"
component: "agent"
release: "{{ .Release.Name }}"
app: {{ template "jaeger.name" . }}
component: agent
release: {{ .Release.Name }}
jaeger-infra: agent-instance
{{- if .Values.agent.podLabels }}
{{ toYaml .Values.agent.podLabels | indent 8 }}
Expand All @@ -29,22 +29,40 @@ spec:
nodeSelector:
{{ toYaml .Values.agent.nodeSelector | indent 8 }}
containers:
- name: "{{ template "jaeger.fullname" . }}-agent"
image: "{{ .Values.agent.image }}:{{ .Values.agent.tag }}"
- name: {{ template "jaeger.fullname" . }}-agent
image: {{ .Values.agent.image }}:{{ .Values.agent.tag }}
imagePullPolicy: {{ .Values.agent.pullPolicy }}
command:
- "/go/bin/agent-linux"
- "--collector.host-port={{ template "jaeger.fullname" . }}-collector:{{ .Values.collector.service.tchannelPort }}"
{{- range $key, $value := .Values.agent.cmdlineParams }}
- "{{ $value }}"
{{- end }}
env:
- name: COLLECTOR_HOST_PORT
valueFrom:
configMapKeyRef:
name: {{ template "jaeger.fullname" . }}
key: collector.host-port
{{- range $key, $value := .Values.agent.cmdlineParams }}
- name: {{ $key | replace "." "_" | replace "-" "_" | upper | quote }}
value: {{ $value }}
{{- end }}
ports:
- containerPort: {{ .Values.agent.service.zipkinThriftPort }}
protocol: UDP
{{- if .Values.agent.daemonset.useHostPort }}
hostPort: {{ .Values.agent.service.zipkinThriftPort }}
{{- end }}
- containerPort: {{ .Values.agent.service.compactPort }}
protocol: UDP
{{- if .Values.agent.daemonset.useHostPort }}
hostPort: {{ .Values.agent.service.compactPort }}
{{- end }}
- containerPort: {{ .Values.agent.service.binaryPort }}
protocol: UDP
{{- if .Values.agent.daemonset.useHostPort }}
hostPort: {{ .Values.agent.service.binaryPort }}
{{- end }}
- containerPort: {{ .Values.agent.service.samplingPort }}
protocol: TCP
{{- if .Values.agent.daemonset.useHostPort }}
hostPort: {{ .Values.agent.service.samplingPort }}
{{- end }}
resources:
{{ toYaml .Values.agent.resources | indent 10 }}
{{- end -}}
{{- end -}}
28 changes: 16 additions & 12 deletions incubator/jaeger/templates/agent-svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
apiVersion: v1
kind: Service
metadata:
name: "{{ template "jaeger.fullname" . }}-agent"
name: {{ template "jaeger.agent.service.name" . }}-agent
labels:
app: "{{ template "jaeger.name" . }}"
jaeger-infra: {{ .Values.agent.name }}
app: {{ template "jaeger.name" . }}
jaeger-infra: agent-service
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
component: "agent"
heritage: "{{ .Release.Service }}"
release: "{{ .Release.Name }}"
component: agent
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
{{- if .Values.agent.service.annotations }}
annotations:
{{ toYaml .Values.agent.service.annotations | indent 6 }}
{{ toYaml .Values.agent.service.annotations | indent 4 }}
{{- end }}
spec:
ports:
Expand All @@ -28,10 +28,14 @@ spec:
port: {{ .Values.agent.service.binaryPort }}
protocol: UDP
targetPort: {{ .Values.agent.service.binaryPort }}
clusterIP: None
- name: agent-sampling
port: {{ .Values.agent.service.samplingPort }}
protocol: TCP
targetPort: {{ .Values.agent.service.samplingPort }}
type: {{ .Values.agent.service.type }}
selector:
app: "{{ template "jaeger.name" . }}"
component: "agent"
release: "{{ .Release.Name }}"
app: {{ template "jaeger.name" . }}
component: agent
release: {{ .Release.Name }}
jaeger-infra: agent-instance
{{- end -}}
{{- end -}}
90 changes: 33 additions & 57 deletions incubator/jaeger/templates/cassandra-schema-job.yaml
Original file line number Diff line number Diff line change
@@ -1,81 +1,57 @@
{{ if not (empty .Values.cassandra.config.host) }}
{{- if .Values.collector.enabled -}}
{{- if eq .Values.storage.type "cassandra" -}}
apiVersion: batch/v1
kind: Job
metadata:
name: "{{ template "jaeger.fullname" . }}-cassandra-schema"
name: {{ template "jaeger.fullname" . }}-cassandra-schema
labels:
app: "{{ template "jaeger.name" . }}"
app: {{ template "jaeger.name" . }}
jaeger-infra: cassandra-schema-job
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
component: "cassandra-schema"
heritage: "{{ .Release.Service }}"
release: "{{ .Release.Name }}"
component: cassandra-schema
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
{{- if .Values.schema.annotations }}
annotations:
{{ toYaml .Values.schema.annotations | indent 6 }}
{{ toYaml .Values.schema.annotations | indent 4 }}
{{- end }}
spec:
activeDeadlineSeconds: 120
template:
metadata:
name: "{{ template "jaeger.fullname" . }}-cassandra-schema"
name: {{ template "jaeger.fullname" . }}-cassandra-schema
{{- if .Values.schema.podLabels }}
labels:
{{ toYaml .Values.schema.podLabels | indent 8 }}
{{- end }}
spec:
containers:
- name: "{{ template "jaeger.fullname" . }}-cassandra-schema"
image: "{{ .Values.schema.image }}:{{ .Values.schema.tag }}"
- name: {{ template "jaeger.fullname" . }}-cassandra-schema
image: {{ .Values.schema.image }}:{{ .Values.schema.tag }}
imagePullPolicy: {{ .Values.schema.pullPolicy }}
env:
- name: CQLSH_HOST
value: "{{ .Values.cassandra.config.host }}"
- name: MODE
value: "{{ .Values.schema.mode }}"
- name: DATACENTER
value: "{{ .Values.cassandra.config.dc_name }}"
- name: CQLSH_HOST
valueFrom:
configMapKeyRef:
name: {{ template "jaeger.fullname" . }}
key: cassandra.servers
- name: MODE
valueFrom:
configMapKeyRef:
name: {{ template "jaeger.fullname" . }}
key: cassandra.schema.mode
- name: DATACENTER
valueFrom:
configMapKeyRef:
name: {{ template "jaeger.fullname" . }}
key: cassandra.datacenter.name
- name: CASSANDRA_PORT
valueFrom:
configMapKeyRef:
name: {{ template "jaeger.fullname" . }}
key: cassandra.port
resources:
{{ toYaml .Values.schema.resources | indent 10 }}
restartPolicy: OnFailure
{{ else if .Values.tags.cassandra }}
apiVersion: batch/v1
kind: Job
metadata:
name: "{{ template "jaeger.fullname" . }}-cassandra-schema"
labels:
app: "{{ template "jaeger.name" . }}"
jaeger-infra: cassandra-schema-job
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
component: "cassandra-schema"
heritage: "{{ .Release.Service }}"
release: "{{ .Release.Name }}"
{{- if .Values.schema.annotations }}
annotations:
{{ toYaml .Values.schema.annotations | indent 6 }}
{{- end }}
spec:
activeDeadlineSeconds: 120
template:
metadata:
name: "{{ template "jaeger.fullname" . }}-cassandra-schema"
{{- if .Values.schema.podLabels }}
labels:
{{ toYaml .Values.schema.podLabels | indent 8 }}
{{- end }}
spec:
containers:
- name: "{{ template "jaeger.fullname" . }}-cassandra-schema"
image: "{{ .Values.schema.image }}:{{ .Values.schema.tag }}"
imagePullPolicy: {{ .Values.schema.pullPolicy }}
env:
- name: CQLSH_HOST
value: "{{ template "cassandra.fullname" . }}"
- name: MODE
value: "{{ .Values.schema.mode }}"
- name: DATACENTER
value: "{{ .Values.cassandra.config.dc_name }}"
resources:
{{ toYaml .Values.schema.resources | indent 10 }}
restartPolicy: OnFailure
{{ end }}
{{- end -}}
{{- end -}}
Loading