github.com/replicatedhq/ship@v0.55.0/integration/update/namespace/expected/.ship/upstream/templates/deployment.yaml (about)

     1  apiVersion: apps/v1beta2
     2  kind: Deployment
     3  metadata:
     4    name: {{ template "grafana.fullname" . }}
     5    labels:
     6      app: {{ template "grafana.name" . }}
     7      chart: {{ template "grafana.chart" . }}
     8      release: {{ .Release.Name }}
     9      heritage: {{ .Release.Service }}
    10  {{- with .Values.annotations }}
    11    annotations:
    12  {{ toYaml . | indent 4 }}
    13  {{- end }}
    14  spec:
    15    replicas: {{ .Values.replicas }}
    16    selector:
    17      matchLabels:
    18        app: {{ template "grafana.name" . }}
    19        release: {{ .Release.Name }}
    20    strategy:
    21      type: {{ .Values.deploymentStrategy }}
    22    {{- if ne .Values.deploymentStrategy "RollingUpdate" }}
    23      rollingUpdate: null
    24    {{- end }}
    25    template:
    26      metadata:
    27        labels:
    28          app: {{ template "grafana.name" . }}
    29          release: {{ .Release.Name }}
    30  {{- with .Values.podAnnotations }}
    31        annotations:
    32  {{ toYaml . | indent 8 }}
    33  {{- end }}
    34      spec:
    35        serviceAccountName: {{ template "grafana.serviceAccountName" . }}
    36  {{- if .Values.schedulerName }}
    37        schedulerName: "{{ .Values.schedulerName }}"
    38  {{- end }}
    39  {{- if .Values.securityContext }}
    40        securityContext:
    41  {{ toYaml .Values.securityContext | indent 8 }}
    42  {{- end }}
    43  {{- if .Values.priorityClassName }}
    44        priorityClassName: {{ .Values.priorityClassName }}
    45  {{- end }}
    46  {{- if .Values.dashboards }}
    47        initContainers:
    48          - name: download-dashboards
    49            image: "{{ .Values.downloadDashboardsImage.repository }}:{{ .Values.downloadDashboardsImage.tag }}"
    50            imagePullPolicy: {{ .Values.downloadDashboardsImage.pullPolicy }}
    51            command: ["sh", "/etc/grafana/download_dashboards.sh"]
    52            volumeMounts:
    53              - name: config
    54                mountPath: "/etc/grafana/download_dashboards.sh"
    55                subPath: download_dashboards.sh
    56              - name: storage
    57                mountPath: "/var/lib/grafana"
    58                subPath: {{ .Values.persistence.subPath }}
    59            {{- range .Values.extraSecretMounts }}
    60              - name: {{ .name }}
    61                mountPath: {{ .mountPath }}
    62                readOnly: {{ .readOnly }}
    63            {{- end }}
    64  {{- end }}
    65        {{- if .Values.image.pullSecrets }}
    66        imagePullSecrets:
    67        {{- range .Values.image.pullSecrets }}
    68          - name: {{ . }}
    69        {{- end}}
    70        {{- end }}
    71        containers:
    72  {{- if .Values.sidecar.dashboards.enabled }}
    73          - name: {{ template "grafana.name" . }}-sc-dashboard
    74            image: "{{ .Values.sidecar.image }}"
    75            imagePullPolicy: {{ .Values.sidecar.imagePullPolicy }}
    76            env:
    77              - name: LABEL
    78                value: "{{ .Values.sidecar.dashboards.label }}"
    79              - name: FOLDER
    80                value: "{{ .Values.sidecar.dashboards.folder }}"
    81              {{- if .Values.sidecar.dashboards.searchNamespace }}
    82              - name: NAMESPACE
    83                value: "{{ .Values.sidecar.dashboards.searchNamespace }}"
    84              {{- end }}
    85            resources:
    86  {{ toYaml .Values.sidecar.resources | indent 12 }}
    87            volumeMounts:
    88              - name: sc-dashboard-volume
    89                mountPath: {{ .Values.sidecar.dashboards.folder | quote }}
    90  {{- end}}
    91  {{- if .Values.sidecar.datasources.enabled }}
    92          - name: {{ template "grafana.name" . }}-sc-datasources
    93            image: "{{ .Values.sidecar.image }}"
    94            imagePullPolicy: {{ .Values.sidecar.imagePullPolicy }}
    95            env:
    96              - name: NEEDED_TO_FORK
    97                value: "had to fork"
    98              - name: LABEL
    99                value: "{{ .Values.sidecar.datasources.label }}"
   100              - name: FOLDER
   101                value: "/etc/grafana/provisioning/datasources"
   102              {{- if .Values.sidecar.datasources.searchNamespace }}
   103              - name: NAMESPACE
   104                value: "{{ .Values.sidecar.datasources.searchNamespace }}"
   105              {{- end }}
   106            resources:
   107  {{ toYaml .Values.sidecar.resources | indent 12 }}
   108            volumeMounts:
   109              - name: sc-datasources-volume
   110                mountPath: "/etc/grafana/provisioning/datasources"
   111  {{- end}}
   112          - name: {{ .Chart.Name }}
   113            image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
   114            imagePullPolicy: {{ .Values.image.pullPolicy }}
   115            volumeMounts:
   116              - name: config
   117                mountPath: "/etc/grafana/grafana.ini"
   118                subPath: grafana.ini
   119              - name: ldap
   120                mountPath: "/etc/grafana/ldap.toml"
   121                subPath: ldap.toml
   122              - name: storage
   123                mountPath: "/var/lib/grafana"
   124                subPath: {{ .Values.persistence.subPath }}
   125  {{- if .Values.dashboards }}
   126    {{- range $provider, $dashboards := .Values.dashboards }}
   127      {{- range $key, $value := $dashboards }}
   128        {{- if hasKey $value "json" }}
   129              - name: dashboards-{{ $provider }}
   130                mountPath: "/var/lib/grafana/dashboards/{{ $provider }}/{{ $key }}.json"
   131                subPath: "{{ $key }}.json"
   132        {{- end }}
   133      {{- end }}
   134    {{- end }}
   135  {{- end -}}
   136  {{- if .Values.dashboardsConfigMaps }}
   137    {{- range keys .Values.dashboardsConfigMaps }}
   138              - name: dashboards-{{ . }}
   139                mountPath: "/var/lib/grafana/dashboards/{{ . }}"
   140    {{- end }}
   141  {{- end }}
   142  {{- if .Values.datasources }}
   143              - name: config
   144                mountPath: "/etc/grafana/provisioning/datasources/datasources.yaml"
   145                subPath: datasources.yaml
   146  {{- end }}
   147  {{- if .Values.dashboardProviders }}
   148              - name: config
   149                mountPath: "/etc/grafana/provisioning/dashboards/dashboardproviders.yaml"
   150                subPath: dashboardproviders.yaml
   151  {{- end }}
   152  {{- if .Values.sidecar.dashboards.enabled }}
   153              - name: sc-dashboard-volume
   154                mountPath: {{ .Values.sidecar.dashboards.folder | quote }}
   155              - name: sc-dashboard-provider
   156                mountPath: "/etc/grafana/provisioning/dashboards/sc-dashboardproviders.yaml"
   157                subPath: provider.yaml
   158  {{- end}}
   159  {{- if .Values.sidecar.datasources.enabled }}
   160              - name: sc-datasources-volume
   161                mountPath: "/etc/grafana/provisioning/datasources"
   162  {{- end}}
   163            {{- range .Values.extraSecretMounts }}
   164              - name: {{ .name }}
   165                mountPath: {{ .mountPath }}
   166                readOnly: {{ .readOnly }}
   167            {{- end }}
   168            ports:
   169              - name: service
   170                containerPort: {{ .Values.service.port }}
   171                protocol: TCP
   172              - name: grafana
   173                containerPort: 3000
   174                protocol: TCP
   175            env:
   176              - name: GF_SECURITY_ADMIN_USER
   177                valueFrom:
   178                  secretKeyRef:
   179                    name: {{ template "grafana.fullname" . }}
   180                    key: admin-user
   181              - name: GF_SECURITY_ADMIN_PASSWORD
   182                valueFrom:
   183                  secretKeyRef:
   184                    name: {{ template "grafana.fullname" . }}
   185                    key: admin-password
   186              {{- if .Values.plugins }}
   187              - name: GF_INSTALL_PLUGINS
   188                valueFrom:
   189                  configMapKeyRef:
   190                    name: {{ template "grafana.fullname" . }}
   191                    key: plugins
   192              {{- end }}
   193              {{- if .Values.smtp.existingSecret }}
   194              - name: GF_SMTP_USER
   195                valueFrom:
   196                  secretKeyRef:
   197                    name: {{ .Values.smtp.existingSecret }}
   198                    key: user
   199              - name: GF_SMTP_PASSWORD
   200                valueFrom:
   201                  secretKeyRef:
   202                    name: {{ .Values.smtp.existingSecret }}
   203                    key: password
   204              {{- end }}
   205  {{- range $key, $value := .Values.env }}
   206              - name: "{{ $key }}"
   207                value: "{{ $value }}"
   208  {{- end }}
   209            {{- if .Values.envFromSecret }}
   210            envFrom:
   211              - secretRef:
   212                  name: {{ .Values.envFromSecret }}
   213            {{- end }}
   214            livenessProbe:
   215  {{ toYaml .Values.livenessProbe | indent 12 }}
   216            readinessProbe:
   217  {{ toYaml .Values.readinessProbe | indent 12 }}
   218            resources:
   219  {{ toYaml .Values.resources | indent 12 }}
   220      {{- with .Values.nodeSelector }}
   221        nodeSelector:
   222  {{ toYaml . | indent 8 }}
   223      {{- end }}
   224      {{- with .Values.affinity }}
   225        affinity:
   226  {{ toYaml . | indent 8 }}
   227      {{- end }}
   228      {{- with .Values.tolerations }}
   229        tolerations:
   230  {{ toYaml . | indent 8 }}
   231      {{- end }}
   232        volumes:
   233          - name: config
   234            configMap:
   235              name: {{ template "grafana.fullname" . }}
   236          {{- if .Values.dashboards }}
   237            {{- range keys .Values.dashboards }}
   238          - name: dashboards-{{ . }}
   239            configMap:
   240              name: {{ template "grafana.fullname" $ }}-dashboards-{{ . }}
   241            {{- end }}
   242          {{- end }}
   243          {{- if .Values.dashboardsConfigMaps }}
   244            {{- range $provider, $name := .Values.dashboardsConfigMaps }}
   245          - name: dashboards-{{ $provider }}
   246            configMap:
   247              name: {{ $name }}
   248            {{- end }}
   249          {{- end }}
   250          - name: ldap
   251            secret:
   252              {{- if .Values.ldap.existingSecret }}
   253              secretName: {{ .Values.ldap.existingSecret }}
   254              {{- else }}
   255              secretName: {{ template "grafana.fullname" . }}
   256              {{- end }}
   257              items:
   258                - key: ldap-toml
   259                  path: ldap.toml
   260          - name: storage
   261        {{- if .Values.persistence.enabled }}
   262            persistentVolumeClaim:
   263              claimName: {{ .Values.persistence.existingClaim | default (include "grafana.fullname" .) }}
   264        {{- else }}
   265            emptyDir: {}
   266        {{- end -}}
   267        {{- if .Values.sidecar.dashboards.enabled }}
   268          - name: sc-dashboard-volume
   269            emptyDir: {}
   270          - name: sc-dashboard-provider
   271            configMap:
   272              name: {{ template "grafana.fullname" . }}-config-dashboards
   273        {{- end }}
   274        {{- if .Values.sidecar.datasources.enabled }}
   275          - name: sc-datasources-volume
   276            emptyDir: {}
   277        {{- end -}}
   278        {{- range .Values.extraSecretMounts }}
   279          - name: {{ .name }}
   280            secret:
   281              secretName: {{ .secretName }}
   282              defaultMode: {{ .defaultMode }}
   283        {{- end }}