blob: 489eb9cab756c50a4b3af6bb33d5ebf04b3225cd [file] [log] [blame]
Aaron Hay343e6002018-08-21 13:55:00 -04001# Copyright © 2018 Amdocs, Bell Canada, AT&T
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
Aaron Hay0fc90762019-03-20 19:48:42 -040015apiVersion: apps/v1beta1
16kind: StatefulSet
Aaron Hay343e6002018-08-21 13:55:00 -040017metadata:
18 name: {{ include "common.fullname" . }}
19 namespace: {{ include "common.namespace" . }}
20 labels:
21 app: {{ include "common.name" . }}
22 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010023 release: {{ include "common.release" . }}
Aaron Hay343e6002018-08-21 13:55:00 -040024 heritage: {{ .Release.Service }}
25spec:
26 replicas: {{ .Values.replicaCount }}
27 template:
28 metadata:
29 labels:
30 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010031 release: {{ include "common.release" . }}
Aaron Hay343e6002018-08-21 13:55:00 -040032 spec:
Taka Cho72759852019-06-26 13:51:46 -040033 initContainers:
34 - name: {{ include "common.name" . }}-chown
35 image: "busybox"
36 command: ["sh", "-c", "chown -R {{ .Values.config.ansibleUid }}:{{ .Values.config.ansibleGid}} {{ .Values.persistence.playbookPath }}"]
37 volumeMounts:
38 - mountPath: {{ .Values.persistence.playbookPath }}
39 name: {{ include "common.fullname" . }}-playbook
Aaron Hay343e6002018-08-21 13:55:00 -040040 containers:
41 - name: {{ include "common.name" . }}
42 command: ["/bin/bash"]
Aaron Hayfbe516c2018-09-27 08:06:15 -040043 args: ["-c", "cd /opt/onap/ccsdk && ./startAnsibleServer.sh"]
Aaron Hay343e6002018-08-21 13:55:00 -040044 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
45 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
46 ports:
47 - containerPort: {{ .Values.service.internalPort }}
48 # disable liveness probe when breakpoints set in debugger
49 # so K8s doesn't restart unresponsive container
50 {{ if .Values.liveness.enabled }}
51 livenessProbe:
52 tcpSocket:
53 port: {{ .Values.service.internalPort }}
54 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
55 periodSeconds: {{ .Values.liveness.periodSeconds }}
56 {{ end }}
57 readinessProbe:
58 tcpSocket:
59 port: {{ .Values.service.internalPort }}
60 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
61 periodSeconds: {{ .Values.readiness.periodSeconds }}
62 volumeMounts:
63 - mountPath: /etc/localtime
64 name: localtime
65 readOnly: true
66 - mountPath: {{ .Values.config.configDir }}/RestServer_config
67 name: config
68 subPath: RestServer_config
Aaron Hay0fc90762019-03-20 19:48:42 -040069 - mountPath: {{ .Values.persistence.playbookPath }}
Taka Cho72759852019-06-26 13:51:46 -040070 name: {{ include "common.fullname" . }}-playbook
Aaron Hay343e6002018-08-21 13:55:00 -040071 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +000072{{ include "common.resources" . | indent 12 }}
Sylvain Desbureaux45bb7132018-11-23 15:41:38 +010073 {{- if .Values.nodeSelector }}
Aaron Hay343e6002018-08-21 13:55:00 -040074 nodeSelector:
75{{ toYaml .Values.nodeSelector | indent 10 }}
76 {{- end -}}
77 {{- if .Values.affinity }}
78 affinity:
79{{ toYaml .Values.affinity | indent 10 }}
80 {{- end }}
81 volumes:
82 - name: localtime
83 hostPath:
84 path: /etc/localtime
85 - name: config
86 configMap:
87 name: {{ include "common.fullname" . }}
88 defaultMode: 0644
Aaron Hay0fc90762019-03-20 19:48:42 -040089{{ if not .Values.persistence.enabled }}
Taka Cho72759852019-06-26 13:51:46 -040090 - name: {{ include "common.fullname" . }}-playbook
Aaron Hay0fc90762019-03-20 19:48:42 -040091 emptyDir: {}
92{{ else }}
93 volumeClaimTemplates:
94 - metadata:
Taka Cho72759852019-06-26 13:51:46 -040095 name: {{ include "common.fullname" . }}-playbook
Aaron Hay0fc90762019-03-20 19:48:42 -040096 labels:
97 name: {{ include "common.fullname" . }}
Sylvain Desbureaux5f46e6e2019-11-29 09:19:40 +010098 chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010099 release: "{{ include "common.release" . }}"
Sylvain Desbureaux5f46e6e2019-11-29 09:19:40 +0100100 heritage: "{{ .Release.Service }}"
Aaron Hay0fc90762019-03-20 19:48:42 -0400101 spec:
Sylvain Desbureaux5f46e6e2019-11-29 09:19:40 +0100102 accessModes:
103 - {{ .Values.persistence.accessMode }}
104 storageClassName: {{ include "common.storageClass" . }}
Aaron Hay0fc90762019-03-20 19:48:42 -0400105 resources:
106 requests:
107 storage: {{ .Values.persistence.size }}
108{{ end }}