blob: 5cb8530d4c0e6dc13a80696c311b6eccc5e2b74a [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:
Mohammed Naser65cda132024-05-02 14:34:08 -040022 {{- with .Values.podAnnotations }}
23 annotations:
24 {{- toYaml . | nindent 8 }}
25 {{- end }}
Mohammed Nasere04accd2023-01-15 20:07:27 -050026 labels:
27 app.kubernetes.io/component: operator
28 app.kubernetes.io/name: {{ include "pxc-operator.name" . }}
29 app.kubernetes.io/instance: {{ .Release.Name }}
30 app.kubernetes.io/part-of: {{ include "pxc-operator.name" . }}
31 spec:
32 serviceAccountName: {{ include "pxc-operator.fullname" . }}
33 {{- with .Values.imagePullSecrets }}
34 imagePullSecrets:
35 {{- toYaml . | nindent 8 }}
36 {{- end }}
37 terminationGracePeriodSeconds: 600
38 containers:
okozachenko1203b7c2d322023-07-05 11:09:15 +000039 - name: percona-xtradb-cluster-operator
Mohammed Nasere04accd2023-01-15 20:07:27 -050040 image: {{ include "pxc-operator.image" . }}
41 imagePullPolicy: {{ .Values.imagePullPolicy }}
42 ports:
43 - containerPort: 8080
44 name: metrics
45 protocol: TCP
46 command:
47 - percona-xtradb-cluster-operator
Oleksandr K249d3db2023-12-06 16:35:23 +010048 {{- if .Values.containerSecurityContext.readOnlyRootFilesystem }}
49 volumeMounts:
50 - name: tmpdir
51 mountPath: /tmp
52 {{- end }}
Mohammed Nasere04accd2023-01-15 20:07:27 -050053 env:
54 - name: WATCH_NAMESPACE
55 {{- if .Values.watchAllNamespaces }}
56 value: ""
57 {{- else }}
okozachenko1203b7c2d322023-07-05 11:09:15 +000058 value: "{{ default .Release.Namespace .Values.watchNamespace }}"
Mohammed Nasere04accd2023-01-15 20:07:27 -050059 {{- end }}
60 - name: POD_NAME
61 valueFrom:
62 fieldRef:
63 fieldPath: metadata.name
64 - name: OPERATOR_NAME
65 value: {{ include "pxc-operator.fullname" . }}
okozachenko1203b7c2d322023-07-05 11:09:15 +000066 - name: LOG_STRUCTURED
67 value: "{{ .Values.logStructured }}"
68 - name: LOG_LEVEL
69 value: "{{ .Values.logLevel }}"
70 - name: DISABLE_TELEMETRY
71 value: "{{ .Values.disableTelemetry }}"
Mohammed Naser65cda132024-05-02 14:34:08 -040072 {{- if .Values.extraEnvVars }}
73 {{- toYaml .Values.extraEnvVars | nindent 12 }}
74 {{- end }}
Mohammed Nasere04accd2023-01-15 20:07:27 -050075 livenessProbe:
76 failureThreshold: 3
77 httpGet:
78 path: /metrics
79 port: metrics
80 scheme: HTTP
81 resources:
82 {{- toYaml .Values.resources | nindent 12 }}
Oleksandr K249d3db2023-12-06 16:35:23 +010083 {{- with .Values.containerSecurityContext }}
84 securityContext:
85 {{- toYaml . | nindent 12 }}
86 {{- end }}
Mohammed Nasere04accd2023-01-15 20:07:27 -050087 {{- with .Values.nodeSelector }}
88 nodeSelector:
89 {{- toYaml . | nindent 8 }}
90 {{- end }}
91 {{- with .Values.affinity }}
92 affinity:
93 {{- toYaml . | nindent 8 }}
94 {{- end }}
95 {{- with .Values.tolerations }}
96 tolerations:
97 {{- toYaml . | nindent 8 }}
98 {{- end }}
Oleksandr K249d3db2023-12-06 16:35:23 +010099 {{- if .Values.containerSecurityContext.readOnlyRootFilesystem }}
100 volumes:
101 - name: tmpdir
102 emptyDir: {}
103 {{- end }}
Mohammed Naser65cda132024-05-02 14:34:08 -0400104{{- if or .Values.watchNamespace .Values.watchAllNamespaces }}
Mohammed Nasere04accd2023-01-15 20:07:27 -0500105---
106apiVersion: v1
107kind: Service
108metadata:
Mohammed Naser65cda132024-05-02 14:34:08 -0400109 name: percona-xtradb-cluster-operator
110 namespace: {{ .Release.Namespace }}
Mohammed Nasere04accd2023-01-15 20:07:27 -0500111 labels:
Mohammed Naser65cda132024-05-02 14:34:08 -0400112 name: percona-xtradb-cluster-operator
Mohammed Nasere04accd2023-01-15 20:07:27 -0500113spec:
114 ports:
115 - port: 443
116 targetPort: 9443
117 selector:
118 app.kubernetes.io/name: {{ include "pxc-operator.name" . }}
119{{- end }}