blob: 69d615dcdb263c446c96d9fd7f45b9b825775ae8 [file] [log] [blame]
Mohammed Nasere04accd2023-01-15 20:07:27 -05001apiVersion: apps/v1
2kind: Deployment
3metadata:
4 name: {{ include "pxc-operator.fullname" . }}
Oleksandr K249d3db2023-12-06 16:35:23 +01005 namespace: {{ .Release.Namespace }}
Mohammed Nasere04accd2023-01-15 20:07:27 -05006 labels:
7{{ include "pxc-operator.labels" . | indent 4 }}
8spec:
9 replicas: {{ .Values.replicaCount }}
10 selector:
11 matchLabels:
12 app.kubernetes.io/component: operator
13 app.kubernetes.io/name: {{ include "pxc-operator.name" . }}
14 app.kubernetes.io/instance: {{ .Release.Name }}
15 app.kubernetes.io/part-of: {{ include "pxc-operator.name" . }}
16 strategy:
17 rollingUpdate:
18 maxUnavailable: 1
19 type: RollingUpdate
20 template:
21 metadata:
22 labels:
23 app.kubernetes.io/component: operator
24 app.kubernetes.io/name: {{ include "pxc-operator.name" . }}
25 app.kubernetes.io/instance: {{ .Release.Name }}
26 app.kubernetes.io/part-of: {{ include "pxc-operator.name" . }}
27 spec:
28 serviceAccountName: {{ include "pxc-operator.fullname" . }}
29 {{- with .Values.imagePullSecrets }}
30 imagePullSecrets:
31 {{- toYaml . | nindent 8 }}
32 {{- end }}
33 terminationGracePeriodSeconds: 600
34 containers:
okozachenko1203b7c2d322023-07-05 11:09:15 +000035 - name: percona-xtradb-cluster-operator
Mohammed Nasere04accd2023-01-15 20:07:27 -050036 image: {{ include "pxc-operator.image" . }}
37 imagePullPolicy: {{ .Values.imagePullPolicy }}
38 ports:
39 - containerPort: 8080
40 name: metrics
41 protocol: TCP
42 command:
43 - percona-xtradb-cluster-operator
Oleksandr K249d3db2023-12-06 16:35:23 +010044 {{- if .Values.containerSecurityContext.readOnlyRootFilesystem }}
45 volumeMounts:
46 - name: tmpdir
47 mountPath: /tmp
48 {{- end }}
Mohammed Nasere04accd2023-01-15 20:07:27 -050049 env:
50 - name: WATCH_NAMESPACE
51 {{- if .Values.watchAllNamespaces }}
52 value: ""
53 {{- else }}
okozachenko1203b7c2d322023-07-05 11:09:15 +000054 value: "{{ default .Release.Namespace .Values.watchNamespace }}"
Mohammed Nasere04accd2023-01-15 20:07:27 -050055 {{- end }}
56 - name: POD_NAME
57 valueFrom:
58 fieldRef:
59 fieldPath: metadata.name
60 - name: OPERATOR_NAME
61 value: {{ include "pxc-operator.fullname" . }}
okozachenko1203b7c2d322023-07-05 11:09:15 +000062 - name: LOG_STRUCTURED
63 value: "{{ .Values.logStructured }}"
64 - name: LOG_LEVEL
65 value: "{{ .Values.logLevel }}"
66 - name: DISABLE_TELEMETRY
67 value: "{{ .Values.disableTelemetry }}"
Mohammed Nasere04accd2023-01-15 20:07:27 -050068 livenessProbe:
69 failureThreshold: 3
70 httpGet:
71 path: /metrics
72 port: metrics
73 scheme: HTTP
74 resources:
75 {{- toYaml .Values.resources | nindent 12 }}
Oleksandr K249d3db2023-12-06 16:35:23 +010076 {{- with .Values.containerSecurityContext }}
77 securityContext:
78 {{- toYaml . | nindent 12 }}
79 {{- end }}
Mohammed Nasere04accd2023-01-15 20:07:27 -050080 {{- with .Values.nodeSelector }}
81 nodeSelector:
82 {{- toYaml . | nindent 8 }}
83 {{- end }}
84 {{- with .Values.affinity }}
85 affinity:
86 {{- toYaml . | nindent 8 }}
87 {{- end }}
88 {{- with .Values.tolerations }}
89 tolerations:
90 {{- toYaml . | nindent 8 }}
91 {{- end }}
Oleksandr K249d3db2023-12-06 16:35:23 +010092 {{- if .Values.containerSecurityContext.readOnlyRootFilesystem }}
93 volumes:
94 - name: tmpdir
95 emptyDir: {}
96 {{- end }}
Mohammed Nasere04accd2023-01-15 20:07:27 -050097{{- if .Values.watchAllNamespaces }}
98---
99apiVersion: v1
100kind: Service
101metadata:
102 name: {{ include "pxc-operator.name" . }}
103 labels:
104 name: {{ include "pxc-operator.name" . }}
105spec:
106 ports:
107 - port: 443
108 targetPort: 9443
109 selector:
110 app.kubernetes.io/name: {{ include "pxc-operator.name" . }}
111{{- end }}