Sylvain Desbureaux | 37dc40c | 2020-11-21 22:46:57 +0100 | [diff] [blame] | 1 | {{/* |
| 2 | # Copyright © 2017 Amdocs, Bell Canada |
| 3 | # Modifications Copyright © 2018 AT&T |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | */}} |
| 17 | |
| 18 | apiVersion: apps/v1 |
| 19 | kind: Deployment |
Andreas Geissler | 718fb74 | 2023-03-09 09:44:02 +0100 | [diff] [blame] | 20 | metadata: {{- include "common.resourceMetadata" . | nindent 2 }} |
Sylvain Desbureaux | 37dc40c | 2020-11-21 22:46:57 +0100 | [diff] [blame] | 21 | spec: |
Andreas Geissler | 718fb74 | 2023-03-09 09:44:02 +0100 | [diff] [blame] | 22 | selector: {{- include "common.selectors" . | nindent 4 }} |
Sylvain Desbureaux | 37dc40c | 2020-11-21 22:46:57 +0100 | [diff] [blame] | 23 | replicas: {{ .Values.replicaCount }} |
Sylvain Desbureaux | 37dc40c | 2020-11-21 22:46:57 +0100 | [diff] [blame] | 24 | template: |
Andreas Geissler | 718fb74 | 2023-03-09 09:44:02 +0100 | [diff] [blame] | 25 | metadata: {{- include "common.templateMetadata" . | nindent 6 }} |
Sylvain Desbureaux | 37dc40c | 2020-11-21 22:46:57 +0100 | [diff] [blame] | 26 | spec: |
| 27 | initContainers: |
| 28 | - command: ["sh", "-c", "chown -R 100:101 /data"] |
| 29 | image: {{ include "repositoryGenerator.image.busybox" . }} |
| 30 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 31 | name: {{ include "common.name" . }}-init |
| 32 | volumeMounts: |
| 33 | - mountPath: /data |
| 34 | name: artifact-data |
| 35 | containers: |
| 36 | - env: |
| 37 | - name: MSB_PROTO |
Andreas Geissler | 718fb74 | 2023-03-09 09:44:02 +0100 | [diff] [blame] | 38 | value: "http" |
Sylvain Desbureaux | 37dc40c | 2020-11-21 22:46:57 +0100 | [diff] [blame] | 39 | - name: MSB_ADDR |
| 40 | value: "{{ .Values.config.msbgateway }}.{{ include "common.namespace" . }}" |
| 41 | - name: MSB_PORT |
Andreas Geissler | 718fb74 | 2023-03-09 09:44:02 +0100 | [diff] [blame] | 42 | value: "{{ .Values.config.msbPort }}" |
Sylvain Desbureaux | 37dc40c | 2020-11-21 22:46:57 +0100 | [diff] [blame] | 43 | - name: AAI_ADDR |
Andreas Geissler | dfa23c8 | 2022-05-13 16:54:43 +0200 | [diff] [blame] | 44 | value: "aai.{{ include "common.namespace" . }}" |
Sylvain Desbureaux | 37dc40c | 2020-11-21 22:46:57 +0100 | [diff] [blame] | 45 | - name: AAI_PORT |
Andreas Geissler | 718fb74 | 2023-03-09 09:44:02 +0100 | [diff] [blame] | 46 | value: "{{ .Values.config.aai.aaiPort }}" |
Sylvain Desbureaux | 37dc40c | 2020-11-21 22:46:57 +0100 | [diff] [blame] | 47 | - name: AAI_SCHEMA_VERSION |
| 48 | value: "{{ .Values.config.aai.schemaVersion }}" |
| 49 | - name: AAI_USERNAME |
| 50 | value: "{{ .Values.config.aai.username }}" |
| 51 | - name: AAI_PASSWORD |
| 52 | value: "{{ .Values.config.aai.password }}" |
| 53 | - name: SSL_ENABLED |
Andreas Geissler | 718fb74 | 2023-03-09 09:44:02 +0100 | [diff] [blame] | 54 | value: "false" |
Sylvain Desbureaux | 37dc40c | 2020-11-21 22:46:57 +0100 | [diff] [blame] | 55 | name: {{ include "common.name" . }} |
| 56 | volumeMounts: |
Maciej Wereski | 989c91c | 2021-11-17 16:45:14 +0100 | [diff] [blame] | 57 | - mountPath: "{{ .Values.log.path }}" |
Sylvain Desbureaux | 37dc40c | 2020-11-21 22:46:57 +0100 | [diff] [blame] | 58 | name: windriver-log |
| 59 | - mountPath: /opt/windriver/titanium_cloud/pub/config/log.yml |
| 60 | name: windriver-logconfig |
| 61 | subPath: log.yml |
| 62 | - mountPath: /opt/artifacts/ |
| 63 | name: artifact-data |
miroslavmasaryk | a7ac7f0 | 2023-03-01 14:12:26 +0100 | [diff] [blame] | 64 | resources: {{ include "common.resources" . | nindent 10 }} |
Sylvain Desbureaux | 37dc40c | 2020-11-21 22:46:57 +0100 | [diff] [blame] | 65 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
| 66 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Andreas Geissler | 718fb74 | 2023-03-09 09:44:02 +0100 | [diff] [blame] | 67 | ports: {{ include "common.containerPorts" . | nindent 10 }} |
Sylvain Desbureaux | 37dc40c | 2020-11-21 22:46:57 +0100 | [diff] [blame] | 68 | # disable liveness probe when breakpoints set in debugger |
| 69 | # so K8s doesn't restart unresponsive container |
| 70 | {{ if .Values.liveness.enabled }} |
| 71 | livenessProbe: |
| 72 | httpGet: |
| 73 | path: /api/multicloud-titaniumcloud/v1/swagger.json |
| 74 | port: {{ .Values.service.internalPort }} |
Andreas Geissler | 718fb74 | 2023-03-09 09:44:02 +0100 | [diff] [blame] | 75 | scheme: HTTP |
Sylvain Desbureaux | 37dc40c | 2020-11-21 22:46:57 +0100 | [diff] [blame] | 76 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 77 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 78 | timeoutSeconds: {{ .Values.liveness.timeoutSeconds }} |
| 79 | successThreshold: {{ .Values.liveness.successThreshold }} |
| 80 | failureThreshold: {{ .Values.liveness.failureThreshold }} |
| 81 | {{ end }} |
| 82 | # side car containers |
Andreas Geissler | 718fb74 | 2023-03-09 09:44:02 +0100 | [diff] [blame] | 83 | {{ include "common.log.sidecar" . | nindent 6 }} |
Bin Yang | df4fc03 | 2022-03-22 16:08:22 +0800 | [diff] [blame] | 84 | - image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.memcached }} |
| 85 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 86 | name: memcached |
Sylvain Desbureaux | 37dc40c | 2020-11-21 22:46:57 +0100 | [diff] [blame] | 87 | - image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.global.artifactImage }} |
| 88 | name: framework-artifactbroker |
| 89 | command: ["/opt/app/distribution/bin/artifact-dist.sh"] |
| 90 | args: ["/opt/app/distribution/etc/mounted/config.json"] |
| 91 | ports: |
| 92 | - containerPort: 9014 |
| 93 | protocol: TCP |
| 94 | volumeMounts: |
| 95 | - mountPath: /opt/app/distribution/etc/mounted/config.json |
| 96 | name: windriver-logconfig |
| 97 | subPath: config.json |
| 98 | - mountPath: /data |
| 99 | name: artifact-data |
farida azmy | 7251355 | 2021-10-12 18:55:21 +0200 | [diff] [blame] | 100 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
Sylvain Desbureaux | 37dc40c | 2020-11-21 22:46:57 +0100 | [diff] [blame] | 101 | volumes: |
| 102 | - name: windriver-log |
| 103 | emptyDir: {} |
Andreas Geissler | 718fb74 | 2023-03-09 09:44:02 +0100 | [diff] [blame] | 104 | {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix . )) | nindent 6 }} |
Sylvain Desbureaux | 37dc40c | 2020-11-21 22:46:57 +0100 | [diff] [blame] | 105 | - name: windriver-logconfig |
| 106 | configMap: |
| 107 | name: {{ include "common.fullname" . }}-log-configmap |
| 108 | - name: artifact-data |
| 109 | {{- if .Values.persistence.enabled }} |
| 110 | persistentVolumeClaim: |
| 111 | claimName: {{ include "common.fullname" . }} |
| 112 | {{- else }} |
| 113 | emptyDir: {} |
| 114 | {{- end }} |
| 115 | imagePullSecrets: |
| 116 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |
| 117 | restartPolicy: Always |