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

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