Mohammed Naser | e04accd | 2023-01-15 20:07:27 -0500 | [diff] [blame] | 1 | apiVersion: apps/v1 |
| 2 | kind: Deployment |
| 3 | metadata: |
| 4 | name: {{ include "pxc-operator.fullname" . }} |
Oleksandr K | 249d3db | 2023-12-06 16:35:23 +0100 | [diff] [blame] | 5 | namespace: {{ .Release.Namespace }} |
Mohammed Naser | e04accd | 2023-01-15 20:07:27 -0500 | [diff] [blame] | 6 | labels: |
| 7 | {{ include "pxc-operator.labels" . | indent 4 }} |
| 8 | spec: |
| 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: |
okozachenko1203 | b7c2d32 | 2023-07-05 11:09:15 +0000 | [diff] [blame] | 35 | - name: percona-xtradb-cluster-operator |
Mohammed Naser | e04accd | 2023-01-15 20:07:27 -0500 | [diff] [blame] | 36 | 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 K | 249d3db | 2023-12-06 16:35:23 +0100 | [diff] [blame] | 44 | {{- if .Values.containerSecurityContext.readOnlyRootFilesystem }} |
| 45 | volumeMounts: |
| 46 | - name: tmpdir |
| 47 | mountPath: /tmp |
| 48 | {{- end }} |
Mohammed Naser | e04accd | 2023-01-15 20:07:27 -0500 | [diff] [blame] | 49 | env: |
| 50 | - name: WATCH_NAMESPACE |
| 51 | {{- if .Values.watchAllNamespaces }} |
| 52 | value: "" |
| 53 | {{- else }} |
okozachenko1203 | b7c2d32 | 2023-07-05 11:09:15 +0000 | [diff] [blame] | 54 | value: "{{ default .Release.Namespace .Values.watchNamespace }}" |
Mohammed Naser | e04accd | 2023-01-15 20:07:27 -0500 | [diff] [blame] | 55 | {{- end }} |
| 56 | - name: POD_NAME |
| 57 | valueFrom: |
| 58 | fieldRef: |
| 59 | fieldPath: metadata.name |
| 60 | - name: OPERATOR_NAME |
| 61 | value: {{ include "pxc-operator.fullname" . }} |
okozachenko1203 | b7c2d32 | 2023-07-05 11:09:15 +0000 | [diff] [blame] | 62 | - name: LOG_STRUCTURED |
| 63 | value: "{{ .Values.logStructured }}" |
| 64 | - name: LOG_LEVEL |
| 65 | value: "{{ .Values.logLevel }}" |
| 66 | - name: DISABLE_TELEMETRY |
| 67 | value: "{{ .Values.disableTelemetry }}" |
Mohammed Naser | e04accd | 2023-01-15 20:07:27 -0500 | [diff] [blame] | 68 | livenessProbe: |
| 69 | failureThreshold: 3 |
| 70 | httpGet: |
| 71 | path: /metrics |
| 72 | port: metrics |
| 73 | scheme: HTTP |
| 74 | resources: |
| 75 | {{- toYaml .Values.resources | nindent 12 }} |
Oleksandr K | 249d3db | 2023-12-06 16:35:23 +0100 | [diff] [blame] | 76 | {{- with .Values.containerSecurityContext }} |
| 77 | securityContext: |
| 78 | {{- toYaml . | nindent 12 }} |
| 79 | {{- end }} |
Mohammed Naser | e04accd | 2023-01-15 20:07:27 -0500 | [diff] [blame] | 80 | {{- 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 K | 249d3db | 2023-12-06 16:35:23 +0100 | [diff] [blame] | 92 | {{- if .Values.containerSecurityContext.readOnlyRootFilesystem }} |
| 93 | volumes: |
| 94 | - name: tmpdir |
| 95 | emptyDir: {} |
| 96 | {{- end }} |
Mohammed Naser | e04accd | 2023-01-15 20:07:27 -0500 | [diff] [blame] | 97 | {{- if .Values.watchAllNamespaces }} |
| 98 | --- |
| 99 | apiVersion: v1 |
| 100 | kind: Service |
| 101 | metadata: |
| 102 | name: {{ include "pxc-operator.name" . }} |
| 103 | labels: |
| 104 | name: {{ include "pxc-operator.name" . }} |
| 105 | spec: |
| 106 | ports: |
| 107 | - port: 443 |
| 108 | targetPort: 9443 |
| 109 | selector: |
| 110 | app.kubernetes.io/name: {{ include "pxc-operator.name" . }} |
| 111 | {{- end }} |