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

     1  {{- if .Values.collector.enabled -}}
     2  {{- if eq .Values.storage.type "cassandra" -}}
     3  apiVersion: batch/v1
     4  kind: Job
     5  metadata:
     6    name: {{ include "jaeger.fullname" . }}-cassandra-schema
     7    labels:
     8      app.kubernetes.io/name: {{ include "jaeger.name" . }}
     9      helm.sh/chart: {{ include "jaeger.chart" . }}
    10      app.kubernetes.io/component: cassandra-schema
    11      app.kubernetes.io/managed-by: {{ .Release.Service }}
    12      app.kubernetes.io/instance: {{ .Release.Name }}
    13  {{- if .Values.schema.annotations }}
    14    annotations:
    15  {{ toYaml .Values.schema.annotations | indent 4 }}
    16  {{- end }}
    17  spec:
    18    activeDeadlineSeconds: {{ .Values.schema.activeDeadlineSeconds }}
    19    template:
    20      metadata:
    21        name: {{ include "jaeger.fullname" . }}-cassandra-schema
    22  {{- if .Values.schema.podLabels }}
    23        labels:
    24  {{ toYaml .Values.schema.podLabels | indent 8 }}
    25  {{- end }}
    26      spec:
    27        serviceAccountName: {{ include "jaeger.fullname" . }}-cassandra-schema
    28        containers:
    29        - name: {{ include "jaeger.fullname" . }}-cassandra-schema
    30          image: {{ .Values.schema.image }}:{{ .Values.tag }}
    31          imagePullPolicy: {{ .Values.schema.pullPolicy }}
    32          env:
    33          - name: CQLSH_HOST
    34            value: {{ template "cassandra.host" . }}
    35          {{ if .Values.storage.cassandra.tls.enabled }}
    36          - name: CQLSH_SSL
    37            value: "--ssl"
    38          {{- end }}
    39          - name: MODE
    40            value: {{ .Values.schema.mode | quote }}
    41          - name: DATACENTER
    42            value: {{ .Values.cassandra.config.dc_name | quote }}
    43          - name: CASSANDRA_PORT
    44            value: {{ .Values.storage.cassandra.port | quote }}
    45          - name: CASSANDRA_USERNAME
    46            value: {{ .Values.storage.cassandra.user }}
    47          - name: CASSANDRA_PASSWORD
    48            valueFrom:
    49              secretKeyRef:
    50                name: {{ if .Values.storage.cassandra.existingSecret }}{{ .Values.storage.cassandra.existingSecret }}{{- else }}{{ include "jaeger.fullname" . }}-cassandra{{- end }}
    51                key: password
    52        {{- if .Values.schema.keyspace }}
    53          - name: KEYSPACE
    54            value: {{ .Values.schema.keyspace | quote }}
    55        {{- end }}
    56        {{- if .Values.schema.traceTtl }}
    57          - name: TRACE_TTL
    58            value: {{ .Values.schema.traceTtl | quote }}
    59        {{- end }}
    60        {{- if .Values.schema.dependenciesTtl }}
    61          - name: DEPENDENCIES_TTL
    62            value: {{ .Values.schema.dependenciesTtl | quote }}
    63        {{- end }}
    64          resources:
    65  {{ toYaml .Values.schema.resources | indent 10 }}
    66          volumeMounts:
    67          {{- range .Values.schema.extraConfigmapMounts }}
    68            - name: {{ .name }}
    69              mountPath: {{ .mountPath }}
    70              subPath: {{ .subPath }}
    71              readOnly: {{ .readOnly }}
    72          {{- end }}
    73          {{- if .Values.storage.cassandra.tls.enabled }}
    74            - name: {{ .Values.storage.cassandra.tls.secretName }}
    75              mountPath: "/root/.cassandra/ca-cert.pem"
    76              subPath: "ca-cert.pem"
    77              readOnly: true
    78            - name: {{ .Values.storage.cassandra.tls.secretName }}
    79              mountPath: "/root/.cassandra/client-cert.pem"
    80              subPath: "client-cert.pem"
    81              readOnly: true
    82            - name: {{ .Values.storage.cassandra.tls.secretName }}
    83              mountPath: "/root/.cassandra/client-key.pem"
    84              subPath: "client-key.pem"
    85              readOnly: true
    86            - name: {{ .Values.storage.cassandra.tls.secretName }}
    87              mountPath: "/root/.cassandra/cqlshrc"
    88              subPath: "cqlshrc"
    89              readOnly: true
    90          {{- end }}
    91        restartPolicy: OnFailure
    92        volumes:
    93        {{- range .Values.schema.extraConfigmapMounts }}
    94          - name: {{ .name }}
    95            configMap:
    96              name: {{ .configMap }}
    97        {{- end }}
    98  {{- end -}}
    99  {{- end -}}