blob: 2fbd5e3ba0865ba94259d461bf92713afdcd8da4 [file] [log] [blame]
Woojoong Kim4feaddf2019-11-21 00:05:07 -08001{{- /*
2# Copyright 2019-present Open Networking Foundation
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{{ tuple "accelleran-cbrs-ric" . | include "accelleran-cbrs-common.service_account" }}
18
19---
20apiVersion: apps/v1
21kind: StatefulSet
22metadata:
23 name: accelleran-cbrs-ric
24 labels:
25{{ tuple "accelleran-cbrs-ric" . | include "accelleran-cbrs-common.metadata_labels" | indent 4 }}
26spec:
27 selector:
28 matchLabels:
29{{ tuple "accelleran-cbrs-ric" . | include "accelleran-cbrs-common.metadata_labels" | indent 6 }}
30 serviceName: accelleran-cbrs-ric
31 template:
32 metadata:
33 labels:
34{{ tuple "accelleran-cbrs-ric" . | include "accelleran-cbrs-common.metadata_labels" | indent 8 }}
35 spec:
36 {{- if .Values.nodeSelectors.enabled }}
37 nodeSelector:
38 {{ .Values.nodeSelectors.accelleranCBRSCommon.label }}: {{ .Values.nodeSelectors.accelleranCBRSCommon.value }}
39 {{- end }}
40 serviceAccountName: accelleran-cbrs-ric
41 initContainers:
42 - name: redis-init-dep-check
43 image: {{ .Values.images.tags.depCheck }}
44 imagePullPolicy: {{ .Values.images.pullPolicy }}
45 securityContext:
46 allowPrivilegeEscalation: false
47 readOnlyRootFilesystem: false
48 runAsUser: 0
49 env:
50 - name: POD_NAME
51 valueFrom:
52 fieldRef:
53 apiVersion: v1
54 fieldPath: metadata.name
55 - name: NAMESPACE
56 valueFrom:
57 fieldRef:
58 apiVersion: v1
59 fieldPath: metadata.namespace
60 - name: PATH
61 value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/
62 - name: COMMAND
63 value: "echo done"
64 - name: DEPENDENCY_JOBS
65 value: job-redis-init
66 containers:
67 - name: ric
68 image: {{ .Values.images.tags.ric }}
69 imagePullPolicy: {{ .Values.images.pullPolicy }}
70 securityContext:
71 privileged: true
72 capabilities:
73 add:
74 - NET_ADMIN
75 - IPC_LOCK
76 - SYS_NICE
77 env:
78 - name: ZLOG_CONF_PATH
79 value: /zlog.conf
80 - name: BOOTSTRAP_FILENAME
81 value: /bootstrap
82 - name: LD_LIBRARY_PATH
83 value: /data/
84 - name: FAP_DB_PATH
85 value: /data/
86 command: ["/data/ric"]
87 {{- if .Values.resources.enabled }}
88 resources:
89{{ toYaml .Values.resources.accelleranCBRSCommon | indent 10 }}
90 {{- end }}
91 volumeMounts:
92 - name: ric-config-volume
93 mountPath: /bootstrap
94 subPath: bootstrap
95 - name: ric-config-volume
96 mountPath: /zlog.conf
97 subPath: zlog.conf
98 volumes:
99 - name: ric-config-volume
100 configMap:
101 name: accelleran-cbrs-ric-cm