github.com/microsoft/fabrikate@v1.0.0-alpha.1.0.20210115014322-dc09194d0885/testdata/generate/infra/fabrikate-jaeger/helm_repos/jaeger/templates/query-deploy.yaml (about)

     1  {{- if .Values.query.enabled -}}
     2  apiVersion: apps/v1
     3  kind: Deployment
     4  metadata:
     5    name: {{ template "jaeger.query.name" . }}
     6    labels:
     7      app.kubernetes.io/name: {{ include "jaeger.name" . }}
     8      helm.sh/chart: {{ include "jaeger.chart" . }}
     9      app.kubernetes.io/component: query
    10      app.kubernetes.io/managed-by: {{ .Release.Service }}
    11      app.kubernetes.io/instance: {{ .Release.Name }}
    12  {{- if .Values.query.annotations }}
    13    annotations:
    14  {{ toYaml .Values.query.annotations | indent 4 }}
    15  {{- end }}
    16  spec:
    17    replicas: {{ .Values.query.replicaCount }}
    18    selector:
    19      matchLabels:
    20        app.kubernetes.io/name: {{ include "jaeger.name" . }}
    21        app.kubernetes.io/component: query
    22        app.kubernetes.io/instance: {{ .Release.Name }}
    23    strategy:
    24      type: Recreate
    25    template:
    26      metadata:
    27  {{- if .Values.query.podAnnotations }}
    28        annotations:
    29  {{ toYaml .Values.query.podAnnotations | indent 8 }}
    30  {{- end }}
    31        labels:
    32          app.kubernetes.io/name: {{ include "jaeger.name" . }}
    33          app.kubernetes.io/component: query
    34          app.kubernetes.io/instance: {{ .Release.Name }}
    35  {{- if .Values.query.podLabels }}
    36  {{ toYaml .Values.query.podLabels | indent 8 }}
    37  {{- end }}
    38      spec:
    39        nodeSelector:
    40  {{ toYaml .Values.query.nodeSelector | indent 8 }}
    41  {{- if .Values.query.tolerations }}
    42        tolerations:
    43  {{ toYaml .Values.query.tolerations | indent 8 }}
    44  {{- end }}
    45        serviceAccountName: {{ template "jaeger.query.serviceAccountName" . }}
    46        containers:
    47        - name: {{ template "jaeger.query.name" . }}
    48          image: {{ .Values.query.image }}:{{ .Values.tag }}
    49          imagePullPolicy: {{ .Values.query.pullPolicy }}
    50          env:
    51            {{- range $key, $value := .Values.query.cmdlineParams }}
    52            - name: {{ $key | replace "." "_" | replace "-" "_" | upper | quote }}
    53              value: {{ $value | quote }}
    54            {{- end }}
    55            - name: SPAN_STORAGE_TYPE
    56              value: {{ .Values.storage.type }}
    57            {{- if eq .Values.storage.type "cassandra" }}
    58            - name: CASSANDRA_SERVERS
    59              value: {{ template "cassandra.host" . }}
    60            - name: CASSANDRA_PORT
    61              value: {{ .Values.storage.cassandra.port | quote }}
    62            {{ if .Values.storage.cassandra.tls.enabled }}
    63            - name: CASSANDRA_TLS
    64              value: "true"
    65            - name: CASSANDRA_TLS_SERVER_NAME
    66              valueFrom:
    67                secretKeyRef:
    68                  name: {{ .Values.storage.cassandra.tls.secretName }}
    69                  key: commonName
    70            - name: CASSANDRA_TLS_KEY
    71              value: "/cassandra-tls/client-key.pem"
    72            - name: CASSANDRA_TLS_CERT
    73              value: "/cassandra-tls/client-cert.pem"
    74            - name: CASSANDRA_TLS_CA
    75              value: "/cassandra-tls/ca-cert.pem"
    76            {{- end }}    
    77            - name: CASSANDRA_KEYSPACE
    78              value: {{ printf "%s_%s" "jaeger_v1" .Values.cassandra.config.dc_name | quote }}
    79            - name: CASSANDRA_USERNAME
    80              value: {{ .Values.storage.cassandra.user }}
    81            - name: CASSANDRA_PASSWORD
    82              valueFrom:
    83                secretKeyRef:
    84                  name: {{ if .Values.storage.cassandra.existingSecret }}{{ .Values.storage.cassandra.existingSecret }}{{- else }}{{ include "jaeger.fullname" . }}-cassandra{{- end }}
    85                  key: password
    86            {{- end }}
    87            {{- if eq .Values.storage.type "elasticsearch" }}
    88            {{- if .Values.storage.elasticsearch.usePassword }}
    89            - name: ES_PASSWORD
    90              valueFrom:
    91                secretKeyRef:
    92                  name: {{ if .Values.storage.elasticsearch.existingSecret }}{{ .Values.storage.elasticsearch.existingSecret }}{{- else }}{{ include "jaeger.fullname" . }}-elasticsearch{{- end }}
    93                  key: password
    94            {{- end }}
    95            - name: ES_SERVER_URLS
    96              value: {{ template "elasticsearch.client.url" . }}
    97            - name: ES_USERNAME
    98              value: {{ .Values.storage.elasticsearch.user }}
    99            {{- end }}
   100            - name: QUERY_BASE_PATH
   101              value: {{ .Values.query.basePath | quote }}
   102          ports:
   103          - name: query
   104            containerPort: 16686
   105            protocol: TCP
   106          - name: admin
   107            containerPort: 16687
   108            protocol: TCP
   109          resources:
   110  {{ toYaml .Values.query.resources | indent 10 }}
   111          volumeMounts:
   112          {{- range .Values.query.extraConfigmapMounts }}
   113            - name: {{ .name }}
   114              mountPath: {{ .mountPath }}
   115              subPath: {{ .subPath }}
   116              readOnly: {{ .readOnly }}
   117          {{- end }}
   118          {{- if .Values.storage.cassandra.tls.enabled }}
   119            - name: {{ .Values.storage.cassandra.tls.secretName }}
   120              mountPath: "/cassandra-tls/ca-cert.pem"
   121              subPath: "ca-cert.pem"
   122              readOnly: true
   123            - name: {{ .Values.storage.cassandra.tls.secretName }}
   124              mountPath: "/cassandra-tls/client-cert.pem"
   125              subPath: "client-cert.pem"
   126              readOnly: true
   127            - name: {{ .Values.storage.cassandra.tls.secretName }}
   128              mountPath: "/cassandra-tls/client-key.pem"
   129              subPath: "client-key.pem"
   130              readOnly: true
   131          {{- end }}
   132          livenessProbe:
   133            httpGet:
   134              path: /
   135              port: admin
   136          readinessProbe:
   137            httpGet:
   138              path: /
   139              port: admin
   140  {{- if .Values.query.agentSidecar.enabled }}
   141        - name: {{ template "jaeger.agent.name" . }}-sidecar
   142          image: {{ .Values.agent.image }}:{{ .Values.tag }}
   143          imagePullPolicy: {{ .Values.agent.pullPolicy }}
   144          env:
   145          - name: REPORTER_GRPC_HOST_PORT
   146            value: {{ include "jaeger.collector.name" . }}:{{ .Values.collector.service.grpcPort }}
   147          ports:
   148          - name: admin
   149            containerPort: 14271
   150            protocol: TCP
   151          livenessProbe:
   152            httpGet:
   153              path: /
   154              port: admin
   155          readinessProbe:
   156            httpGet:
   157              path: /
   158              port: admin
   159  {{- end }}
   160        dnsPolicy: {{ .Values.query.dnsPolicy }}
   161        restartPolicy: Always
   162        volumes:
   163        {{- range .Values.query.extraConfigmapMounts }}
   164          - name: {{ .name }}
   165            configMap:
   166              name: {{ .configMap }}
   167        {{- end }}
   168  {{- end -}}