[bitnami/jaeger] Add Jaeger chart (#13480)

* Add Jaeger chart

Signed-off-by: Alberto Otero Lorenzo <lorenzoa@vmware.com>
Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com>
Signed-off-by: Javier Salmeron Garcia <jsalmeron@vmware.com>
Signed-off-by: Jose Antonio Carmona <jcarmona@vmware.com>
Co-authored-by: Bitnami Containers <bitnami-bot@vmware.com>
Co-authored-by: Javier Salmeron Garcia <jsalmeron@vmware.com>
Co-authored-by: Jose Antonio Carmona <jcarmona@vmware.com>
This commit is contained in:
Alberto Otero
2022-12-20 11:50:50 +00:00
committed by GitHub
parent 1601a1b831
commit 73307cd8e0
24 changed files with 3114 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
CHART NAME: {{ .Chart.Name }}
CHART VERSION: {{ .Chart.Version }}
APP VERSION: {{ .Chart.AppVersion }}
** Please be patient while the chart is being deployed **
1. Get the application URL by running these commands:
{{- if contains "NodePort" .Values.query.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "common.names.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.query.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "common.names.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ include "jaeger.query.fullname" . }} {{ include "common.names.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo http://$SERVICE_IP:{{ .Values.query.service.ports.api }}
{{- else if contains "ClusterIP" .Values.query.service.type }}
echo "Browse to http://127.0.0.1:8080"
kubectl port-forward svc/{{ include "common.names.fullname" . }} 8080:{{ .Values.query.service.ports.api }} &
{{- end }}
{{- include "common.warnings.rollingTag" .Values.image }}

View File

@@ -0,0 +1,229 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Return the proper jaeger image name
*/}}
{{- define "jaeger.image" -}}
{{ include "common.images.image" (dict "imageRoot" .Values.image "global" .Values.global) }}
{{- end -}}
{{/*
Return the proper cassandra external image name
*/}}
{{- define "jaeger.cqlshImage" -}}
{{ include "common.images.image" (dict "imageRoot" .Values.cqlshImage "global" .Values.global) }}
{{- end -}}
{{/*
Create the name of the query deployment
*/}}
{{- define "jaeger.query.fullname" -}}
{{ printf "%s-query" (include "common.names.fullname" .) }}
{{- end -}}
{{/*
Create a container for checking cassandra availability
*/}}
{{- define "jaeger.waitForDBInitContainer" -}}
- name: jaeger-cassandra-ready-check
image: {{ include "jaeger.cqlshImage" . }}
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
command:
- /bin/bash
args:
- -ec
- |
#!/bin/bash
set -o errexit
set -o nounset
set -o pipefail
. /opt/bitnami/scripts/libos.sh
check_cassandra_keyspace_schema() {
echo "SELECT 1" | cqlsh -u $CASSANDRA_USERNAME -p $CASSANDRA_PASSWORD -e "SELECT COUNT(*) FROM ${CASSANDRA_KEYSPACE}.traces"
}
info "Connecting to the Cassandra instance $CQLSH_HOST:$CQLSH_PORT"
if ! retry_while "check_cassandra_keyspace_schema" 12 30; then
error "Could not connect to the database server"
exit 1
else
info "Connection check success"
fi
env:
- name: CQLSH_HOST
value: {{ include "jaeger.cassandra.host" . }}
- name: BITNAMI_DEBUG
value: {{ ternary "true" "false" .Values.cqlshImage.debug | quote }}
- name: CQLSH_PORT
value: {{ include "jaeger.cassandra.port" . }}
- name: CASSANDRA_USERNAME
value: {{ include "jaeger.cassandra.user" . }}
- name: CASSANDRA_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "jaeger.cassandra.secretName" . }}
key: {{ include "jaeger.cassandra.secretKey" . }}
- name: CASSANDRA_KEYSPACE
value: {{ .Values.cassandra.keyspace }}
{{- end -}}
{{/*
Create the name of the service account to use for the collector
*/}}
{{- define "jaeger.collector.serviceAccountName" -}}
{{- if .Values.collector.serviceAccount.create -}}
{{ default (include "jaeger.collector.fullname" .) .Values.collector.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.collector.serviceAccount.name }}
{{- end -}}
{{- end -}}
{{/*
Create the name of the service account to use for the agent
*/}}
{{- define "jaeger.agent.serviceAccountName" -}}
{{- if .Values.agent.serviceAccount.create -}}
{{ default (include "jaeger.agent.fullname" .) .Values.agent.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.agent.serviceAccount.name }}
{{- end -}}
{{- end -}}
{{/*
Create the name of the service account to use for the query
*/}}
{{- define "jaeger.query.serviceAccountName" -}}
{{- if .Values.query.serviceAccount.create -}}
{{ default (include "jaeger.query.fullname" .) .Values.query.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.query.serviceAccount.name }}
{{- end -}}
{{- end -}}
{{/*
Create the name of the collector deployment
*/}}
{{- define "jaeger.collector.fullname" -}}
{{ printf "%s-collector" (include "common.names.fullname" .) }}
{{- end -}}
{{/*
Create the name of the collector deployment. This name includes 2 hyphens due to
an issue about env vars collision with the chart name when the release name is set to just 'jaeger'
ref. https://github.com/jaegertracing/jaeger-operator/issues/1158
*/}}
{{- define "jaeger.agent.fullname" -}}
{{ printf "%s--agent" (include "common.names.fullname" .) }}
{{- end -}}
{{/*
Create the cassandra secret name
*/}}
{{- define "jaeger.cassandra.secretName" -}}
{{- if not .Values.cassandra.enabled -}}
{{- .Values.externalDatabase.existingSecret -}}
{{- else -}}
{{- printf "%s-cassandra" (include "common.names.fullname" .) -}}
{{- end -}}
{{- end -}}
{{/*
Create the cassandra secret key
*/}}
{{- define "jaeger.cassandra.secretKey" -}}
{{- if not .Values.cassandra.enabled -}}
{{- .Values.externalDatabase.existingSecretPasswordKey -}}
{{- else -}}
cassandra-password
{{- end -}}
{{- end -}}
{{/*
Create the cassandra user
*/}}
{{- define "jaeger.cassandra.user" -}}
{{- if not .Values.cassandra.enabled -}}
{{- .Values.externalDatabase.dbUser.user | quote -}}
{{- else -}}
{{- .Values.cassandra.dbUser.user | quote -}}
{{- end -}}
{{- end -}}
{{/*
Create the cassandra host
*/}}
{{- define "jaeger.cassandra.host" -}}
{{- if not .Values.cassandra.enabled -}}
{{- .Values.externalDatabase.host | quote -}}
{{- else -}}
{{- include "common.names.dependency.fullname" (dict "chartName" "cassandra" "chartValues" .Values.cassandra "context" $) -}}
{{- end }}
{{- end }}
{{/*
Create the cassandra port
*/}}
{{- define "jaeger.cassandra.port" -}}
{{- if not .Values.cassandra.enabled -}}
{{- .Values.externalDatabase.port | quote -}}
{{- else }}
{{- .Values.cassandra.service.ports.cql | quote -}}
{{- end -}}
{{- end -}}
{{/*
Create the cassandra datacenter
*/}}
{{- define "jaeger.cassandra.datacenter" -}}
{{- if not .Values.cassandra.enabled -}}
{{- .Values.externalDatabase.cluster.datacenter | quote -}}
{{- else }}
{{- .Values.cassandra.cluster.datacenter | quote -}}
{{- end -}}
{{- end -}}
{{/*
Create the cassandra keyspace
*/}}
{{- define "jaeger.cassandra.keyspace" -}}
{{- if not .Values.cassandra.enabled -}}
{{- .Values.externalDatabase.keyspace | quote -}}
{{- else }}
{{- .Values.cassandra.keyspace | quote -}}
{{- end -}}
{{- end -}}
{{/*
Compile all warnings into a single message.
*/}}
{{- define "jaeger.validateValues" -}}
{{- $messages := list -}}
{{- $messages := append $messages (include "jaeger.validateValues.cassandra" .) -}}
{{- $messages := without $messages "" -}}
{{- $message := join "\n" $messages -}}
{{- if $message -}}
{{- printf "\nVALUES VALIDATION:\n%s" $message -}}
{{- end -}}
{{- end -}}
{{/* Validate values of jaeger - Cassandra */}}
{{- define "jaeger.validateValues.cassandra" -}}
{{- if and .Values.cassandra.enabled .Values.externalDatabase.host -}}
jaeger: Cassandra
You can only use one database.
Please choose installing a Cassandra chart (--set cassandra.enabled=true) or
using an external database (--set externalDatabase.host)
{{- end -}}
{{- if and (not .Values.cassandra.enabled) (not .Values.externalDatabase.host) -}}
jaeger: Cassandra
You did not set any database.
Please choose installing a Cassandra chart (--set mongodb.enabled=true) or
using an external database (--set externalDatabase.host)
{{- end -}}
{{- end -}}

