forked from suse-edge/Factory
147 lines
4.8 KiB
YAML
147 lines
4.8 KiB
YAML
|
apiVersion: apps/v1
|
||
|
kind: Deployment
|
||
|
metadata:
|
||
|
name: {{ template "capi-operator.fullname" . }}
|
||
|
namespace: '{{ .Release.Namespace }}'
|
||
|
labels:
|
||
|
app: {{ template "capi-operator.name" . }}
|
||
|
app.kubernetes.io/name: {{ template "capi-operator.name" . }}
|
||
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||
|
app.kubernetes.io/component: "controller"
|
||
|
control-plane: controller-manager
|
||
|
clusterctl.cluster.x-k8s.io/core: capi-operator
|
||
|
{{- with .Values.deploymentLabels }}
|
||
|
{{- toYaml . | nindent 4 }}
|
||
|
{{- end }}
|
||
|
{{- with .Values.deploymentAnnotations }}
|
||
|
annotations:
|
||
|
{{- toYaml . | nindent 4 }}
|
||
|
{{- end }}
|
||
|
spec:
|
||
|
replicas: {{ .Values.replicaCount }}
|
||
|
selector:
|
||
|
matchLabels:
|
||
|
app.kubernetes.io/name: {{ template "capi-operator.name" . }}
|
||
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||
|
app.kubernetes.io/component: "controller"
|
||
|
control-plane: controller-manager
|
||
|
clusterctl.cluster.x-k8s.io/core: capi-operator
|
||
|
{{- with .Values.strategy }}
|
||
|
strategy:
|
||
|
{{- toYaml . | nindent 4 }}
|
||
|
{{- end }}
|
||
|
template:
|
||
|
metadata:
|
||
|
labels:
|
||
|
app: {{ template "capi-operator.name" . }}
|
||
|
app.kubernetes.io/name: {{ template "capi-operator.name" . }}
|
||
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||
|
app.kubernetes.io/component: "controller"
|
||
|
control-plane: controller-manager
|
||
|
clusterctl.cluster.x-k8s.io/core: capi-operator
|
||
|
{{- with .Values.podLabels }}
|
||
|
{{- toYaml . | nindent 8 }}
|
||
|
{{- end }}
|
||
|
{{- with .Values.podAnnotations }}
|
||
|
annotations:
|
||
|
{{- toYaml . | nindent 8 }}
|
||
|
{{- end }}
|
||
|
spec:
|
||
|
serviceAccountName: capi-operator-manager
|
||
|
automountServiceAccountToken: true
|
||
|
{{- with .Values.securityContext }}
|
||
|
securityContext:
|
||
|
{{- toYaml . | nindent 8 }}
|
||
|
{{- end }}
|
||
|
{{- with .Values.imagePullSecrets }}
|
||
|
imagePullSecrets:
|
||
|
{{- toYaml . | nindent 8 }}
|
||
|
{{- end }}
|
||
|
containers:
|
||
|
- args:
|
||
|
{{- if .Values.logLevel }}
|
||
|
- --v={{ .Values.logLevel }}
|
||
|
{{- end }}
|
||
|
{{- if .Values.healthAddr }}
|
||
|
- --health-addr={{ .Values.healthAddr }}
|
||
|
{{- end }}
|
||
|
{{- if .Values.metricsBindAddr }}
|
||
|
- --metrics-bind-addr={{ .Values.metricsBindAddr }}
|
||
|
{{- end }}
|
||
|
{{- if .Values.diagnosticsAddress }}
|
||
|
- --diagnostics-address={{ .Values.diagnosticsAddress }}
|
||
|
{{- end }}
|
||
|
{{- if .Values.insecureDiagnostics }}
|
||
|
- --insecure-diagnostics={{ .Values.insecureDiagnostics }}
|
||
|
{{- end }}
|
||
|
{{- with .Values.leaderElection }}
|
||
|
- --leader-elect={{ .enabled }}
|
||
|
{{- if .leaseDuration }}
|
||
|
- --leader-elect-lease-duration={{ .leaseDuration }}
|
||
|
{{- end }}
|
||
|
{{- if .renewDeadline }}
|
||
|
- --leader-elect-renew-deadline={{ .renewDeadline }}
|
||
|
{{- end }}
|
||
|
{{- if .retryPeriod }}
|
||
|
- --leader-elect-retry-period={{ .retryPeriod }}
|
||
|
{{- end }}
|
||
|
{{- end }}
|
||
|
command:
|
||
|
- /manager
|
||
|
{{- with .Values.image.manager }}
|
||
|
image: "{{- if .registry -}}{{ .registry }}/{{- end -}}{{ .repository }}{{- if (.digest) -}} @{{ .digest }}{{- else -}}:{{ default $.Chart.AppVersion .tag }} {{- end -}}"
|
||
|
{{- end }}
|
||
|
imagePullPolicy: {{ .Values.image.manager.pullPolicy }}
|
||
|
name: manager
|
||
|
ports:
|
||
|
- containerPort: 9443
|
||
|
name: webhook-server
|
||
|
protocol: TCP
|
||
|
- containerPort: {{ ( split ":" $.Values.metricsBindAddr)._1 | int }}
|
||
|
name: metrics
|
||
|
protocol: TCP
|
||
|
{{- with .Values.resources.manager }}
|
||
|
resources:
|
||
|
{{- toYaml . | nindent 12 }}
|
||
|
{{- end }}
|
||
|
{{- with .Values.env.manager }}
|
||
|
env:
|
||
|
{{- toYaml . | nindent 12 }}
|
||
|
{{- end }}
|
||
|
{{- with .Values.containerSecurityContext.manager }}
|
||
|
securityContext:
|
||
|
{{- toYaml . | nindent 12 }}
|
||
|
{{- end }}
|
||
|
{{- with .Values.volumeMounts.manager }}
|
||
|
volumeMounts:
|
||
|
{{- toYaml . | nindent 12 }}
|
||
|
{{- end }}
|
||
|
terminationGracePeriodSeconds: 10
|
||
|
{{- with .Values.volumes }}
|
||
|
volumes:
|
||
|
{{- toYaml . | nindent 8 }}
|
||
|
{{- end }}
|
||
|
{{- with .Values.nodeSelector }}
|
||
|
nodeSelector:
|
||
|
{{- toYaml . | nindent 8 }}
|
||
|
{{- end }}
|
||
|
{{- with .Values.affinity }}
|
||
|
affinity:
|
||
|
{{- toYaml . | nindent 8 }}
|
||
|
{{- end }}
|
||
|
{{- with .Values.tolerations }}
|
||
|
tolerations:
|
||
|
{{- toYaml . | nindent 8 }}
|
||
|
{{- end }}
|
||
|
{{- with .Values.topologySpreadConstraints }}
|
||
|
topologySpreadConstraints:
|
||
|
{{- toYaml . | nindent 8 }}
|
||
|
{{- end }}
|
||
|
{{- with .Values.podDnsPolicy }}
|
||
|
dnsPolicy: {{ . }}
|
||
|
{{- end }}
|
||
|
{{- with .Values.podDnsConfig }}
|
||
|
dnsConfig:
|
||
|
{{- toYaml . | nindent 8 }}
|
||
|
{{- end }}
|