Jakub Latusek | 2776cf8 | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 1 | {{/* |
Sylvain Desbureaux | d1ca1ee | 2020-04-07 14:52:20 +0200 | [diff] [blame] | 2 | # Copyright © 2020, Nordix Foundation |
| 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. |
Jakub Latusek | 2776cf8 | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 15 | */}} |
Sylvain Desbureaux | d1ca1ee | 2020-04-07 14:52:20 +0200 | [diff] [blame] | 16 | |
| 17 | apiVersion: apps/v1 |
| 18 | kind: Deployment |
| 19 | metadata: {{- include "common.resourceMetadata" . | nindent 2 }} |
| 20 | spec: |
| 21 | replicas: {{ .Values.replicaCount }} |
| 22 | selector: {{- include "common.selectors" . | nindent 4 }} |
| 23 | template: |
| 24 | metadata: {{- include "common.templateMetadata" . | nindent 6 }} |
Radoslaw Chmiel | 527662f | 2022-06-02 19:23:26 +0200 | [diff] [blame] | 25 | {{- if (include "common.onServiceMesh" . ) }} |
| 26 | annotations: |
| 27 | {{- if eq ( .Values.global.serviceMesh.engine ) "linkerd" }} |
| 28 | linkerd.io/inject: disabled |
| 29 | {{- end }} |
| 30 | {{- if eq ( .Values.global.serviceMesh.engine ) "istio" }} |
| 31 | sidecar.istio.io/rewriteAppHTTPProbers: "false" |
| 32 | proxy.istio.io/config: '{ "holdApplicationUntilProxyStarts": true }' |
| 33 | {{- end }} |
| 34 | {{- end }} |
Sylvain Desbureaux | d1ca1ee | 2020-04-07 14:52:20 +0200 | [diff] [blame] | 35 | spec: |
andreas-geissler | 6ce5c09 | 2021-07-19 17:37:10 +0200 | [diff] [blame] | 36 | imagePullSecrets: |
| 37 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |
Sylvain Desbureaux | d1ca1ee | 2020-04-07 14:52:20 +0200 | [diff] [blame] | 38 | initContainers: |
| 39 | - name: {{ include "common.name" . }}-db-readiness |
| 40 | command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 41 | - /app/ready.py |
Sylvain Desbureaux | d1ca1ee | 2020-04-07 14:52:20 +0200 | [diff] [blame] | 42 | args: |
| 43 | - --container-name |
| 44 | {{- if .Values.global.mariadbGalera.localCluster }} |
| 45 | - ejbca-galera |
| 46 | {{- else }} |
| 47 | - ejbca-config |
| 48 | {{- end }} |
| 49 | env: |
| 50 | - name: NAMESPACE |
| 51 | valueFrom: |
| 52 | fieldRef: |
| 53 | apiVersion: v1 |
| 54 | fieldPath: metadata.namespace |
Sylvain Desbureaux | 5ee4dd4 | 2020-11-21 22:52:46 +0100 | [diff] [blame] | 55 | image: {{ include "repositoryGenerator.image.readiness" . }} |
Sylvain Desbureaux | d1ca1ee | 2020-04-07 14:52:20 +0200 | [diff] [blame] | 56 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 57 | containers: |
| 58 | - name: {{ include "common.name" . }}-ejbca |
Sylvain Desbureaux | 5ee4dd4 | 2020-11-21 22:52:46 +0100 | [diff] [blame] | 59 | image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.ejbca.image }} |
Sylvain Desbureaux | d1ca1ee | 2020-04-07 14:52:20 +0200 | [diff] [blame] | 60 | imagePullPolicy: {{ .Values.pullPolicy }} |
| 61 | lifecycle: |
| 62 | postStart: |
| 63 | exec: |
Radoslaw Chmiel | 527662f | 2022-06-02 19:23:26 +0200 | [diff] [blame] | 64 | command: |
| 65 | - sh |
| 66 | - -c |
| 67 | - | |
| 68 | sleep 60; /opt/primekey/scripts/ejbca-config.sh |
Sylvain Desbureaux | d1ca1ee | 2020-04-07 14:52:20 +0200 | [diff] [blame] | 69 | volumeMounts: |
| 70 | - name: "{{ include "common.fullname" . }}-volume" |
| 71 | mountPath: /opt/primekey/scripts/ |
Remigiusz Janeczek | ed6e621 | 2020-09-08 13:00:50 +0200 | [diff] [blame] | 72 | - name: "{{ include "common.fullname" . }}-profiles-volume" |
| 73 | mountPath: /opt/primekey/custom_profiles/ |
Sylvain Desbureaux | d1ca1ee | 2020-04-07 14:52:20 +0200 | [diff] [blame] | 74 | ports: {{ include "common.containerPorts" . | nindent 10 }} |
| 75 | env: |
| 76 | - name: INITIAL_ADMIN |
| 77 | value: ";PublicAccessAuthenticationToken:TRANSPORT_ANY;" |
Piotr Marcinkiewicz | 31dceea | 2021-06-29 16:15:49 +0200 | [diff] [blame] | 78 | - name: NO_CREATE_CA |
| 79 | value: "true" |
Sylvain Desbureaux | d1ca1ee | 2020-04-07 14:52:20 +0200 | [diff] [blame] | 80 | - name: DATABASE_JDBC_URL |
| 81 | value: jdbc:mariadb://{{ include "common.mariadbService" . }}:{{ include "common.mariadbPort" . }}/{{ .Values.mysqlDatabase }} |
| 82 | - name: DATABASE_USER |
| 83 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "ejbca-db-secret" "key" "login") | indent 10 }} |
| 84 | - name: DATABASE_PASSWORD |
| 85 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "ejbca-db-secret" "key" "password") | indent 10 }} |
| 86 | - name: RA_IAK |
| 87 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "ejbca-server-ra-iak" "key" "password") | indent 10 }} |
| 88 | - name: CLIENT_IAK |
| 89 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "ejbca-server-client-iak" "key" "password") | indent 10 }} |
| 90 | livenessProbe: |
| 91 | httpGet: |
| 92 | port: {{ .Values.liveness.port }} |
| 93 | path: {{ .Values.liveness.path }} |
| 94 | scheme: HTTPS |
| 95 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 96 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 97 | readinessProbe: |
| 98 | httpGet: |
| 99 | port: {{ .Values.readiness.port }} |
| 100 | path: {{ .Values.readiness.path }} |
| 101 | scheme: HTTPS |
| 102 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 103 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 104 | {{- if .Values.nodeSelector }} |
| 105 | nodeSelector: {{ toYaml .Values.nodeSelector | nindent 10 }} |
| 106 | {{- end -}} |
| 107 | {{- if .Values.affinity }} |
| 108 | affinity: {{ toYaml .Values.affinity | nindent 10 }} |
| 109 | {{- end }} |
Sylvain Desbureaux | 1539273 | 2020-10-22 09:49:54 +0200 | [diff] [blame] | 110 | resources: {{ include "common.resources" . | nindent 10 }} |
farida azmy | e273f78 | 2021-10-02 16:04:52 +0200 | [diff] [blame] | 111 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
Sylvain Desbureaux | d1ca1ee | 2020-04-07 14:52:20 +0200 | [diff] [blame] | 112 | volumes: |
| 113 | - configMap: |
| 114 | name: "{{ include "common.fullname" . }}-config-script" |
| 115 | defaultMode: 0755 |
| 116 | name: "{{ include "common.fullname" . }}-volume" |
Remigiusz Janeczek | ed6e621 | 2020-09-08 13:00:50 +0200 | [diff] [blame] | 117 | - configMap: |
| 118 | name: "{{ include "common.fullname" . }}-profiles" |
| 119 | defaultMode: 0755 |
| 120 | name: "{{ include "common.fullname" . }}-profiles-volume" |