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 }} |
| 25 | spec: |
andreas-geissler | 6ce5c09 | 2021-07-19 17:37:10 +0200 | [diff] [blame^] | 26 | imagePullSecrets: |
| 27 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |
Sylvain Desbureaux | d1ca1ee | 2020-04-07 14:52:20 +0200 | [diff] [blame] | 28 | initContainers: |
| 29 | - name: {{ include "common.name" . }}-db-readiness |
| 30 | command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 31 | - /app/ready.py |
Sylvain Desbureaux | d1ca1ee | 2020-04-07 14:52:20 +0200 | [diff] [blame] | 32 | args: |
| 33 | - --container-name |
| 34 | {{- if .Values.global.mariadbGalera.localCluster }} |
| 35 | - ejbca-galera |
| 36 | {{- else }} |
| 37 | - ejbca-config |
| 38 | {{- end }} |
| 39 | env: |
| 40 | - name: NAMESPACE |
| 41 | valueFrom: |
| 42 | fieldRef: |
| 43 | apiVersion: v1 |
| 44 | fieldPath: metadata.namespace |
Sylvain Desbureaux | 5ee4dd4 | 2020-11-21 22:52:46 +0100 | [diff] [blame] | 45 | image: {{ include "repositoryGenerator.image.readiness" . }} |
Sylvain Desbureaux | d1ca1ee | 2020-04-07 14:52:20 +0200 | [diff] [blame] | 46 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 47 | containers: |
| 48 | - name: {{ include "common.name" . }}-ejbca |
Sylvain Desbureaux | 5ee4dd4 | 2020-11-21 22:52:46 +0100 | [diff] [blame] | 49 | image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.ejbca.image }} |
Sylvain Desbureaux | d1ca1ee | 2020-04-07 14:52:20 +0200 | [diff] [blame] | 50 | imagePullPolicy: {{ .Values.pullPolicy }} |
| 51 | lifecycle: |
| 52 | postStart: |
| 53 | exec: |
| 54 | command: ["/bin/sh", "-c", "/opt/primekey/scripts/ejbca-config.sh"] |
| 55 | volumeMounts: |
| 56 | - name: "{{ include "common.fullname" . }}-volume" |
| 57 | mountPath: /opt/primekey/scripts/ |
Remigiusz Janeczek | ed6e621 | 2020-09-08 13:00:50 +0200 | [diff] [blame] | 58 | - name: "{{ include "common.fullname" . }}-profiles-volume" |
| 59 | mountPath: /opt/primekey/custom_profiles/ |
Sylvain Desbureaux | d1ca1ee | 2020-04-07 14:52:20 +0200 | [diff] [blame] | 60 | ports: {{ include "common.containerPorts" . | nindent 10 }} |
| 61 | env: |
| 62 | - name: INITIAL_ADMIN |
| 63 | value: ";PublicAccessAuthenticationToken:TRANSPORT_ANY;" |
| 64 | - name: DATABASE_JDBC_URL |
| 65 | value: jdbc:mariadb://{{ include "common.mariadbService" . }}:{{ include "common.mariadbPort" . }}/{{ .Values.mysqlDatabase }} |
| 66 | - name: DATABASE_USER |
| 67 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "ejbca-db-secret" "key" "login") | indent 10 }} |
| 68 | - name: DATABASE_PASSWORD |
| 69 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "ejbca-db-secret" "key" "password") | indent 10 }} |
| 70 | - name: RA_IAK |
| 71 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "ejbca-server-ra-iak" "key" "password") | indent 10 }} |
| 72 | - name: CLIENT_IAK |
| 73 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "ejbca-server-client-iak" "key" "password") | indent 10 }} |
| 74 | livenessProbe: |
| 75 | httpGet: |
| 76 | port: {{ .Values.liveness.port }} |
| 77 | path: {{ .Values.liveness.path }} |
| 78 | scheme: HTTPS |
| 79 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 80 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 81 | readinessProbe: |
| 82 | httpGet: |
| 83 | port: {{ .Values.readiness.port }} |
| 84 | path: {{ .Values.readiness.path }} |
| 85 | scheme: HTTPS |
| 86 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 87 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 88 | {{- if .Values.nodeSelector }} |
| 89 | nodeSelector: {{ toYaml .Values.nodeSelector | nindent 10 }} |
| 90 | {{- end -}} |
| 91 | {{- if .Values.affinity }} |
| 92 | affinity: {{ toYaml .Values.affinity | nindent 10 }} |
| 93 | {{- end }} |
Sylvain Desbureaux | 1539273 | 2020-10-22 09:49:54 +0200 | [diff] [blame] | 94 | resources: {{ include "common.resources" . | nindent 10 }} |
Sylvain Desbureaux | d1ca1ee | 2020-04-07 14:52:20 +0200 | [diff] [blame] | 95 | volumes: |
| 96 | - configMap: |
| 97 | name: "{{ include "common.fullname" . }}-config-script" |
| 98 | defaultMode: 0755 |
| 99 | name: "{{ include "common.fullname" . }}-volume" |
Remigiusz Janeczek | ed6e621 | 2020-09-08 13:00:50 +0200 | [diff] [blame] | 100 | - configMap: |
| 101 | name: "{{ include "common.fullname" . }}-profiles" |
| 102 | defaultMode: 0755 |
| 103 | name: "{{ include "common.fullname" . }}-profiles-volume" |