blob: 72251546c9a6f27510cac2e624dc075cdc2cf340 [file] [log] [blame]
Sylvain Desbureaux37dc40c2020-11-21 22:46:57 +01001{{/*
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
18apiVersion: apps/v1
19kind: Deployment
Andreas Geissler718fb742023-03-09 09:44:02 +010020metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
Sylvain Desbureaux37dc40c2020-11-21 22:46:57 +010021spec:
Andreas Geissler718fb742023-03-09 09:44:02 +010022 selector: {{- include "common.selectors" . | nindent 4 }}
Sylvain Desbureaux37dc40c2020-11-21 22:46:57 +010023 replicas: {{ .Values.replicaCount }}
Sylvain Desbureaux37dc40c2020-11-21 22:46:57 +010024 template:
Andreas Geissler718fb742023-03-09 09:44:02 +010025 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
Sylvain Desbureaux37dc40c2020-11-21 22:46:57 +010026 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 Geissler718fb742023-03-09 09:44:02 +010038 value: "http"
Sylvain Desbureaux37dc40c2020-11-21 22:46:57 +010039 - name: MSB_ADDR
40 value: "{{ .Values.config.msbgateway }}.{{ include "common.namespace" . }}"
41 - name: MSB_PORT
Andreas Geissler718fb742023-03-09 09:44:02 +010042 value: "{{ .Values.config.msbPort }}"
Sylvain Desbureaux37dc40c2020-11-21 22:46:57 +010043 - name: AAI_ADDR
Andreas Geisslerdfa23c82022-05-13 16:54:43 +020044 value: "aai.{{ include "common.namespace" . }}"
Sylvain Desbureaux37dc40c2020-11-21 22:46:57 +010045 - name: AAI_PORT
Andreas Geissler718fb742023-03-09 09:44:02 +010046 value: "{{ .Values.config.aai.aaiPort }}"
Sylvain Desbureaux37dc40c2020-11-21 22:46:57 +010047 - 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 Geissler718fb742023-03-09 09:44:02 +010054 value: "false"
Sylvain Desbureaux37dc40c2020-11-21 22:46:57 +010055 name: {{ include "common.name" . }}
56 volumeMounts:
Maciej Wereski989c91c2021-11-17 16:45:14 +010057 - mountPath: "{{ .Values.log.path }}"
Sylvain Desbureaux37dc40c2020-11-21 22:46:57 +010058 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
miroslavmasaryka7ac7f02023-03-01 14:12:26 +010064 resources: {{ include "common.resources" . | nindent 10 }}
Sylvain Desbureaux37dc40c2020-11-21 22:46:57 +010065 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
66 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Andreas Geissler718fb742023-03-09 09:44:02 +010067 ports: {{ include "common.containerPorts" . | nindent 10 }}
Sylvain Desbureaux37dc40c2020-11-21 22:46:57 +010068 # 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 Geissler718fb742023-03-09 09:44:02 +010075 scheme: HTTP
Sylvain Desbureaux37dc40c2020-11-21 22:46:57 +010076 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 Geissler718fb742023-03-09 09:44:02 +010083 {{ include "common.log.sidecar" . | nindent 6 }}
Bin Yangdf4fc032022-03-22 16:08:22 +080084 - image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.memcached }}
85 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
86 name: memcached
Sylvain Desbureaux37dc40c2020-11-21 22:46:57 +010087 - 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 azmy72513552021-10-12 18:55:21 +0200100 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
Sylvain Desbureaux37dc40c2020-11-21 22:46:57 +0100101 volumes:
102 - name: windriver-log
103 emptyDir: {}
Andreas Geissler718fb742023-03-09 09:44:02 +0100104 {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix . )) | nindent 6 }}
Sylvain Desbureaux37dc40c2020-11-21 22:46:57 +0100105 - 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