github.com/verrazzano/verrazzano@v1.7.0/platform-operator/thirdparty/charts/coherence-operator/templates/deployment.yaml (about)

     1  {{- if ne .Values.webhookCertType "manual" }}
     2  ---
     3  apiVersion: v1
     4  kind: Secret
     5  metadata:
     6    name: {{ default "coherence-webhook-server-cert" .Values.webhookCertSecret }}
     7    namespace: {{ .Release.Namespace }}
     8  {{- end }}
     9  ---
    10  apiVersion: v1
    11  kind: Service
    12  metadata:
    13    name: coherence-operator-webhook
    14    namespace: {{ .Release.Namespace }}
    15    labels:
    16      control-plane: coherence
    17      app.kubernetes.io/name: coherence-operator
    18      app.kubernetes.io/instance: coherence-operator-manager
    19      app.kubernetes.io/version: "3.2.11"
    20      app.kubernetes.io/component: webhook
    21      app.kubernetes.io/part-of: coherence-operator
    22      app.kubernetes.io/managed-by: helm
    23  spec:
    24    ports:
    25    - name: webhook
    26      port: 443
    27      targetPort: 9443
    28    selector:
    29      app.kubernetes.io/name: coherence-operator
    30      app.kubernetes.io/instance: coherence-operator-manager
    31      app.kubernetes.io/version: "3.2.11"
    32      app.kubernetes.io/component: manager
    33  ---
    34  apiVersion: v1
    35  kind: Service
    36  metadata:
    37    name: coherence-operator-rest
    38    namespace: {{ .Release.Namespace }}
    39    labels:
    40      control-plane: coherence
    41      app.kubernetes.io/name: coherence-operator
    42      app.kubernetes.io/instance: coherence-operator-rest
    43      app.kubernetes.io/version: "3.2.11"
    44      app.kubernetes.io/component: rest
    45      app.kubernetes.io/part-of: coherence-operator
    46      app.kubernetes.io/managed-by: helm
    47  spec:
    48    ports:
    49    - name: http-rest
    50      port: 8000
    51      targetPort: 8000
    52    selector:
    53      app.kubernetes.io/name: coherence-operator
    54      app.kubernetes.io/instance: coherence-operator-manager
    55      app.kubernetes.io/version: "3.2.11"
    56      app.kubernetes.io/component: manager
    57  ---
    58  apiVersion: apps/v1
    59  kind: Deployment
    60  metadata:
    61    name: coherence-operator
    62    namespace: {{ .Release.Namespace }}
    63    labels:
    64      control-plane: coherence
    65      app.kubernetes.io/name: coherence-operator
    66      app.kubernetes.io/instance: coherence-operator-manager
    67      app.kubernetes.io/version: "3.2.11"
    68      app.kubernetes.io/component: manager
    69      app.kubernetes.io/part-of: coherence-operator
    70      app.kubernetes.io/managed-by: helm
    71      app.kubernetes.io/created-by: controller-manager
    72  {{- if .Values.deploymentLabels }}
    73  {{ toYaml .Values.deploymentLabels | indent 4 }}
    74  {{- end }}
    75  {{- if .Values.deploymentAnnotations }}
    76    annotations:
    77  {{ toYaml .Values.deploymentAnnotations | indent 4 }}
    78  {{- end }}
    79  spec:
    80    replicas: {{ default 3 .Values.replicas }}
    81    selector:
    82      matchLabels:
    83        control-plane: coherence
    84    template:
    85      metadata:
    86        labels:
    87          control-plane: coherence
    88          app.kubernetes.io/name: coherence-operator
    89          app.kubernetes.io/instance: coherence-operator-manager
    90          app.kubernetes.io/version: "3.2.11"
    91          app.kubernetes.io/component: manager
    92          app.kubernetes.io/part-of: coherence-operator
    93          app.kubernetes.io/managed-by: helm
    94          app.kubernetes.io/created-by: controller-manager
    95  {{- if .Values.labels }}
    96  {{ toYaml .Values.labels | indent 8 }}
    97  {{- end }}
    98  {{- if .Values.annotations }}
    99        annotations:
   100  {{ toYaml .Values.annotations | indent 8 }}
   101  {{- end }}
   102      spec:
   103        serviceAccountName: {{ default "coherence-operator" .Values.serviceAccountName }}
   104  {{- if .Values.podSecurityContext }}
   105        securityContext:
   106  {{ toYaml .Values.podSecurityContext | indent 8 }}
   107  {{- end }}
   108        containers:
   109        - name: manager
   110          args:
   111          - operator
   112          - --enable-leader-election
   113  {{- if (eq .Values.clusterRoles false) }}
   114          - --enable-webhook=false
   115          - --install-crd=false
   116  {{- else }}
   117  {{- if (eq .Values.webhooks false) }}
   118          - --enable-webhook=false
   119  {{- end }}
   120  {{- end }}
   121          command:
   122          - "/files/runner"
   123          env:
   124          - name: OPERATOR_NAMESPACE
   125            valueFrom:
   126              fieldRef:
   127                fieldPath: metadata.namespace
   128          - name: OPERATOR_NAME
   129            valueFrom:
   130              fieldRef:
   131                fieldPath: metadata.name
   132          - name: WEBHOOK_SERVICE
   133            value: coherence-operator-webhook
   134          - name: WEBHOOK_SECRET
   135            value: {{ default "coherence-webhook-server-cert" .Values.webhookCertSecret }}
   136          - name: SERVICE_NAME
   137            value: coherence-operator-rest
   138          - name: CERT_TYPE
   139            value: {{ default "self-signed" .Values.webhookCertType | quote }}
   140          - name: COHERENCE_IMAGE
   141  {{- if kindIs "string" .Values.defaultCoherenceImage }}
   142            value: {{ .Values.defaultCoherenceImage | quote }}
   143  {{- else }}
   144            value: {{ printf "%s/%s:%s" .Values.defaultCoherenceImage.registry .Values.defaultCoherenceImage.name .Values.defaultCoherenceImage.tag | quote }}
   145  {{- end }}
   146          - name: RACK_LABEL
   147            value: {{ .Values.rackLabel | quote }}
   148          - name: SITE_LABEL
   149            value: {{ .Values.siteLabel | quote }}
   150          - name: OPERATOR_IMAGE
   151  {{- if kindIs "string" .Values.image }}
   152            value: {{ .Values.image | quote }}
   153  {{- else }}
   154            value: {{ printf "%s/%s:%s" .Values.image.registry .Values.image.name .Values.image.tag | quote }}
   155  {{- end }}
   156          - name: WATCH_NAMESPACE
   157  {{- if .Values.onlySameNamespace }}
   158            value: {{ .Release.Namespace | quote }}
   159  {{- else }}
   160  {{-   if .Values.clusterRoles }}
   161            value: {{ .Values.watchNamespaces | quote }}
   162  {{-   else }}
   163            value: {{ .Release.Namespace | quote }}
   164  {{-   end }}
   165  {{- end }}
   166  {{- if kindIs "string" .Values.image }}
   167          image: {{ .Values.image | quote }}
   168  {{- else }}
   169          image: {{ printf "%s/%s:%s" .Values.image.registry .Values.image.name .Values.image.tag | quote }}
   170  {{- end }}
   171          ports:
   172          - containerPort: 8000
   173            name: operator
   174            protocol: TCP
   175          - name: webhook-server
   176            containerPort: 9443
   177            protocol: TCP
   178          - containerPort: 8080
   179            name: metrics
   180            protocol: TCP
   181          - containerPort: 8088
   182            name: health
   183            protocol: TCP
   184          volumeMounts:
   185          - mountPath: /tmp/k8s-webhook-server/serving-certs
   186            name: cert
   187            readOnly: true
   188          readinessProbe:
   189            httpGet:
   190              port: health
   191              path: /readyz
   192            initialDelaySeconds: {{ default 10 .Values.readinessProbe.initialDelaySeconds }}
   193            periodSeconds: {{ default 10 .Values.readinessProbe.periodSeconds }}
   194            failureThreshold: {{ default 3 .Values.readinessProbe.failureThreshold }}
   195          livenessProbe:
   196            httpGet:
   197              port: health
   198              path: /healthz
   199            initialDelaySeconds: {{ default 10 .Values.livenessProbe.initialDelaySeconds }}
   200            periodSeconds: {{ default 10 .Values.livenessProbe.periodSeconds }}
   201            failureThreshold: {{ default 3 .Values.livenessProbe.failureThreshold }}
   202  {{- if .Values.resources }}
   203          resources:
   204  {{ toYaml .Values.resources | indent 10 }}
   205  {{- end }}
   206  {{- if .Values.securityContext }}
   207          securityContext:
   208  {{ toYaml .Values.securityContext | indent 10 }}
   209  {{- end }}
   210  {{- if .Values.imagePullSecrets }}
   211        imagePullSecrets:
   212  {{ toYaml .Values.imagePullSecrets | indent 8 }}
   213  {{- end }}
   214  {{- if .Values.nodeSelector }}
   215        nodeSelector:
   216  {{ toYaml .Values.nodeSelector | indent 8 }}
   217  {{- end }}
   218        terminationGracePeriodSeconds: 10
   219  {{- if .Values.tolerations }}
   220        tolerations:
   221  {{ toYaml .Values.tolerations | indent 8 }}
   222  {{- end }}
   223  {{- if .Values.affinity }}
   224        affinity:
   225  {{ toYaml .Values.affinity | indent 8 }}
   226  {{- else }}
   227        affinity:
   228          podAntiAffinity:
   229            preferredDuringSchedulingIgnoredDuringExecution:
   230              - podAffinityTerm:
   231                  topologyKey: "topology.kubernetes.io/zone"
   232                  labelSelector:
   233                    matchLabels:
   234                      control-plane: coherence
   235                      app.kubernetes.io/name: coherence-operator
   236                      app.kubernetes.io/instance: coherence-operator-manager
   237                      app.kubernetes.io/version: "3.2.11"
   238                weight: 50
   239              - podAffinityTerm:
   240                  topologyKey: "oci.oraclecloud.com/fault-domain"
   241                  labelSelector:
   242                    matchLabels:
   243                      control-plane: coherence
   244                      app.kubernetes.io/name: coherence-operator
   245                      app.kubernetes.io/instance: coherence-operator-manager
   246                      app.kubernetes.io/version: "3.2.11"
   247                weight: 10
   248              - podAffinityTerm:
   249                  topologyKey: "kubernetes.io/hostname"
   250                  labelSelector:
   251                    matchLabels:
   252                      control-plane: coherence
   253                      app.kubernetes.io/name: coherence-operator
   254                      app.kubernetes.io/instance: coherence-operator-manager
   255                      app.kubernetes.io/version: "3.2.11"
   256                weight: 1
   257  {{- end }}
   258        volumes:
   259        - name: cert
   260          secret:
   261            defaultMode: 420
   262            secretName: {{ .Values.webhookCertSecret }}