Sylvain Desbureaux | 37dc40c | 2020-11-21 22:46:57 +0100 | [diff] [blame] | 1 | {{/* |
| 2 | # Copyright (c) 2019 Intel Corporation. |
| 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 |
Andreas Geissler | 718fb74 | 2023-03-09 09:44:02 +0100 | [diff] [blame] | 19 | metadata: {{- include "common.resourceMetadata" . | nindent 2 }} |
Sylvain Desbureaux | 37dc40c | 2020-11-21 22:46:57 +0100 | [diff] [blame] | 20 | spec: |
Andreas Geissler | 718fb74 | 2023-03-09 09:44:02 +0100 | [diff] [blame] | 21 | selector: {{- include "common.selectors" . | nindent 4 }} |
Sylvain Desbureaux | 37dc40c | 2020-11-21 22:46:57 +0100 | [diff] [blame] | 22 | replicas: {{ .Values.replicaCount }} |
Sylvain Desbureaux | 37dc40c | 2020-11-21 22:46:57 +0100 | [diff] [blame] | 23 | template: |
Andreas Geissler | 718fb74 | 2023-03-09 09:44:02 +0100 | [diff] [blame] | 24 | metadata: {{- include "common.templateMetadata" . | nindent 6 }} |
Sylvain Desbureaux | 37dc40c | 2020-11-21 22:46:57 +0100 | [diff] [blame] | 25 | spec: |
| 26 | containers: |
| 27 | - env: |
| 28 | - name: MSB_PROTO |
Andreas Geissler | 718fb74 | 2023-03-09 09:44:02 +0100 | [diff] [blame] | 29 | value: "http" |
Sylvain Desbureaux | 37dc40c | 2020-11-21 22:46:57 +0100 | [diff] [blame] | 30 | - name: MSB_ADDR |
| 31 | value: "{{ .Values.config.msbgateway }}.{{ include "common.namespace" . }}" |
| 32 | - name: MSB_PORT |
Andreas Geissler | 718fb74 | 2023-03-09 09:44:02 +0100 | [diff] [blame] | 33 | value: "{{ .Values.config.msbPort }}" |
Sylvain Desbureaux | 37dc40c | 2020-11-21 22:46:57 +0100 | [diff] [blame] | 34 | - name: AAI_ADDR |
Andreas Geissler | dfa23c8 | 2022-05-13 16:54:43 +0200 | [diff] [blame] | 35 | value: "aai.{{ include "common.namespace" . }}" |
Sylvain Desbureaux | 37dc40c | 2020-11-21 22:46:57 +0100 | [diff] [blame] | 36 | - name: AAI_PORT |
Andreas Geissler | 718fb74 | 2023-03-09 09:44:02 +0100 | [diff] [blame] | 37 | value: "{{ .Values.config.aai.aaiPort }}" |
Sylvain Desbureaux | 37dc40c | 2020-11-21 22:46:57 +0100 | [diff] [blame] | 38 | - name: AAI_SCHEMA_VERSION |
| 39 | value: "{{ .Values.config.aai.schemaVersion }}" |
| 40 | - name: AAI_USERNAME |
| 41 | value: "{{ .Values.config.aai.username }}" |
| 42 | - name: AAI_PASSWORD |
| 43 | value: "{{ .Values.config.aai.password }}" |
| 44 | - name: SSL_ENABLED |
Andreas Geissler | 718fb74 | 2023-03-09 09:44:02 +0100 | [diff] [blame] | 45 | value: "false" |
Sylvain Desbureaux | 37dc40c | 2020-11-21 22:46:57 +0100 | [diff] [blame] | 46 | name: {{ include "common.name" . }} |
| 47 | volumeMounts: |
Maciej Wereski | 989c91c | 2021-11-17 16:45:14 +0100 | [diff] [blame] | 48 | - mountPath: "{{ .Values.log.path }}" |
Sylvain Desbureaux | 37dc40c | 2020-11-21 22:46:57 +0100 | [diff] [blame] | 49 | name: starlingx-log |
| 50 | - mountPath: /opt/starlingx/starlingx/pub/config/log.yml |
| 51 | name: starlingx-logconfig |
| 52 | subPath: log.yml |
| 53 | - mountPath: /opt/artifacts/ |
| 54 | name: artifact-data |
Andreas Geissler | 718fb74 | 2023-03-09 09:44:02 +0100 | [diff] [blame] | 55 | resources: {{ include "common.resources" . | nindent 10 }} |
Sylvain Desbureaux | 37dc40c | 2020-11-21 22:46:57 +0100 | [diff] [blame] | 56 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
| 57 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Andreas Geissler | 718fb74 | 2023-03-09 09:44:02 +0100 | [diff] [blame] | 58 | ports: {{ include "common.containerPorts" . | nindent 10 }} |
Sylvain Desbureaux | 37dc40c | 2020-11-21 22:46:57 +0100 | [diff] [blame] | 59 | # disable liveness probe when breakpoints set in debugger |
| 60 | # so K8s doesn't restart unresponsive container |
| 61 | {{ if .Values.liveness.enabled }} |
| 62 | livenessProbe: |
| 63 | httpGet: |
| 64 | path: /api/multicloud-starlingx/v0/swagger.json |
| 65 | port: {{ .Values.service.internalPort }} |
Andreas Geissler | 718fb74 | 2023-03-09 09:44:02 +0100 | [diff] [blame] | 66 | scheme: HTTP |
Sylvain Desbureaux | 37dc40c | 2020-11-21 22:46:57 +0100 | [diff] [blame] | 67 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 68 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 69 | timeoutSeconds: {{ .Values.liveness.timeoutSeconds }} |
| 70 | successThreshold: {{ .Values.liveness.successThreshold }} |
| 71 | failureThreshold: {{ .Values.liveness.failureThreshold }} |
| 72 | {{ end }} |
| 73 | # side car containers |
Andreas Geissler | 718fb74 | 2023-03-09 09:44:02 +0100 | [diff] [blame] | 74 | {{ include "common.log.sidecar" . | nindent 6 }} |
Bin Yang | df4fc03 | 2022-03-22 16:08:22 +0800 | [diff] [blame] | 75 | - image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.memcached }} |
| 76 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 77 | name: memcached |
Sylvain Desbureaux | 37dc40c | 2020-11-21 22:46:57 +0100 | [diff] [blame] | 78 | - image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.global.artifactImage }} |
| 79 | name: framework-artifactbroker |
| 80 | command: ["/opt/app/distribution/bin/artifact-dist.sh"] |
| 81 | args: ["/opt/app/distribution/etc/mounted/config.json"] |
| 82 | ports: |
| 83 | - containerPort: 9014 |
| 84 | protocol: TCP |
| 85 | volumeMounts: |
| 86 | - mountPath: /opt/app/distribution/etc/mounted/config.json |
| 87 | name: starlingx-logconfig |
| 88 | subPath: config.json |
| 89 | - mountPath: /data |
| 90 | name: artifact-data |
farida azmy | 7251355 | 2021-10-12 18:55:21 +0200 | [diff] [blame] | 91 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
Sylvain Desbureaux | 37dc40c | 2020-11-21 22:46:57 +0100 | [diff] [blame] | 92 | volumes: |
| 93 | - name: starlingx-log |
| 94 | emptyDir: {} |
Andreas Geissler | 718fb74 | 2023-03-09 09:44:02 +0100 | [diff] [blame] | 95 | {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix . )) | nindent 6 }} |
Sylvain Desbureaux | 37dc40c | 2020-11-21 22:46:57 +0100 | [diff] [blame] | 96 | - name: starlingx-logconfig |
| 97 | configMap: |
| 98 | name: {{ include "common.fullname" . }}-log-configmap |
| 99 | - name: artifact-data |
| 100 | emptyDir: {} |
| 101 | imagePullSecrets: |
| 102 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |
| 103 | restartPolicy: Always |