blob: 7a8d622fd80de60023fd9088b76fbcbf6509a3f4 [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---
18apiVersion: apps/v1
19kind: StatefulSet
20metadata:
21 name: accelleran-cbrs-cu-{{ .Values.config.vranL3.instanceId }}
22 labels:
23 deployedCellId: {{ .Values.config.vranL3.instanceId }}
24{{ tuple "accelleran-cbrs-cu" . | include "accelleran-cbrs-cu.metadata_labels" | indent 4 }}
25spec:
26 selector:
27 matchLabels:
28{{ tuple "accelleran-cbrs-cu" . | include "accelleran-cbrs-cu.metadata_labels" | indent 6 }}
29 serviceName: accelleran-cbrs-cu-{{ .Values.config.vranL3.instanceId }}
30 template:
31 metadata:
32 labels:
33 deployedCellId: {{ .Values.config.vranL3.instanceId }}
34{{ tuple "accelleran-cbrs-cu" . | include "accelleran-cbrs-cu.metadata_labels" | indent 8 }}
35 spec:
36 {{- if .Values.nodeSelectors.enabled }}
37 nodeSelector:
38 {{ .Values.nodeSelectors.accelleranCBRSCU.label }}: {{ .Values.nodeSelectors.accelleranCBRSCU.value }}
39 {{- end }}
40 initContainers:
41 - name: cu-init
42 image: {{ .Values.images.tags.initCU }}
43 imagePullPolicy: {{ .Values.images.pullPolicy }}
44 securityContext:
45 privileged: true
46 runAsUser: 0
47 command: [ "sh", "-c"]
48 args:
49 - >
50 iptables -I OUTPUT -p icmp --icmp-type destination-unreachable -j DROP;
51 if chroot /mnt/host-rootfs modinfo nf_conntrack_proto_sctp > /dev/null 2>&1; then \
52 chroot /mnt/host-rootfs modprobe nf_conntrack_proto_sctp; \
53 fi; \
54 volumeMounts:
55 - name: host-rootfs
56 mountPath: /mnt/host-rootfs
57 containers:
58 - name: vran-l3
59 image: {{ .Values.images.tags.vranL3 }}
60 imagePullPolicy: {{ .Values.images.pullPolicy }}
61 env:
62 - name: ZLOG_CONF_PATH
63 value: /zlog.conf
64 - name: BOOTSTRAP_FILENAME
65 value: /bootstrap
66 - name: LD_LIBRARY_PATH
67 value: /data/
68 - name: FAP_DB_PATH
69 value: /data/
70 command: ["sh", "-c"]
71 args:
72 - sqlite3 /data/datastoreRemRw.db "update FapServiceCellConfigLteEpcPlmnList set PLMNID='{{ .Values.config.vranL3.plmnId }}';";
73 sqlite3 /data/datastoreRemRw.db "update FapServiceFapControlLteGateway set SecGWServer1='{{ .Values.config.mme.ip }}';";
74 sqlite3 /data/datastoreRemRw.db "update FapServiceFapControlLteGateway set SecGWServer2='{{ .Values.config.mme.ip }}';";
75 sqlite3 /data/datastoreRemRw.db "update FapServiceFapControlLteGateway set SecGWServer3='{{ .Values.config.mme.ip }}';";
76 sqlite3 /data/datastoreRemRw.db "update FapServiceFapControlLteGateway_S1SigLinkServerListList set S1SigLinkServerList='{{ .Values.config.mme.ip }}';";
77 sqlite3 /data/datastoreRemRw.db "update FapServiceCellConfigLteRanRf set FreqBandIndicator='{{ .Values.config.vranL3.freqBand }}';";
78 sqlite3 /data/datastore.db "update featureActivation set good1PPSRequired=0;";
79 sqlite3 /data/datastoreRemRw.db "update FapServiceCellConfigLteRanRf_EARFCNDLList set EARFCNDL='{{ .Values.config.vranL3.earfcnDl }}';";
80 sqlite3 /data/datastoreRemRw.db "update FapServiceCellConfigLteRanRf_EARFCNULList set EARFCNUL='{{ .Values.config.vranL3.earfcnUl }}';";
81 redis-cli -h accelleran-cbrs-redis -p {{ .Values.config.redis.ports.redisPort.port }} hset ENB_{{ .Values.config.vranL3.instanceId }}_FAPSERVICEFAPCONTROLLTEGATEWAYS1SIGLINKSERVERLIST[0] S1SIGLINKSERVERLIST {{ .Values.config.mme.ip }};
82 redis-cli -h accelleran-cbrs-redis -p {{ .Values.config.redis.ports.redisPort.port }} hset ENB_{{ .Values.config.vranL3.instanceId }}_FAPSERVICEFAPCONTROLLTEGATEWAY_S1SIGLINKSERVERLISTLIST[0] S1SIGLINKSERVERLIST {{ .Values.config.mme.ip }};
83 redis-cli -h accelleran-cbrs-redis -p {{ .Values.config.redis.ports.redisPort.port }} hset ENB_{{ .Values.config.vranL3.instanceId }}_FAPSERVICECELLCONFIGLTERANRF FREQBANDINDICATOR {{ .Values.config.vranL3.freqBand }};
84 redis-cli -h accelleran-cbrs-redis -p {{ .Values.config.redis.ports.redisPort.port }} hset ENB_{{ .Values.config.vranL3.instanceId }}_FEATUREACTIVATION GOOD1PPSREQUIRED False;
85 redis-cli -h accelleran-cbrs-redis -p {{ .Values.config.redis.ports.redisPort.port }} hset ENB_{{ .Values.config.vranL3.instanceId }}_FAPSERVICECELLCONFIGLTEEPCPLMNLIST[0] PLMNID {{ .Values.config.vranL3.plmnId }};
86 redis-cli -h accelleran-cbrs-redis -p {{ .Values.config.redis.ports.redisPort.port }} hset ENB_{{ .Values.config.vranL3.instanceId }}_FAPSERVICECELLCONFIGLTERANRF_EARFCNDLLIST EARFCNDL {{ .Values.config.vranL3.earfcnDl }};
87 redis-cli -h accelleran-cbrs-redis -p {{ .Values.config.redis.ports.redisPort.port }} hset ENB_{{ .Values.config.vranL3.instanceId }}_FAPSERVICECELLCONFIGLTERANRF_EARFCNULLIST EARFCNUL {{ .Values.config.vranL3.earfcnUl }};
88 redis-cli -h accelleran-cbrs-redis -p {{ .Values.config.redis.ports.redisPort.port }} hgetall ENB_{{ .Values.config.vranL3.instanceId }}_FAPSERVICEFAPCONTROLLTEGATEWAYS1SIGLINKSERVERLIST[0];
89 redis-cli -h accelleran-cbrs-redis -p {{ .Values.config.redis.ports.redisPort.port }} hgetall ENB_{{ .Values.config.vranL3.instanceId }}_FAPSERVICEFAPCONTROLLTEGATEWAY_S1SIGLINKSERVERLISTLIST[0];
90 redis-cli -h accelleran-cbrs-redis -p {{ .Values.config.redis.ports.redisPort.port }} hgetall ENB_{{ .Values.config.vranL3.instanceId }}_FAPSERVICECELLCONFIGLTERANRF;
91 redis-cli -h accelleran-cbrs-redis -p {{ .Values.config.redis.ports.redisPort.port }} hgetall ENB_{{ .Values.config.vranL3.instanceId }}_FEATUREACTIVATION;
92 redis-cli -h accelleran-cbrs-redis -p {{ .Values.config.redis.ports.redisPort.port }} hgetall ENB_{{ .Values.config.vranL3.instanceId }}_FAPSERVICECELLCONFIGLTEEPCPLMNLIST[0];
93 redis-cli -h accelleran-cbrs-redis -p {{ .Values.config.redis.ports.redisPort.port }} hgetall ENB_{{ .Values.config.vranL3.instanceId }}_FAPSERVICECELLCONFIGLTERANRF_EARFCNDLLIST;
94 redis-cli -h accelleran-cbrs-redis -p {{ .Values.config.redis.ports.redisPort.port }} hgetall ENB_{{ .Values.config.vranL3.instanceId }}_FAPSERVICECELLCONFIGLTERANRF_EARFCNULLIST;
95 sleep 30;
96 /data/l3service;
97 securityContext:
98 privileged: true
99 {{- if .Values.resources.enabled }}
100 resources:
101{{ toYaml .Values.resources.accelleranCBRSCU | indent 10 }}
102 {{- end }}
103 volumeMounts:
104 - name: l3-config-volume
105 mountPath: /bootstrap
106 subPath: bootstrap
107 - name: l3-config-volume
108 mountPath: /zlog.conf
109 subPath: zlog.conf
110 volumes:
111 - name: l3-config-volume
112 configMap:
113 name: accelleran-cbrs-cu-{{ .Values.config.vranL3.instanceId }}-cm
114 - name: host-rootfs
115 hostPath:
116 path: /