blob: 5eaf1ed3f4b2bdb22f331040fde551af8917ea53 [file] [log] [blame]
Jeremy Ronquillo223db002020-06-05 10:28:22 -07001{{- /*
Jeremy Ronquilloec2d3e42020-06-05 11:33:39 -07002
Jeremy Ronquillo223db002020-06-05 10:28:22 -07003# Copyright 2019-present Open Networking Foundation
4#
Jeremy Ronquilloec2d3e42020-06-05 11:33:39 -07005# SPDX-License-Identifier: Apache-2.0
6# SPDX-License-Identifier: LicenseRef-ONF-Member-Only
7
Jeremy Ronquillo223db002020-06-05 10:28:22 -07008*/ -}}
9
10---
11apiVersion: apps/v1
12kind: StatefulSet
13metadata:
14 name: accelleran-cbrs-cu-{{ .Values.config.vranL3.instanceId }}
15 labels:
16 deployedCellId: {{ .Values.config.vranL3.instanceId }}
17{{ tuple "accelleran-cbrs-cu" . | include "accelleran-cbrs-cu.metadata_labels" | indent 4 }}
18spec:
19 selector:
20 matchLabels:
21{{ tuple "accelleran-cbrs-cu" . | include "accelleran-cbrs-cu.metadata_labels" | indent 6 }}
22 serviceName: accelleran-cbrs-cu-{{ .Values.config.vranL3.instanceId }}
23 template:
24 metadata:
25 labels:
26 deployedCellId: {{ .Values.config.vranL3.instanceId }}
27{{ tuple "accelleran-cbrs-cu" . | include "accelleran-cbrs-cu.metadata_labels" | indent 8 }}
28 spec:
29 {{- if .Values.nodeSelectors.enabled }}
30 nodeSelector:
31 {{ .Values.nodeSelectors.accelleranCBRSCU.label }}: {{ .Values.nodeSelectors.accelleranCBRSCU.value }}
32 {{- end }}
33 initContainers:
34 - name: cu-init
35 image: {{ .Values.images.tags.initCU }}
36 imagePullPolicy: {{ .Values.images.pullPolicy }}
37 securityContext:
38 privileged: true
39 runAsUser: 0
40 command: [ "sh", "-c"]
41 args:
42 - >
43 iptables -I OUTPUT -p icmp --icmp-type destination-unreachable -j DROP;
44 if chroot /mnt/host-rootfs modinfo nf_conntrack_proto_sctp > /dev/null 2>&1; then \
45 chroot /mnt/host-rootfs modprobe nf_conntrack_proto_sctp; \
46 fi; \
47 volumeMounts:
48 - name: host-rootfs
49 mountPath: /mnt/host-rootfs
50 containers:
51 - name: vran-l3
52 image: {{ .Values.images.tags.vranL3 }}
53 imagePullPolicy: {{ .Values.images.pullPolicy }}
54 env:
55 - name: ZLOG_CONF_PATH
56 value: /zlog.conf
57 - name: BOOTSTRAP_FILENAME
58 value: /bootstrap
59 - name: LD_LIBRARY_PATH
60 value: /data/
61 - name: FAP_DB_PATH
62 value: /data/
63 command: ["sh", "-c"]
64 args:
65 - sqlite3 /data/datastoreRemRw.db "update FapServiceCellConfigLteEpcPlmnList set PLMNID='{{ .Values.config.vranL3.plmnId }}';";
66 sqlite3 /data/datastoreRemRw.db "update FapServiceFapControlLteGateway set SecGWServer1='{{ .Values.config.mme.ip }}';";
67 sqlite3 /data/datastoreRemRw.db "update FapServiceFapControlLteGateway set SecGWServer2='{{ .Values.config.mme.ip }}';";
68 sqlite3 /data/datastoreRemRw.db "update FapServiceFapControlLteGateway set SecGWServer3='{{ .Values.config.mme.ip }}';";
69 sqlite3 /data/datastoreRemRw.db "update FapServiceFapControlLteGateway_S1SigLinkServerListList set S1SigLinkServerList='{{ .Values.config.mme.ip }}';";
70 sqlite3 /data/datastoreRemRw.db "update FapServiceCellConfigLteRanRf set FreqBandIndicator='{{ .Values.config.vranL3.freqBand }}';";
71 sqlite3 /data/datastore.db "update featureActivation set good1PPSRequired=0;";
72 sqlite3 /data/datastoreRemRw.db "update FapServiceCellConfigLteRanRf_EARFCNDLList set EARFCNDL='{{ .Values.config.vranL3.earfcnDl }}';";
73 sqlite3 /data/datastoreRemRw.db "update FapServiceCellConfigLteRanRf_EARFCNULList set EARFCNUL='{{ .Values.config.vranL3.earfcnUl }}';";
74 sqlite3 /data/datastoreRemRw.db "update FapServiceCellConfigLteEpc set TAC='{{ .Values.config.vranL3.tac }}';";
75 sqlite3 /data/datastoreRemRw.db "update FapServiceCellConfigLteRanCommon set CellIdentity='{{ mul .Values.config.vranL3.enbId 256 }}';";
76 sqlite3 /data/datastoreRemRw.db "select * from FapServiceCellConfigLteEpc;";
77 redis-cli -h {{ .Values.config.redis.hostName }} -p {{ .Values.config.redis.ports.redisPort.port }} hset ENB_{{ .Values.config.vranL3.instanceId }}_FAPSERVICEFAPCONTROLLTEGATEWAYS1SIGLINKSERVERLIST[0] S1SIGLINKSERVERLIST {{ .Values.config.mme.ip }};
78 redis-cli -h {{ .Values.config.redis.hostName }} -p {{ .Values.config.redis.ports.redisPort.port }} hset ENB_{{ .Values.config.vranL3.instanceId }}_FAPSERVICEFAPCONTROLLTEGATEWAY_S1SIGLINKSERVERLISTLIST[0] S1SIGLINKSERVERLIST {{ .Values.config.mme.ip }};
79 redis-cli -h {{ .Values.config.redis.hostName }} -p {{ .Values.config.redis.ports.redisPort.port }} hset ENB_{{ .Values.config.vranL3.instanceId }}_FAPSERVICECELLCONFIGLTERANRF FREQBANDINDICATOR {{ .Values.config.vranL3.freqBand }};
80 redis-cli -h {{ .Values.config.redis.hostName }} -p {{ .Values.config.redis.ports.redisPort.port }} hset ENB_{{ .Values.config.vranL3.instanceId }}_FEATUREACTIVATION GOOD1PPSREQUIRED False;
81 redis-cli -h {{ .Values.config.redis.hostName }} -p {{ .Values.config.redis.ports.redisPort.port }} hset ENB_{{ .Values.config.vranL3.instanceId }}_FAPSERVICECELLCONFIGLTEEPCPLMNLIST[0] PLMNID {{ .Values.config.vranL3.plmnId }};
82 redis-cli -h {{ .Values.config.redis.hostName }} -p {{ .Values.config.redis.ports.redisPort.port }} hset ENB_{{ .Values.config.vranL3.instanceId }}_FAPSERVICECELLCONFIGLTERANRF_EARFCNDLLIST EARFCNDL {{ .Values.config.vranL3.earfcnDl }};
83 redis-cli -h {{ .Values.config.redis.hostName }} -p {{ .Values.config.redis.ports.redisPort.port }} hset ENB_{{ .Values.config.vranL3.instanceId }}_FAPSERVICECELLCONFIGLTERANRF_EARFCNULLIST EARFCNUL {{ .Values.config.vranL3.earfcnUl }};
84 redis-cli -h {{ .Values.config.redis.hostName }} -p {{ .Values.config.redis.ports.redisPort.port }} hset ENB_{{ .Values.config.vranL3.instanceId }}_FAPSERVICECELLCONFIGLTEEPC TAC {{ .Values.config.vranL3.tac }};
85 redis-cli -h {{ .Values.config.redis.hostName }} -p {{ .Values.config.redis.ports.redisPort.port }} hset ENB_{{ .Values.config.vranL3.instanceId }}_FAPSERVICECELLCONFIGLTERANCOMMON TAC {{ mul .Values.config.vranL3.enbId 256 }};
86 redis-cli -h {{ .Values.config.redis.hostName }} -p {{ .Values.config.redis.ports.redisPort.port }} hgetall ENB_{{ .Values.config.vranL3.instanceId }}_FAPSERVICEFAPCONTROLLTEGATEWAYS1SIGLINKSERVERLIST[0];
87 redis-cli -h {{ .Values.config.redis.hostName }} -p {{ .Values.config.redis.ports.redisPort.port }} hgetall ENB_{{ .Values.config.vranL3.instanceId }}_FAPSERVICEFAPCONTROLLTEGATEWAY_S1SIGLINKSERVERLISTLIST[0];
88 redis-cli -h {{ .Values.config.redis.hostName }} -p {{ .Values.config.redis.ports.redisPort.port }} hgetall ENB_{{ .Values.config.vranL3.instanceId }}_FAPSERVICECELLCONFIGLTERANRF;
89 redis-cli -h {{ .Values.config.redis.hostName }} -p {{ .Values.config.redis.ports.redisPort.port }} hgetall ENB_{{ .Values.config.vranL3.instanceId }}_FEATUREACTIVATION;
90 redis-cli -h {{ .Values.config.redis.hostName }} -p {{ .Values.config.redis.ports.redisPort.port }} hgetall ENB_{{ .Values.config.vranL3.instanceId }}_FAPSERVICECELLCONFIGLTEEPCPLMNLIST[0];
91 redis-cli -h {{ .Values.config.redis.hostName }} -p {{ .Values.config.redis.ports.redisPort.port }} hgetall ENB_{{ .Values.config.vranL3.instanceId }}_FAPSERVICECELLCONFIGLTERANRF_EARFCNDLLIST;
92 redis-cli -h {{ .Values.config.redis.hostName }} -p {{ .Values.config.redis.ports.redisPort.port }} hgetall ENB_{{ .Values.config.vranL3.instanceId }}_FAPSERVICECELLCONFIGLTERANRF_EARFCNULLIST;
93 redis-cli -h {{ .Values.config.redis.hostName }} -p {{ .Values.config.redis.ports.redisPort.port }} hgetall ENB_{{ .Values.config.vranL3.instanceId }}_FAPSERVICECELLCONFIGLTEEPC;
94 redis-cli -h {{ .Values.config.redis.hostName }} -p {{ .Values.config.redis.ports.redisPort.port }} hgetall ENB_{{ .Values.config.vranL3.instanceId }}_FAPSERVICECELLCONFIGLTERANCOMMON;
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: /