|
| 1 | +# |
| 2 | +# Copyright Java Operator SDK Authors |
| 3 | +# |
| 4 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +# you may not use this file except in compliance with the License. |
| 6 | +# You may obtain a copy of the License at |
| 7 | +# |
| 8 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +# |
| 10 | +# Unless required by applicable law or agreed to in writing, software |
| 11 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +# See the License for the specific language governing permissions and |
| 14 | +# limitations under the License. |
| 15 | +# |
| 16 | + |
| 17 | +apiVersion: apps/v1 |
| 18 | +kind: Deployment |
| 19 | +metadata: |
| 20 | + name: {{ include "generic-operator.fullname" . }} |
| 21 | + labels: |
| 22 | + {{- include "generic-operator.labels" . | nindent 4 }} |
| 23 | +spec: |
| 24 | + replicas: {{ .Values.replicaCount }} |
| 25 | + selector: |
| 26 | + matchLabels: |
| 27 | + {{- include "generic-operator.selectorLabels" . | nindent 6 }} |
| 28 | + template: |
| 29 | + metadata: |
| 30 | + annotations: |
| 31 | + checksum/config: {{ .Values.operatorConfig | toJson | sha256sum }} |
| 32 | + {{- with .Values.podAnnotations }} |
| 33 | + {{- toYaml . | nindent 8 }} |
| 34 | + {{- end }} |
| 35 | + labels: |
| 36 | + {{- include "generic-operator.selectorLabels" . | nindent 8 }} |
| 37 | + spec: |
| 38 | + {{- with .Values.podSecurityContext }} |
| 39 | + securityContext: |
| 40 | + {{- toYaml . | nindent 8 }} |
| 41 | + {{- end }} |
| 42 | + {{- with .Values.imagePullSecrets }} |
| 43 | + imagePullSecrets: |
| 44 | + {{- toYaml . | nindent 8 }} |
| 45 | + {{- end }} |
| 46 | + serviceAccountName: {{ include "generic-operator.serviceAccountName" . }} |
| 47 | + {{- with .Values.extraInitContainers }} |
| 48 | + initContainers: |
| 49 | + {{- toYaml . | nindent 8 }} |
| 50 | + {{- end }} |
| 51 | + containers: |
| 52 | + - name: operator |
| 53 | + securityContext: |
| 54 | + {{- toYaml .Values.securityContext | nindent 12 }} |
| 55 | + image: "{{ required "A valid .Values.image.repository is required" .Values.image.repository }}:{{ include "generic-operator.imageTag" . }}" |
| 56 | + imagePullPolicy: {{ .Values.image.pullPolicy }} |
| 57 | + env: |
| 58 | + - name: OPERATOR_NAMESPACE |
| 59 | + valueFrom: |
| 60 | + fieldRef: |
| 61 | + fieldPath: metadata.namespace |
| 62 | + {{- if .Values.operator.watchNamespace }} |
| 63 | + - name: WATCH_NAMESPACE |
| 64 | + value: {{ .Values.operator.watchNamespace | quote }} |
| 65 | + {{- end }} |
| 66 | + {{- with .Values.operator.env }} |
| 67 | + {{- toYaml . | nindent 8 }} |
| 68 | + {{- end }} |
| 69 | + resources: |
| 70 | + {{- toYaml .Values.resources | nindent 12 }} |
| 71 | + volumeMounts: |
| 72 | + - name: config |
| 73 | + mountPath: /config |
| 74 | + readOnly: true |
| 75 | + {{- with .Values.extraVolumeMounts }} |
| 76 | + {{- toYaml . | nindent 8 }} |
| 77 | + {{- end }} |
| 78 | + {{- with .Values.extraContainers }} |
| 79 | + {{- toYaml . | nindent 6 }} |
| 80 | + {{- end }} |
| 81 | + volumes: |
| 82 | + - name: config |
| 83 | + configMap: |
| 84 | + name: {{ include "generic-operator.fullname" . }}-config |
| 85 | + {{- with .Values.extraVolumes }} |
| 86 | + {{- toYaml . | nindent 6 }} |
| 87 | + {{- end }} |
0 commit comments