View File

@@ -0,0 +1,179 @@
apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }}
kind: Deployment
metadata:
name: {{ include "jaeger.agent.fullname" . }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
app.kubernetes.io/part-of: jaeger
app.kubernetes.io/component: agent
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
selector:
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
replicas: {{ .Values.agent.replicaCount }}
{{- if .Values.agent.updateStrategy }}
strategy: {{- toYaml .Values.agent.updateStrategy | nindent 4 }}
{{- end }}
template:
metadata:
labels: {{- include "common.labels.standard" . | nindent 8 }}
app.kubernetes.io/part-of: jaeger
app.kubernetes.io/component: agent
{{- if .Values.agent.podLabels }}
{{- include "common.tplvalues.render" (dict "value" .Values.agent.podLabels "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.agent.podAnnotations }}
annotations:
{{- if .Values.agent.podAnnotations }}
{{- include "common.tplvalues.render" (dict "value" .Values.agent.podAnnotations "context" $) | nindent 8 }}
{{- end }}
{{- end }}
spec:
{{- if .Values.agent.schedulerName }}
schedulerName: {{ .Values.agent.schedulerName }}
{{- end }}
priorityClassName: {{ .Values.agent.priorityClassName | quote }}
{{- if .Values.agent.affinity }}
affinity: {{- include "common.tplvalues.render" (dict "value" .Values.agent.affinity "context" $) | nindent 8 }}
{{- else }}
affinity:
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.agent.podAffinityPreset "component" "agent" "context" $) | nindent 10 }}
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.agent.podAntiAffinityPreset "component" "agent" "context" $) | nindent 10 }}
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.agent.nodeAffinityPreset.type "key" .Values.agent.nodeAffinityPreset.key "values" .Values.agent.nodeAffinityPreset.values) | nindent 10 }}
{{- end }}
{{- if .Values.agent.podSecurityContext.enabled }}
securityContext: {{- omit .Values.agent.podSecurityContext "enabled" | toYaml | nindent 8 }}
{{- end }}
{{- if .Values.agent.nodeSelector }}
nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.agent.nodeSelector "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.agent.tolerations }}
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.agent.tolerations "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.agent.topologySpreadConstraints }}
topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.agent.topologySpreadConstraints "context" $) | nindent 8 }}
{{- end }}
initContainers:
{{- include "jaeger.waitForDBInitContainer" . | nindent 8 }}
{{- if .Values.agent.initContainers }}
{{- include "common.tplvalues.render" (dict "value" .Values.agent.initContainers "context" $) | nindent 8 }}
{{- end }}
containers:
- name: jaeger-agent
image: {{ include "jaeger.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
{{- if .Values.agent.containerSecurityContext.enabled }}
securityContext: {{- omit .Values.agent.containerSecurityContext "enabled" | toYaml | nindent 12 }}
{{- end }}
{{- if .Values.diagnosticMode.enabled }}
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }}
{{- else if .Values.agent.command }}
command: {{- include "common.tplvalues.render" (dict "value" .Values.agent.command "context" $) | nindent 12 }}
{{- else }}
command: ["/opt/bitnami/jaeger/bin/jaeger-agent"]
{{- end }}
{{- if .Values.diagnosticMode.enabled }}
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }}
{{- else if .Values.agent.args }}
args: {{- include "common.tplvalues.render" (dict "value" .Values.agent.args "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.agent.lifecycleHooks }}
lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.agent.lifecycleHooks "context" $) | nindent 12 }}
{{- end }}
ports:
- name: binary
containerPort: {{ .Values.agent.containerPorts.binary }}
- name: zipkin
containerPort: {{ .Values.agent.containerPorts.zipkin }}
- name: admin
containerPort: {{ .Values.agent.containerPorts.admin }}
- name: compact
containerPort: {{ .Values.agent.containerPorts.compact }}
- name: config
containerPort: {{ .Values.agent.containerPorts.config }}
env:
- name: CASSANDRA_SERVERS
value: {{ include "jaeger.cassandra.host" . }}
- name: CASSANDRA_PORT
value: {{ include "jaeger.cassandra.port" . }}
- name: CASSANDRA_USERNAME
value: {{ include "jaeger.cassandra.user" . }}
- name: CASSANDRA_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "jaeger.cassandra.secretName" . }}
key: {{ include "jaeger.cassandra.secretKey" . }}
- name: CASSANDRA_KEYSPACE
value: {{ include "jaeger.cassandra.keyspace" . }}
- name: CASSANDRA_DATACENTER
value: {{ include "jaeger.cassandra.datacenter" . }}
- name: HTTP_SERVER_HOST_PORT
value: {{ printf ":%v" .Values.agent.containerPorts.config | quote }}
- name: PROCESSOR_JAEGER_BINARY_SERVER_HOST_PORT
value: {{ printf ":%v" .Values.agent.containerPorts.binary | quote }}
- name: PROCESSOR_JAEGER_COMPACT_SERVER_HOST_PORT
value: {{ printf ":%v" .Values.agent.containerPorts.compact | quote }}
- name: PROCESSOR_ZIPKIN_COMPACT_SERVER_HOST_PORT
value: {{ printf ":%v" .Values.agent.containerPorts.zipkin | quote }}
- name: ADMIN_HTTP_HOST_PORT
value: {{ printf ":%v" .Values.agent.containerPorts.admin | quote }}
- name: REPORTER_GRPC_HOST_PORT
value: {{ printf "%s:%d" (include "jaeger.collector.fullname" .) (int .Values.collector.service.ports.grpc) }}
- name: BITNAMI_DEBUG
value: {{ ternary "true" "false" .Values.image.debug | quote }}
{{- if .Values.agent.extraEnvVars }}
{{- include "common.tplvalues.render" (dict "value" .Values.agent.extraEnvVars "context" $) | nindent 12 }}
{{- end }}
envFrom:
{{- if .Values.agent.extraEnvVarsCM }}
- configMapRef:
name: {{ .Values.agent.extraEnvVarsCM }}
{{- end }}
{{- if .Values.agent.extraEnvVarsSecret }}
- secretRef:
name: {{ .Values.agent.extraEnvVarsSecret }}
{{- end }}
{{- if not .Values.diagnosticMode.enabled }}
{{- if .Values.agent.customStartupProbe }}
startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.agent.customStartupProbe "context" $) | nindent 12 }}
{{- else if .Values.agent.startupProbe.enabled }}
startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.agent.startupProbe "enabled") "context" $) | nindent 12 }}
httpGet:
path: /
port: admin
{{- end }}
{{- if .Values.agent.customLivenessProbe }}
livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.agent.customLivenessProbe "context" $) | nindent 12 }}
{{- else if .Values.agent.livenessProbe.enabled }}
livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.agent.livenessProbe "enabled") "context" $) | nindent 12 }}
httpGet:
path: /
port: admin
{{- end }}
{{- if .Values.agent.customReadinessProbe }}
readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.agent.customReadinessProbe "context" $) | nindent 12 }}
{{- else if .Values.agent.readinessProbe.enabled }}
readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.agent.readinessProbe "enabled") "context" $) | nindent 12 }}
httpGet:
path: /
port: admin
{{- end }}
{{- end }}
{{- if .Values.query.resources }}
resources: {{- toYaml .Values.agent.resources | nindent 12 }}
{{- end }}
{{- if .Values.agent.extraVolumeMounts }}
{{- include "common.tplvalues.render" ( dict "value" .Values.agent.extraVolumeMounts "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.agent.sidecars }}
{{- include "common.tplvalues.render" ( dict "value" .Values.agent.sidecars "context" $) | nindent 8 }}
{{- end }}
volumes:
{{- if .Values.agent.extraVolumes }}
{{- include "common.tplvalues.render" ( dict "value" .Values.agent.extraVolumes "context" $) | nindent 8 }}
{{- end }}

View File

@@ -0,0 +1,88 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "jaeger.agent.fullname" . }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/part-of: jaeger
app.kubernetes.io/component: agent
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if or .Values.agent.service.annotations .Values.commonAnnotations }}
annotations:
{{- if .Values.agent.service.annotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.agent.service.annotations "context" $) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
{{- include "common.tplvalues.render" ( dict "value" .Values.agent.service.metrics.annotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.agent.service.type }}
{{- if and (eq .Values.agent.service.type "LoadBalancer") (not (empty .Values.agent.service.loadBalancerIP)) }}
loadBalancerIP: {{ .Values.agent.service.loadBalancerIP }}
{{- end }}
{{- if and (eq .Values.agent.service.type "LoadBalancer") (not (empty .Values.agent.service.loadBalancerSourceRanges)) }}
loadBalancerSourceRanges: {{ .Values.agent.service.loadBalancerSourceRanges }}
{{- end }}
{{- if and .Values.agent.service.clusterIP (eq .Values.agent.service.type "ClusterIP") }}
clusterIP: {{ .Values.agent.service.clusterIP }}
{{- end }}
{{- if .Values.agent.service.sessionAffinity }}
sessionAffinity: {{ .Values.agent.service.sessionAffinity }}
{{- end }}
{{- if .Values.agent.service.sessionAffinityConfig }}
sessionAffinityConfig: {{- include "common.tplvalues.render" (dict "value" .Values.agent.service.sessionAffinityConfig "context" $) | nindent 4 }}
{{- end }}
{{- if or (eq .Values.agent.service.type "LoadBalancer") (eq .Values.agent.service.type "NodePort") }}
externalTrafficPolicy: {{ .Values.agent.service.externalTrafficPolicy | quote }}
{{- end }}
ports:
- name: compact
port: {{ .Values.agent.service.ports.compact }}
targetPort: {{ .Values.agent.containerPorts.compact }}
{{- if and (or (eq .Values.agent.service.type "NodePort") (eq .Values.agent.service.type "LoadBalancer")) (not (empty .Values.agent.service.nodePorts.compact)) }}
nodePort: {{ .Values.agent.service.nodePorts.compact }}
{{- else if eq .Values.agent.service.type "ClusterIP" }}
nodePort: null
{{- end }}
- name: binary
port: {{ .Values.agent.service.ports.binary }}
targetPort: {{ .Values.agent.containerPorts.binary }}
{{- if and (or (eq .Values.agent.service.type "NodePort") (eq .Values.agent.service.type "LoadBalancer")) (not (empty .Values.agent.service.nodePorts.binary)) }}
nodePort: {{ .Values.agent.service.nodePorts.binary }}
{{- else if eq .Values.agent.service.type "ClusterIP" }}
nodePort: null
{{- end }}
- name: config
port: {{ .Values.agent.service.ports.config }}
targetPort: {{ .Values.agent.containerPorts.config }}
{{- if and (or (eq .Values.agent.service.type "NodePort") (eq .Values.agent.service.type "LoadBalancer")) (not (empty .Values.agent.service.nodePorts.config)) }}
nodePort: {{ .Values.agent.service.nodePorts.config }}
{{- else if eq .Values.agent.service.type "ClusterIP" }}
nodePort: null
{{- end }}
- name: zipkin
port: {{ .Values.agent.service.ports.zipkin }}
targetPort: {{ .Values.agent.containerPorts.zipkin }}
{{- if and (or (eq .Values.agent.service.type "NodePort") (eq .Values.agent.service.type "LoadBalancer")) (not (empty .Values.agent.service.nodePorts.zipkin)) }}
nodePort: {{ .Values.agent.service.nodePorts.zipkin }}
{{- else if eq .Values.agent.service.type "ClusterIP" }}
nodePort: null
{{- end }}
- name: admin
port: {{ .Values.agent.service.ports.admin }}
targetPort: {{ .Values.agent.containerPorts.admin }}
{{- if and (or (eq .Values.agent.service.type "NodePort") (eq .Values.agent.service.type "LoadBalancer")) (not (empty .Values.agent.service.nodePorts.admin)) }}
nodePort: {{ .Values.agent.service.nodePorts.admin }}
{{- else if eq .Values.agent.service.type "ClusterIP" }}
nodePort: null
{{- end }}
{{- if .Values.agent.service.extraPorts }}
{{- include "common.tplvalues.render" (dict "value" .Values.agent.service.extraPorts "context" $) | nindent 4 }}
{{- end }}
selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
app.kubernetes.io/part-of: jaeger
app.kubernetes.io/component: agent

View File

@@ -0,0 +1,21 @@
{{- if .Values.agent.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "jaeger.agent.serviceAccountName" . }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/part-of: jaeger
app.kubernetes.io/component: agent
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
annotations:
{{- if .Values.commonAnnotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.agent.serviceAccount.annotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.agent.serviceAccount.annotations "context" $ ) | nindent 4 }}
{{- end }}
automountServiceAccountToken: {{ .Values.agent.serviceAccount.automountServiceAccountToken }}
{{- end }}

View File

@@ -0,0 +1,173 @@
apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }}
kind: Deployment
metadata:
name: {{ include "jaeger.collector.fullname" . }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
app.kubernetes.io/part-of: jaeger
app.kubernetes.io/component: collector
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
selector:
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
replicas: {{ .Values.collector.replicaCount }}
{{- if .Values.collector.updateStrategy }}
strategy: {{- toYaml .Values.collector.updateStrategy | nindent 4 }}
{{- end }}
template:
metadata:
labels: {{- include "common.labels.standard" . | nindent 8 }}
app.kubernetes.io/part-of: jaeger
app.kubernetes.io/component: collector
{{- if .Values.collector.podLabels }}
{{- include "common.tplvalues.render" (dict "value" .Values.collector.podLabels "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.collector.podAnnotations }}
annotations:
{{- if .Values.collector.podAnnotations }}
{{- include "common.tplvalues.render" (dict "value" .Values.collector.podAnnotations "context" $) | nindent 8 }}
{{- end }}
{{- end }}
spec:
{{- if .Values.collector.schedulerName }}
schedulerName: {{ .Values.collector.schedulerName }}
{{- end }}
priorityClassName: {{ .Values.collector.priorityClassName | quote }}
{{- if .Values.collector.affinity }}
affinity: {{- include "common.tplvalues.render" (dict "value" .Values.collector.affinity "context" $) | nindent 8 }}
{{- else }}
affinity:
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.collector.podAffinityPreset "component" "collector" "context" $) | nindent 10 }}
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.collector.podAntiAffinityPreset "component" "collector" "context" $) | nindent 10 }}
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.collector.nodeAffinityPreset.type "key" .Values.collector.nodeAffinityPreset.key "values" .Values.collector.nodeAffinityPreset.values) | nindent 10 }}
{{- end }}
{{- if .Values.collector.podSecurityContext.enabled }}
securityContext: {{- omit .Values.collector.podSecurityContext "enabled" | toYaml | nindent 8 }}
{{- end }}
{{- if .Values.collector.nodeSelector }}
nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.collector.nodeSelector "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.collector.tolerations }}
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.collector.tolerations "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.collector.topologySpreadConstraints }}
topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.collector.topologySpreadConstraints "context" $) | nindent 8 }}
{{- end }}
initContainers:
{{- include "jaeger.waitForDBInitContainer" . | nindent 8 }}
{{- if .Values.collector.initContainers }}
{{- include "common.tplvalues.render" (dict "value" .Values.collector.initContainers "context" $) | nindent 8 }}
{{- end }}
containers:
- name: jaeger-collector
image: {{ include "jaeger.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
{{- if .Values.collector.containerSecurityContext.enabled }}
securityContext: {{- omit .Values.collector.containerSecurityContext "enabled" | toYaml | nindent 12 }}
{{- end }}
{{- if .Values.diagnosticMode.enabled }}
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }}
{{- else if .Values.collector.command }}
command: {{- include "common.tplvalues.render" (dict "value" .Values.collector.command "context" $) | nindent 12 }}
{{- else }}
command: ["/opt/bitnami/jaeger/bin/jaeger-collector"]
{{- end }}
{{- if .Values.diagnosticMode.enabled }}
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }}
{{- else if .Values.collector.args }}
args: {{- include "common.tplvalues.render" (dict "value" .Values.collector.args "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.collector.lifecycleHooks }}
lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.collector.lifecycleHooks "context" $) | nindent 12 }}
{{- end }}
ports:
- name: zipkin
containerPort: {{ .Values.collector.containerPorts.zipkin }}
- name: binary
containerPort: {{ .Values.collector.containerPorts.binary }}
- name: grpc
containerPort: {{ .Values.collector.containerPorts.grpc }}
- name: admin
containerPort: {{ .Values.collector.containerPorts.admin }}
env:
- name: CASSANDRA_SERVERS
value: {{ include "jaeger.cassandra.host" . }}
- name: CASSANDRA_PORT
value: {{ include "jaeger.cassandra.port" . }}
- name: CASSANDRA_USERNAME
value: {{ include "jaeger.cassandra.user" . }}
- name: CASSANDRA_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "jaeger.cassandra.secretName" . }}
key: {{ include "jaeger.cassandra.secretKey" . }}
- name: CASSANDRA_KEYSPACE
value: {{ include "jaeger.cassandra.keyspace" . }}
- name: CASSANDRA_DATACENTER
value: {{ include "jaeger.cassandra.datacenter" . }}
- name: ADMIN_HTTP_HOST_PORT
value: {{ printf ":%v" .Values.collector.containerPorts.admin | quote }}
- name: COLLECTOR_ZIPKIN_HOST_PORT
value: {{ printf ":%v" .Values.collector.containerPorts.zipkin | quote }}
- name: COLLECTOR_GRPC_SERVER_HOST_PORT
value: {{ printf ":%v" .Values.collector.containerPorts.grpc | quote }}
- name: COLLECTOR_HTTP_SERVER_HOST_PORT
value: {{ printf ":%v" .Values.collector.containerPorts.binary | quote }}
- name: BITNAMI_DEBUG
value: {{ ternary "true" "false" .Values.image.debug | quote }}
{{- if .Values.collector.extraEnvVars }}
{{- include "common.tplvalues.render" (dict "value" .Values.collector.extraEnvVars "context" $) | nindent 12 }}
{{- end }}
envFrom:
{{- if .Values.collector.extraEnvVarsCM }}
- configMapRef:
name: {{ .Values.collector.extraEnvVarsCM }}
{{- end }}
{{- if .Values.collector.extraEnvVarsSecret }}
- secretRef:
name: {{ .Values.collector.extraEnvVarsSecret }}
{{- end }}
{{- if not .Values.diagnosticMode.enabled }}
{{- if .Values.collector.customStartupProbe }}
startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.collector.customStartupProbe "context" $) | nindent 12 }}
{{- else if .Values.collector.startupProbe.enabled }}
startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.collector.startupProbe "enabled") "context" $) | nindent 12 }}
httpGet:
path: /
port: admin
{{- end }}
{{- if .Values.collector.customLivenessProbe }}
livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.collector.customLivenessProbe "context" $) | nindent 12 }}
{{- else if .Values.collector.livenessProbe.enabled }}
livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.collector.livenessProbe "enabled") "context" $) | nindent 12 }}
httpGet:
path: /
port: admin
{{- end }}
{{- if .Values.collector.customReadinessProbe }}
readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.collector.customReadinessProbe "context" $) | nindent 12 }}
{{- else if .Values.collector.readinessProbe.enabled }}
readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.collector.readinessProbe "enabled") "context" $) | nindent 12 }}
httpGet:
path: /
port: admin
{{- end }}
{{- end }}
{{- if .Values.query.resources }}
resources: {{- toYaml .Values.collector.resources | nindent 12 }}
{{- end }}
{{- if .Values.collector.extraVolumeMounts }}
{{- include "common.tplvalues.render" ( dict "value" .Values.collector.extraVolumeMounts "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.collector.sidecars }}
{{- include "common.tplvalues.render" ( dict "value" .Values.collector.sidecars "context" $) | nindent 8 }}
{{- end }}
volumes:
{{- if .Values.collector.extraVolumes }}
{{- include "common.tplvalues.render" ( dict "value" .Values.collector.extraVolumes "context" $) | nindent 8 }}
{{- end }}

View File

@@ -0,0 +1,80 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "jaeger.collector.fullname" . }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/part-of: jaeger
app.kubernetes.io/component: collector
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if or .Values.collector.service.annotations .Values.commonAnnotations }}
annotations:
{{- if .Values.collector.service.annotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.collector.service.annotations "context" $) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
{{- include "common.tplvalues.render" ( dict "value" .Values.collector.service.metrics.annotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.collector.service.type }}
{{- if and (eq .Values.collector.service.type "LoadBalancer") (not (empty .Values.collector.service.loadBalancerIP)) }}
loadBalancerIP: {{ .Values.collector.service.loadBalancerIP }}
{{- end }}
{{- if and (eq .Values.collector.service.type "LoadBalancer") (not (empty .Values.collector.service.loadBalancerSourceRanges)) }}
loadBalancerSourceRanges: {{ .Values.collector.service.loadBalancerSourceRanges }}
{{- end }}
{{- if and .Values.collector.service.clusterIP (eq .Values.collector.service.type "ClusterIP") }}
clusterIP: {{ .Values.collector.service.clusterIP }}
{{- end }}
{{- if .Values.collector.service.sessionAffinity }}
sessionAffinity: {{ .Values.collector.service.sessionAffinity }}
{{- end }}
{{- if .Values.collector.service.sessionAffinityConfig }}
sessionAffinityConfig: {{- include "common.tplvalues.render" (dict "value" .Values.collector.service.sessionAffinityConfig "context" $) | nindent 4 }}
{{- end }}
{{- if or (eq .Values.collector.service.type "LoadBalancer") (eq .Values.collector.service.type "NodePort") }}
externalTrafficPolicy: {{ .Values.collector.service.externalTrafficPolicy | quote }}
{{- end }}
ports:
- name: grpc
port: {{ .Values.collector.service.ports.grpc }}
targetPort: {{ .Values.collector.containerPorts.grpc }}
{{- if and (or (eq .Values.collector.service.type "NodePort") (eq .Values.collector.service.type "LoadBalancer")) (not (empty .Values.collector.service.nodePorts.grpc)) }}
nodePort: {{ .Values.collector.service.nodePorts.grpc }}
{{- else if eq .Values.collector.service.type "ClusterIP" }}
nodePort: null
{{- end }}
- name: binary
port: {{ .Values.collector.service.ports.binary }}
targetPort: {{ .Values.collector.containerPorts.binary }}
{{- if and (or (eq .Values.collector.service.type "NodePort") (eq .Values.collector.service.type "LoadBalancer")) (not (empty .Values.collector.service.nodePorts.binary)) }}
nodePort: {{ .Values.collector.service.nodePorts.binary }}
{{- else if eq .Values.collector.service.type "ClusterIP" }}
nodePort: null
{{- end }}
- name: zipkin
port: {{ .Values.collector.service.ports.zipkin }}
targetPort: {{ .Values.collector.containerPorts.zipkin }}
{{- if and (or (eq .Values.collector.service.type "NodePort") (eq .Values.collector.service.type "LoadBalancer")) (not (empty .Values.collector.service.nodePorts.zipkin)) }}
nodePort: {{ .Values.collector.service.nodePorts.zipkin }}
{{- else if eq .Values.collector.service.type "ClusterIP" }}
nodePort: null
{{- end }}
- name: admin
port: {{ .Values.collector.service.ports.admin }}
targetPort: {{ .Values.collector.containerPorts.admin }}
{{- if and (or (eq .Values.collector.service.type "NodePort") (eq .Values.collector.service.type "LoadBalancer")) (not (empty .Values.collector.service.nodePorts.admin)) }}
nodePort: {{ .Values.collector.service.nodePorts.admin }}
{{- else if eq .Values.collector.service.type "ClusterIP" }}
nodePort: null
{{- end }}
{{- if .Values.collector.service.extraPorts }}
{{- include "common.tplvalues.render" (dict "value" .Values.collector.service.extraPorts "context" $) | nindent 4 }}
{{- end }}
selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
app.kubernetes.io/part-of: jaeger
app.kubernetes.io/component: collector

View File

@@ -0,0 +1,21 @@
{{- if .Values.collector.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "jaeger.collector.serviceAccountName" . }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/part-of: jaeger
app.kubernetes.io/component: collector
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
annotations:
{{- if .Values.commonAnnotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.collector.serviceAccount.annotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.collector.serviceAccount.annotations "context" $ ) | nindent 4 }}
{{- end }}
automountServiceAccountToken: {{ .Values.collector.serviceAccount.automountServiceAccountToken }}
{{- end }}

View File

@@ -0,0 +1,115 @@
apiVersion: batch/v1
kind: Job
metadata:
name: {{ include "common.names.fullname" . }}-migrate
namespace: {{ .Release.Namespace }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: migration
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.migration.annotations "context" $ ) | nindent 4 }}
{{- if .Values.commonAnnotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
ttlSecondsAfterFinished: 30
template:
metadata:
labels: {{- include "common.labels.standard" . | nindent 8 }}
app.kubernetes.io/component: migration
{{- if .Values.migration.podLabels }}
{{- include "common.tplvalues.render" (dict "value" .Values.migration.podLabels "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.migration.podAnnotations }}
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.migration.podAnnotations "context" $) | nindent 8 }}
{{- end }}
spec:
restartPolicy: OnFailure
{{- if .Values.migration.podSecurityContext.enabled }}
securityContext: {{- omit .Values.migration.podSecurityContext "enabled" | toYaml | nindent 8 }}
{{- end }}
initContainers:
- name: jaeger-cassandra-schema-grabber
image: {{ include "jaeger.image" . }}
command: [ "cp", "-T", "-r", "/opt/bitnami/jaeger/cassandra-schema", "/cassandra-schema/" ]
volumeMounts:
- name: cassandra-schema
mountPath: "/cassandra-schema"
containers:
- name: jaeger-cassandra-migrator
image: {{ include "jaeger.cqlshImage" . }}
command:
- /bin/bash
args:
- -ec
- |
#!/bin/bash
set -o errexit
set -o nounset
set -o pipefail
. /opt/bitnami/scripts/libos.sh
check_cassandra_connection() {
echo "SELECT 1" | cqlsh -u $CASSANDRA_USERNAME -p $CASSANDRA_PASSWORD -e "QUIT"
}
info "Connecting to the Cassandra instance $CQLSH_HOST:$CQLSH_PORT"
if ! retry_while "check_cassandra_connection" 12 30; then
error "Could not connect to the database server"
exit 1
else
info "Connection check success"
sed -i 's/cqlsh -e "show version"/cqlsh -e "show version" -u $CASSANDRA_USERNAME -p $CASSANDRA_PASSWORD /' /cassandra-schema/create.sh
/cassandra-schema/docker.sh
fi
env:
- name: CQLSH
value: /opt/bitnami/cassandra/bin/cqlsh
- name: CQLSH_HOST
value: {{ include "jaeger.cassandra.host" . }}
- name: CQLSH_PORT
value: {{ include "jaeger.cassandra.port" . }}
- name: CASSANDRA_USERNAME
value: {{ include "jaeger.cassandra.user" . }}
- name: DATACENTER
value: {{ include "jaeger.cassandra.datacenter" . }}
- name: KEYSPACE
value: {{ include "jaeger.cassandra.keyspace" . }}
- name: CASSANDRA_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "jaeger.cassandra.secretName" . }}
key: {{ include "jaeger.cassandra.secretKey" . }}
{{- if or .Values.migration.extraEnvVarsCM .Values.migration.extraEnvVarsSecret }}
envFrom:
{{- if .Values.migration.extraEnvVarsCM }}
- configMapRef:
name: {{ .Values.migration.extraEnvVarsCM }}
{{- end }}
{{- if .Values.migration.extraEnvVarsSecret }}
- secretRef:
name: {{ .Values.migration.extraEnvVarsSecret }}
{{- end }}
{{- end }}
{{- if .Values.migration.extraEnvVars }}
{{- include "common.tplvalues.render" (dict "value" .Values.migration.extraEnvVars "context" $) | nindent 12 }}
{{- end }}
volumeMounts:
- name: cassandra-schema
mountPath: "/cassandra-schema"
{{- if .Values.migration.extraVolumeMounts }}
{{- include "common.tplvalues.render" (dict "value" .Values.migration.extraVolumeMounts "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.migration.resources }}
resources: {{- toYaml .Values.migration.resources | nindent 12 }}
{{- end }}
volumes:
- name: cassandra-schema
emptyDir: {}
{{- if .Values.migration.extraVolumes }}
{{- include "common.tplvalues.render" (dict "value" .Values.migration.extraVolumes "context" $) | nindent 6 }}
{{- end }}

View File

@@ -0,0 +1,165 @@
apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }}
kind: Deployment
metadata:
name: {{ include "jaeger.query.fullname" . }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
app.kubernetes.io/part-of: jaeger
app.kubernetes.io/component: query
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
selector:
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
replicas: {{ .Values.query.replicaCount }}
{{- if .Values.query.updateStrategy }}
strategy: {{- toYaml .Values.query.updateStrategy | nindent 4 }}
{{- end }}
template:
metadata:
labels: {{- include "common.labels.standard" . | nindent 8 }}
app.kubernetes.io/part-of: jaeger
app.kubernetes.io/component: query
{{- if .Values.query.podLabels }}
{{- include "common.tplvalues.render" (dict "value" .Values.query.podLabels "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.query.podAnnotations }}
annotations:
{{- if .Values.query.podAnnotations }}
{{- include "common.tplvalues.render" (dict "value" .Values.query.podAnnotations "context" $) | nindent 8 }}
{{- end }}
{{- end }}
spec:
{{- if .Values.query.schedulerName }}
schedulerName: {{ .Values.query.schedulerName }}
{{- end }}
priorityClassName: {{ .Values.query.priorityClassName | quote }}
{{- if .Values.query.affinity }}
affinity: {{- include "common.tplvalues.render" (dict "value" .Values.query.affinity "context" $) | nindent 8 }}
{{- else }}
affinity:
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.query.podAffinityPreset "component" "query" "context" $) | nindent 10 }}
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.query.podAntiAffinityPreset "component" "query" "context" $) | nindent 10 }}
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.query.nodeAffinityPreset.type "key" .Values.query.nodeAffinityPreset.key "values" .Values.query.nodeAffinityPreset.values) | nindent 10 }}
{{- end }}
{{- if .Values.query.podSecurityContext.enabled }}
securityContext: {{- omit .Values.query.podSecurityContext "enabled" | toYaml | nindent 8 }}
{{- end }}
{{- if .Values.query.nodeSelector }}
nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.query.nodeSelector "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.query.tolerations }}
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.query.tolerations "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.query.topologySpreadConstraints }}
topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.query.topologySpreadConstraints "context" $) | nindent 8 }}
{{- end }}
initContainers:
{{- include "jaeger.waitForDBInitContainer" . | nindent 8 }}
{{- if .Values.query.initContainers }}
{{- include "common.tplvalues.render" (dict "value" .Values.query.initContainers "context" $) | nindent 8 }}
{{- end }}
containers:
- name: jaeger-query
image: {{ include "jaeger.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
{{- if .Values.query.containerSecurityContext.enabled }}
securityContext: {{- omit .Values.query.containerSecurityContext "enabled" | toYaml | nindent 12 }}
{{- end }}
{{- if .Values.diagnosticMode.enabled }}
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }}
{{- else if .Values.query.command }}
command: {{- include "common.tplvalues.render" (dict "value" .Values.query.command "context" $) | nindent 12 }}
{{- else }}
command: ["/opt/bitnami/jaeger/bin/jaeger-query"]
{{- end }}
{{- if .Values.diagnosticMode.enabled }}
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }}
{{- else if .Values.query.args }}
args: {{- include "common.tplvalues.render" (dict "value" .Values.query.args "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.query.lifecycleHooks }}
lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.query.lifecycleHooks "context" $) | nindent 12 }}
{{- end }}
ports:
- name: ui
containerPort: {{ .Values.query.containerPorts.api }}
- name: admin
containerPort: {{ .Values.query.containerPorts.admin }}
env:
- name: CASSANDRA_SERVERS
value: {{ include "jaeger.cassandra.host" . }}
- name: CASSANDRA_PORT
value: {{ include "jaeger.cassandra.port" . }}
- name: CASSANDRA_USERNAME
value: {{ include "jaeger.cassandra.user" . }}
- name: CASSANDRA_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "jaeger.cassandra.secretName" . }}
key: {{ include "jaeger.cassandra.secretKey" . }}
- name: CASSANDRA_KEYSPACE
value: {{ include "jaeger.cassandra.keyspace" . }}
- name: CASSANDRA_DATACENTER
value: {{ include "jaeger.cassandra.datacenter" . }}
- name: QUERY_HTTP_SERVER_HOST_PORT
value: {{ printf ":%v" .Values.query.containerPorts.api | quote }}
- name: ADMIN_HTTP_HOST_PORT
value: {{ printf ":%v" .Values.query.containerPorts.admin | quote }}
- name: BITNAMI_DEBUG
value: {{ ternary "true" "false" .Values.image.debug | quote }}
{{- if .Values.query.extraEnvVars }}
{{- include "common.tplvalues.render" (dict "value" .Values.query.extraEnvVars "context" $) | nindent 12 }}
{{- end }}
envFrom:
{{- if .Values.query.extraEnvVarsCM }}
- configMapRef:
name: {{ .Values.query.extraEnvVarsCM }}
{{- end }}
{{- if .Values.query.extraEnvVarsSecret }}
- secretRef:
name: {{ .Values.query.extraEnvVarsSecret }}
{{- end }}
{{- if not .Values.diagnosticMode.enabled }}
{{- if .Values.query.customStartupProbe }}
startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.query.customStartupProbe "context" $) | nindent 12 }}
{{- else if .Values.query.startupProbe.enabled }}
startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.query.startupProbe "enabled") "context" $) | nindent 12 }}
httpGet:
path: /
port: admin
{{- end }}
{{- if .Values.query.customLivenessProbe }}
livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.query.customLivenessProbe "context" $) | nindent 12 }}
{{- else if .Values.query.livenessProbe.enabled }}
livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.query.livenessProbe "enabled") "context" $) | nindent 12 }}
httpGet:
path: /
port: admin
{{- end }}
{{- if .Values.query.customReadinessProbe }}
readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.query.customReadinessProbe "context" $) | nindent 12 }}
{{- else if .Values.query.readinessProbe.enabled }}
readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.query.readinessProbe "enabled") "context" $) | nindent 12 }}
httpGet:
path: /
port: admin
{{- end }}
{{- end }}
{{- if .Values.query.resources }}
resources: {{- toYaml .Values.query.resources | nindent 12 }}
{{- end }}
{{- if .Values.query.extraVolumeMounts }}
{{- include "common.tplvalues.render" ( dict "value" .Values.query.extraVolumeMounts "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.query.sidecars }}
{{- include "common.tplvalues.render" ( dict "value" .Values.query.sidecars "context" $) | nindent 8 }}
{{- end }}
volumes:
{{- if .Values.query.extraVolumes }}
{{- include "common.tplvalues.render" ( dict "value" .Values.query.extraVolumes "context" $) | nindent 8 }}
{{- end }}

View File

@@ -0,0 +1,64 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "jaeger.query.fullname" . }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/part-of: jaeger
app.kubernetes.io/component: query
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if or .Values.query.service.annotations .Values.commonAnnotations }}
annotations:
{{- if .Values.query.service.annotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.query.service.annotations "context" $) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
{{- include "common.tplvalues.render" ( dict "value" .Values.query.service.metrics.annotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.query.service.type }}
{{- if and (eq .Values.query.service.type "LoadBalancer") (not (empty .Values.query.service.loadBalancerIP)) }}
loadBalancerIP: {{ .Values.query.service.loadBalancerIP }}
{{- end }}
{{- if and (eq .Values.query.service.type "LoadBalancer") (not (empty .Values.query.service.loadBalancerSourceRanges)) }}
loadBalancerSourceRanges: {{ .Values.query.service.loadBalancerSourceRanges }}
{{- end }}
{{- if and .Values.query.service.clusterIP (eq .Values.query.service.type "ClusterIP") }}
clusterIP: {{ .Values.query.service.clusterIP }}
{{- end }}
{{- if .Values.query.service.sessionAffinity }}
sessionAffinity: {{ .Values.query.service.sessionAffinity }}
{{- end }}
{{- if .Values.query.service.sessionAffinityConfig }}
sessionAffinityConfig: {{- include "common.tplvalues.render" (dict "value" .Values.query.service.sessionAffinityConfig "context" $) | nindent 4 }}
{{- end }}
{{- if or (eq .Values.query.service.type "LoadBalancer") (eq .Values.query.service.type "NodePort") }}
externalTrafficPolicy: {{ .Values.query.service.externalTrafficPolicy | quote }}
{{- end }}
ports:
- name: api
port: {{ .Values.query.service.ports.api }}
targetPort: {{ .Values.query.containerPorts.api }}
{{- if and (or (eq .Values.query.service.type "NodePort") (eq .Values.query.service.type "LoadBalancer")) (not (empty .Values.query.service.nodePorts.api)) }}
nodePort: {{ .Values.query.service.nodePorts.api }}
{{- else if eq .Values.query.service.type "ClusterIP" }}
nodePort: null
{{- end }}
- name: admin
port: {{ .Values.query.service.ports.admin }}
targetPort: {{ .Values.query.containerPorts.admin }}
{{- if and (or (eq .Values.query.service.type "NodePort") (eq .Values.query.service.type "LoadBalancer")) (not (empty .Values.query.service.nodePorts.admin)) }}
nodePort: {{ .Values.query.service.nodePorts.admin }}
{{- else if eq .Values.query.service.type "ClusterIP" }}
nodePort: null
{{- end }}
{{- if .Values.query.service.extraPorts }}
{{- include "common.tplvalues.render" (dict "value" .Values.query.service.extraPorts "context" $) | nindent 4 }}
{{- end }}
selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
app.kubernetes.io/part-of: jaeger
app.kubernetes.io/component: query

View File

@@ -0,0 +1,21 @@
{{- if .Values.query.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "jaeger.query.serviceAccountName" . }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/part-of: jaeger
app.kubernetes.io/component: query
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
annotations:
{{- if .Values.commonAnnotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.query.serviceAccount.annotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.query.serviceAccount.annotations "context" $ ) | nindent 4 }}
{{- end }}
automountServiceAccountToken: {{ .Values.query.serviceAccount.automountServiceAccountToken }}
{{- end }}