This repository has been archived by the owner on Feb 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16.8k
[incubator/jaeger] Improve the Jaeger chart #3109
Merged
Merged
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
3dcb5a5
[incubator/jaeger] Improve the Jaeger chart
c81d772
Implement ES user/pass in the configMap
853edc6
Allow both existing and provisioned Cassandra
c4d7e89
Use default ES credentials
7424e7e
Run dependencies cronjob 11 mins before EOD
9153093
Remove unused value
0bdc434
Document config values
0febc72
Use .Capabilities.APIVersion.Has
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" -}} | ||
"batch/v1beta1" | ||
{{- else -}} | ||
"batch/v2alpha1" | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
|
@@ -19,6 +31,7 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this | |
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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). | ||
*/}} | ||
|
@@ -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 -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 -}} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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
.There was a problem hiding this comment.
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! 🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As for:
This has been documented in the Prerequisites section of the
README.md
file and the spark cronjob is disabled by default.