...

Text file src/github.com/linkerd/linkerd2/charts/linkerd-control-plane/templates/heartbeat.yaml

Documentation: github.com/linkerd/linkerd2/charts/linkerd-control-plane/templates

     1{{ if not .Values.disableHeartBeat -}}
     2---
     3###
     4### Heartbeat
     5###
     6apiVersion: batch/v1
     7kind: CronJob
     8metadata:
     9  name: linkerd-heartbeat
    10  namespace: {{ .Release.Namespace }}
    11  labels:
    12    app.kubernetes.io/name: heartbeat
    13    app.kubernetes.io/part-of: Linkerd
    14    app.kubernetes.io/version: {{.Values.linkerdVersion}}
    15    linkerd.io/control-plane-component: heartbeat
    16    linkerd.io/control-plane-ns: {{.Release.Namespace}}
    17    {{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }}
    18  annotations:
    19    {{ include "partials.annotations.created-by" . }}
    20spec:
    21  concurrencyPolicy: Replace
    22  {{ if .Values.heartbeatSchedule -}}
    23  schedule: "{{.Values.heartbeatSchedule}}"
    24  {{ else -}}
    25  schedule: "{{ dateInZone "04 15 * * *" (now | mustDateModify "+10m") "UTC"}}"
    26  {{ end -}}
    27  successfulJobsHistoryLimit: 0
    28  jobTemplate:
    29    spec:
    30      template:
    31        metadata:
    32          labels:
    33            linkerd.io/control-plane-component: heartbeat
    34            linkerd.io/workload-ns: {{.Release.Namespace}}
    35            {{- with .Values.podLabels }}{{ toYaml . | trim | nindent 12 }}{{- end }}
    36          annotations:
    37            {{ include "partials.annotations.created-by" . }}
    38            {{- with .Values.podAnnotations }}{{ toYaml . | trim | nindent 12 }}{{- end }}
    39        spec:
    40          {{- if .Values.priorityClassName }}
    41          priorityClassName: {{ .Values.priorityClassName }}
    42          {{- end -}}
    43          {{- with .Values.runtimeClassName }}
    44          runtimeClassName: {{ . | quote }}
    45          {{- end }}
    46          {{- if .Values.tolerations -}}
    47          {{- include "linkerd.tolerations" . | nindent 10 }}
    48          {{- end -}}
    49          {{- include "linkerd.node-selector" . | nindent 10 }}
    50          securityContext:
    51            seccompProfile:
    52              type: RuntimeDefault
    53          serviceAccountName: linkerd-heartbeat
    54          restartPolicy: Never
    55          containers:
    56          - name: heartbeat
    57            image: {{.Values.controllerImage}}:{{.Values.controllerImageVersion | default .Values.linkerdVersion}}
    58            imagePullPolicy: {{.Values.imagePullPolicy}}
    59            env:
    60            - name: LINKERD_DISABLED
    61              value: "the heartbeat controller does not use the proxy"
    62            {{- with (.Values.heartbeat).additionalEnv }}
    63            {{- toYaml . | nindent 12 -}}
    64            {{- end }}
    65            {{- with (.Values.heartbeat).experimentalEnv }}
    66            {{- toYaml . | nindent 12 -}}
    67            {{- end }}
    68            args:
    69            - "heartbeat"
    70            - "-controller-namespace={{.Release.Namespace}}"
    71            - "-log-level={{.Values.controllerLogLevel}}"
    72            - "-log-format={{.Values.controllerLogFormat}}"
    73            {{- if .Values.prometheusUrl }}
    74            - "-prometheus-url={{.Values.prometheusUrl}}"
    75            {{- else }}
    76            - "-prometheus-url=http://prometheus.linkerd-viz.svc.{{.Values.clusterDomain}}:9090"
    77            {{- end }}
    78            {{- if .Values.heartbeatResources -}}
    79            {{- include "partials.resources" .Values.heartbeatResources | nindent 12 }}
    80            {{- end }}
    81            securityContext:
    82              capabilities:
    83                drop:
    84                - ALL
    85              readOnlyRootFilesystem: true
    86              runAsNonRoot: true
    87              runAsUser: {{.Values.controllerUID}}
    88              {{- if ge (int .Values.controllerGID) 0 }}
    89              runAsGroup: {{.Values.controllerGID}}
    90              {{- end }}
    91              allowPrivilegeEscalation: false
    92              seccompProfile:
    93                type: RuntimeDefault
    94{{- end }}

View as plain text