mirror of https://github.com/linkerd/linkerd2.git
130 lines
5.5 KiB
YAML
130 lines
5.5 KiB
YAML
---
|
|
###
|
|
### Controller
|
|
###
|
|
---
|
|
kind: Service
|
|
apiVersion: v1
|
|
metadata:
|
|
name: linkerd-controller-api
|
|
namespace: {{.Values.global.namespace}}
|
|
labels:
|
|
{{.Values.global.controllerComponentLabel}}: controller
|
|
{{.Values.global.controllerNamespaceLabel}}: {{.Values.global.namespace}}
|
|
annotations:
|
|
{{.Values.global.createdByAnnotation}}: {{default (printf "linkerd/helm %s" .Values.global.linkerdVersion) .Values.global.cliVersion}}
|
|
spec:
|
|
type: ClusterIP
|
|
selector:
|
|
{{.Values.global.controllerComponentLabel}}: controller
|
|
ports:
|
|
- name: http
|
|
port: 8085
|
|
targetPort: 8085
|
|
---
|
|
{{- $tree := deepCopy . }}
|
|
{{ $_ := set $tree.Values.global.proxy "workloadKind" "deployment" -}}
|
|
{{ $_ := set $tree.Values.global.proxy "component" "linkerd-controller" -}}
|
|
{{ include "linkerd.proxy.validation" .Values.global.proxy -}}
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
annotations:
|
|
{{.Values.global.createdByAnnotation}}: {{default (printf "linkerd/helm %s" .Values.global.linkerdVersion) .Values.global.cliVersion}}
|
|
labels:
|
|
app.kubernetes.io/name: controller
|
|
app.kubernetes.io/part-of: Linkerd
|
|
app.kubernetes.io/version: {{default .Values.global.linkerdVersion .Values.global.controllerImageVersion}}
|
|
{{.Values.global.controllerComponentLabel}}: controller
|
|
{{.Values.global.controllerNamespaceLabel}}: {{.Values.global.namespace}}
|
|
name: linkerd-controller
|
|
namespace: {{.Values.global.namespace}}
|
|
spec:
|
|
replicas: {{.Values.controllerReplicas}}
|
|
selector:
|
|
matchLabels:
|
|
{{.Values.global.controllerComponentLabel}}: controller
|
|
{{.Values.global.controllerNamespaceLabel}}: {{.Values.global.namespace}}
|
|
{{- include "partials.proxy.labels" $tree.Values.global.proxy | nindent 6}}
|
|
{{- if .Values.enablePodAntiAffinity }}
|
|
strategy:
|
|
rollingUpdate:
|
|
maxUnavailable: 1
|
|
{{- end }}
|
|
template:
|
|
metadata:
|
|
annotations:
|
|
{{.Values.global.createdByAnnotation}}: {{default (printf "linkerd/helm %s" .Values.global.linkerdVersion) .Values.global.cliVersion}}
|
|
{{- include "partials.proxy.annotations" .Values.global.proxy| nindent 8}}
|
|
{{- with .Values.global.podAnnotations }}{{ toYaml . | trim | nindent 8 }}{{- end }}
|
|
labels:
|
|
{{.Values.global.controllerComponentLabel}}: controller
|
|
{{.Values.global.controllerNamespaceLabel}}: {{.Values.global.namespace}}
|
|
{{.Values.global.workloadNamespaceLabel}}: {{.Values.global.namespace}}
|
|
{{- include "partials.proxy.labels" $tree.Values.global.proxy | nindent 8}}
|
|
{{- with .Values.global.podLabels }}{{ toYaml . | trim | nindent 8 }}{{- end }}
|
|
spec:
|
|
{{- if .Values.tolerations -}}
|
|
{{- include "linkerd.tolerations" . | nindent 6 }}
|
|
{{- end -}}
|
|
{{- include "linkerd.node-selector" . | nindent 6 }}
|
|
{{- if .Values.enablePodAntiAffinity -}}
|
|
{{- $local := dict "component" "controller" "label" .Values.global.controllerComponentLabel -}}
|
|
{{- include "linkerd.pod-affinity" $local | nindent 6 -}}
|
|
{{- end }}
|
|
containers:
|
|
- args:
|
|
- public-api
|
|
- -destination-addr=linkerd-dst.{{.Values.global.namespace}}.svc.{{.Values.global.clusterDomain}}:8086
|
|
- -controller-namespace={{.Values.global.namespace}}
|
|
- -log-level={{.Values.global.controllerLogLevel}}
|
|
- -cluster-domain={{.Values.global.clusterDomain}}
|
|
{{- if .Values.global.prometheusUrl }}
|
|
- -prometheus-url={{.Values.global.prometheusUrl}}
|
|
{{- else if .Values.prometheus.enabled }}
|
|
- -prometheus-url=http://linkerd-prometheus.{{.Values.global.namespace}}.svc.{{.Values.global.clusterDomain}}:9090
|
|
{{- end }}
|
|
{{- include "partials.linkerd.trace" . | nindent 8 -}}
|
|
image: {{.Values.controllerImage}}:{{default .Values.global.linkerdVersion .Values.global.controllerImageVersion}}
|
|
imagePullPolicy: {{.Values.global.imagePullPolicy}}
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /ping
|
|
port: 9995
|
|
initialDelaySeconds: 10
|
|
name: public-api
|
|
ports:
|
|
- containerPort: 8085
|
|
name: http
|
|
- containerPort: 9995
|
|
name: admin-http
|
|
readinessProbe:
|
|
failureThreshold: 7
|
|
httpGet:
|
|
path: /ready
|
|
port: 9995
|
|
{{- if .Values.publicAPIResources -}}
|
|
{{- include "partials.resources" .Values.publicAPIResources | nindent 8 }}
|
|
{{- end }}
|
|
securityContext:
|
|
runAsUser: {{.Values.controllerUID}}
|
|
{{- if not (empty .Values.publicAPIProxyResources) }}
|
|
{{- $r := merge .Values.publicAPIProxyResources .Values.global.proxy.resources }}
|
|
{{- $_ := set $tree.Values.global.proxy "resources" $r }}
|
|
{{- end }}
|
|
{{- include "partials.setControlPlaneTracing.proxy" $tree }}
|
|
- {{- include "partials.proxy" $tree | indent 8 | trimPrefix (repeat 7 " ") }}
|
|
{{ if not .Values.global.cniEnabled -}}
|
|
initContainers:
|
|
- {{- include "partials.proxy-init" . | indent 8 | trimPrefix (repeat 7 " ") }}
|
|
{{ end -}}
|
|
serviceAccountName: linkerd-controller
|
|
volumes:
|
|
{{ if .Values.global.controlPlaneTracing -}}
|
|
- {{- include "partials.proxy.volumes.labels" . | indent 8 | trimPrefix (repeat 7 " ") }}
|
|
{{ end -}}
|
|
{{ if not .Values.global.cniEnabled -}}
|
|
- {{- include "partials.proxyInit.volumes.xtables" . | indent 8 | trimPrefix (repeat 7 " ") }}
|
|
{{ end -}}
|
|
- {{- include "partials.proxy.volumes.identity" . | indent 8 | trimPrefix (repeat 7 " ") }}
|