blob: dc461b8c14a2aefd461feaea7ef36b21fc14a351 [file] [log] [blame]
Jeremy Ronquillo223db002020-06-05 10:28:22 -07001{{/*
2Copyright 2019-present Open Networking Foundation
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15
16Default values for mcord-vepc-helm.
17This is a YAML-formatted file.
18Declare variables to be passed into your templates.
19*/}}
20
21{{ tuple "hss" . | include "omec-control-plane.service_account" }}
22---
23apiVersion: apps/v1
24kind: StatefulSet
25metadata:
26 name: hss
27 labels:
28{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 4 }}
29spec:
30 replicas: 1
31 serviceName: hss-headless
32 selector:
33 matchLabels:
34{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 6 }}
35 template:
36 metadata:
37 labels:
38{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 8 }}
39 spec:
40 {{- if .Values.nodeSelectors.enabled }}
41 nodeSelector:
42 {{ .Values.nodeSelectors.hss.label }}: {{ .Values.nodeSelectors.hss.value }}
43 {{- end }}
44 serviceAccountName: hss
45 initContainers:
46 - name: hss-dep-check
47 image: {{ .Values.images.tags.depCheck | quote }}
48 imagePullPolicy: {{ .Values.images.pullPolicy }}
49 securityContext:
50 allowPrivilegeEscalation: false
51 readOnlyRootFilesystem: false
52 runAsUser: 0
53 env:
54 - name: NAMESPACE
55 valueFrom:
56 fieldRef:
57 apiVersion: v1
58 fieldPath: metadata.namespace
59 - name: PATH
60 value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/
61 - name: COMMAND
62 value: "echo done"
63 - name: DEPENDENCY_JOBS
64 {{- if .Values.config.hss.bootstrap }}
65 value: job-hss-db-sync,job-hss-bootstrap
66 {{- else }}
67 value: job-hss-db-sync
68 {{- end }}
69 command:
70 - kubernetes-entrypoint
71 volumeMounts:
72 []
73 {{- if .Values.config.coreDump.enabled }}
74{{ tuple "hss" . | include "omec-control-plane.coredump_init" | indent 6 }}
75 {{- end }}
76 containers:
77 - name: hss
78 image: {{ .Values.images.tags.hss }}
79 imagePullPolicy: {{ .Values.images.pullPolicy }}
80 {{- if .Values.config.coreDump.enabled }}
81 securityContext:
82 privileged: true
83 runAsUser: 0
84 {{- end }}
85 stdin: true
86 tty: true
87 command: ["bash", "-c", "/opt/c3po/hss/hss-run.sh; sleep 3600"]
88 {{- if .Values.resources.enabled }}
89 resources:
90{{ toYaml .Values.resources.hss | indent 10 }}
91 {{- end }}
92 volumeMounts:
93 - name: hss-script
94 mountPath: /opt/c3po/hss/hss-run.sh
95 subPath: hss-run.sh
96 - name: hss-config
97 mountPath: /etc/hss/conf
98 {{- if .Values.config.coreDump.enabled }}
99 - name: coredump
100 mountPath: /tmp/coredump
101 {{- end }}
102 volumes:
103 - name: hss-script
104 configMap:
105 name: hss
106 defaultMode: 493
107 - name: hss-config
108 configMap:
109 name: hss
110 defaultMode: 420
111 {{- if .Values.config.coreDump.enabled }}
112 - name: host-rootfs
113 hostPath:
114 path: /
115 - name: coredump
116 hostPath:
117 path: {{ .Values.config.coreDump.path }}
118 {{- end }}