sigs.k8s.io/external-dns@v0.14.1/charts/external-dns/templates/deployment.yaml (about)

     1  {{- $providerName := tpl (include "external-dns.providerName" .) $ }}
     2  apiVersion: apps/v1
     3  kind: Deployment
     4  metadata:
     5    name: {{ include "external-dns.fullname" . }}
     6    namespace: {{ .Release.Namespace }}
     7    labels:
     8      {{- include "external-dns.labels" . | nindent 4 }}
     9    {{- with .Values.deploymentAnnotations }}
    10    annotations:
    11      {{- toYaml . | nindent 4 }}
    12    {{- end }}
    13  spec:
    14    replicas: 1
    15    selector:
    16      matchLabels:
    17        {{- include "external-dns.selectorLabels" . | nindent 6 }}
    18    strategy:
    19      {{- toYaml .Values.deploymentStrategy | nindent 4 }}
    20    {{- if or (kindIs "float64" .Values.revisionHistoryLimit) (kindIs "int64" .Values.revisionHistoryLimit) }}
    21    revisionHistoryLimit: {{ .Values.revisionHistoryLimit | int64 }}
    22    {{- end }}
    23    template:
    24      metadata:
    25        labels:
    26          {{- include "external-dns.selectorLabels" . | nindent 8 }}
    27        {{- with .Values.podLabels }}
    28          {{- toYaml . | nindent 8 }}
    29        {{- end }}
    30        {{- if or .Values.secretConfiguration.enabled .Values.podAnnotations }}
    31        annotations:
    32          {{- if .Values.secretConfiguration.enabled }}
    33          checksum/secret: {{ tpl (toYaml .Values.secretConfiguration.data) . | sha256sum }}
    34          {{- end }}
    35          {{- with .Values.podAnnotations }}
    36          {{- toYaml . | nindent 8 }}
    37          {{- end }}
    38        {{- end }}
    39      spec:
    40      {{- if not (quote .Values.automountServiceAccountToken | empty) }}
    41        automountServiceAccountToken: {{ .Values.automountServiceAccountToken }}
    42      {{- end }}
    43        {{- with .Values.imagePullSecrets }}
    44        imagePullSecrets:
    45          {{- toYaml . | nindent 8 }}
    46        {{- end }}
    47        serviceAccountName: {{ include "external-dns.serviceAccountName" . }}
    48        {{- with .Values.shareProcessNamespace }}
    49        shareProcessNamespace: {{ . }}
    50        {{- end }}
    51        {{- with .Values.podSecurityContext }}
    52        securityContext:
    53          {{- toYaml . | nindent 8 }}
    54        {{- end }}
    55        {{- with .Values.priorityClassName }}
    56        priorityClassName: {{ . | quote }}
    57        {{- end }}
    58        {{- with .Values.terminationGracePeriodSeconds }}
    59        terminationGracePeriodSeconds: {{ . }}
    60        {{- end }}
    61        {{- with .Values.dnsPolicy }}
    62        dnsPolicy: {{ . }}
    63        {{- end }}
    64        {{- with .Values.dnsConfig }}
    65        dnsConfig:
    66          {{- toYaml . | nindent 8 }}
    67        {{- end }}
    68        {{- with .Values.initContainers }}
    69        initContainers:
    70          {{- toYaml . | nindent 8 }}
    71        {{- end }}
    72        containers:
    73          - name: external-dns
    74            {{- with .Values.securityContext }}
    75            securityContext:
    76              {{- toYaml . | nindent 12 }}
    77            {{- end }}
    78            image: {{ include "external-dns.image" . }}
    79            imagePullPolicy: {{ .Values.image.pullPolicy }}
    80            {{- with .Values.env }}
    81            env:
    82              {{- toYaml . | nindent 12 }}
    83            {{- end }}
    84            args:
    85              - --log-level={{ .Values.logLevel }}
    86              - --log-format={{ .Values.logFormat }}
    87              - --interval={{ .Values.interval }}
    88              {{- if .Values.triggerLoopOnEvent }}
    89              - --events
    90              {{- end }}
    91              {{- range .Values.sources }}
    92              - --source={{ . }}
    93              {{- end }}
    94              - --policy={{ .Values.policy }}
    95              - --registry={{ .Values.registry }}
    96              {{- if .Values.txtOwnerId }}
    97              - --txt-owner-id={{ .Values.txtOwnerId }}
    98              {{- end }}
    99              {{- if .Values.txtPrefix }}
   100              - --txt-prefix={{ .Values.txtPrefix }}
   101              {{- end }}
   102              {{- if and (eq .Values.txtPrefix "") (ne .Values.txtSuffix "") }}
   103              - --txt-suffix={{ .Values.txtSuffix }}
   104              {{- end }}
   105              {{- if .Values.namespaced }}
   106              - --namespace={{ .Release.Namespace }}
   107              {{- end }}
   108              {{- range .Values.domainFilters }}
   109              - --domain-filter={{ . }}
   110              {{- end }}
   111              - --provider={{ $providerName }}
   112            {{- range .Values.extraArgs }}
   113              - {{ tpl . $ }}
   114            {{- end }}
   115            ports:
   116              - name: http
   117                protocol: TCP
   118                containerPort: 7979
   119            livenessProbe:
   120              {{- toYaml .Values.livenessProbe | nindent 12 }}
   121            readinessProbe:
   122              {{- toYaml .Values.readinessProbe | nindent 12 }}
   123            {{- if or .Values.secretConfiguration.enabled .Values.extraVolumeMounts }}
   124            volumeMounts:
   125              {{- if .Values.secretConfiguration.enabled }}
   126              - name: secrets
   127                mountPath: {{ tpl .Values.secretConfiguration.mountPath $ }}
   128              {{- with .Values.secretConfiguration.subPath }}
   129                subPath: {{ tpl . $ }}
   130              {{- end }}
   131              {{- end }}
   132              {{- with .Values.extraVolumeMounts }}
   133              {{- toYaml . | nindent 12 }}
   134              {{- end }}
   135            {{- end }}
   136            {{- with .Values.resources }}
   137            resources:
   138              {{- toYaml . | nindent 12 }}
   139            {{- end }}
   140          {{- if eq $providerName "webhook" }}
   141          {{- with .Values.provider.webhook }}
   142          - name: webhook
   143            image: {{ include "external-dns.webhookImage" . }}
   144            imagePullPolicy: {{ $.Values.image.pullPolicy }}
   145            {{- with .env }}
   146            env:
   147              {{- toYaml . | nindent 12 }}
   148            {{- end }}
   149            {{- with .args }}
   150            args:
   151              {{- toYaml . | nindent 12 }}
   152            {{- end }}
   153            ports:
   154              - name: http-webhook
   155                protocol: TCP
   156                containerPort: 8888
   157              - name: http-wh-metrics
   158                protocol: TCP
   159                containerPort: 8080
   160            livenessProbe:
   161              {{- toYaml .livenessProbe | nindent 12 }}
   162            readinessProbe:
   163              {{- toYaml .readinessProbe | nindent 12 }}
   164            {{- if .extraVolumeMounts }}
   165            volumeMounts:
   166              {{- with .extraVolumeMounts }}
   167              {{- toYaml . | nindent 12 }}
   168              {{- end }}
   169            {{- end }}
   170            {{- with .securityContext }}
   171            securityContext:
   172              {{- toYaml . | nindent 12 }}
   173            {{- end }}
   174          {{- end }}
   175          {{- end }}
   176        {{- if or .Values.secretConfiguration.enabled .Values.extraVolumes }}
   177        volumes:
   178          {{- if .Values.secretConfiguration.enabled }}
   179          - name: secrets
   180            secret:
   181              secretName: {{ include "external-dns.fullname" . }}
   182          {{- end }}
   183          {{- with .Values.extraVolumes }}
   184          {{- toYaml . | nindent 8 }}
   185          {{- end }}
   186        {{- end }}
   187        {{- with .Values.nodeSelector }}
   188        nodeSelector:
   189          {{- toYaml . | nindent 8 }}
   190        {{- end }}
   191        {{- with .Values.affinity }}
   192        affinity:
   193          {{- toYaml . | nindent 8 }}
   194        {{- end }}
   195        {{- with .Values.topologySpreadConstraints }}
   196        topologySpreadConstraints:
   197          {{- toYaml . | nindent 8 }}
   198        {{- end }}
   199        {{- with .Values.tolerations }}
   200        tolerations:
   201          {{- toYaml . | nindent 8 }}
   202        {{- end }}