blob: 71f22dd98cb5422e22358306ff2ce7afb9c1bb54 [file] [log] [blame]
Woojoong Kim67dac6d2019-08-02 12:20:31 -07001---
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---
17apiVersion: apps/v1
18kind: StatefulSet
19metadata:
20 name: {{ .Values.cu.name }}
21 labels:
22 app: {{ .Values.cu.name }}
23spec:
24 replicas: {{ .Values.cu.accelleran.replicas }}
25 selector:
26 matchLabels:
27 app: {{ .Values.cu.name }}
28 serviceName: {{ .Values.cu.name | quote }}
29 template:
30 metadata:
31 labels:
32 app: {{ .Values.cu.name }}
Woojoong Kim67dac6d2019-08-02 12:20:31 -070033 spec:
Hyunsun Moon0fa831a2019-09-27 18:01:26 -050034 terminationGracePeriodSeconds: 1
Woojoong Kim67dac6d2019-08-02 12:20:31 -070035 initContainers:
Hyunsun Moon0fa831a2019-09-27 18:01:26 -050036 - name: cu-init
Woojoong Kim67dac6d2019-08-02 12:20:31 -070037 image: {{ .Values.cu.accelleran.images.init }}
Hyunsun Moon0fa831a2019-09-27 18:01:26 -050038 securityContext:
39 privileged: true
40 runAsUser: 0
Woojoong Kim67dac6d2019-08-02 12:20:31 -070041 command: [ "sh", "-c"]
42 args:
Hyunsun Moon0fa831a2019-09-27 18:01:26 -050043 - >
44 iptables -I OUTPUT -p icmp --icmp-type destination-unreachable -j DROP;
45 if chroot /mnt/host-rootfs modinfo nf_conntrack_proto_sctp > /dev/null 2>&1; then \
46 chroot /mnt/host-rootfs modprobe nf_conntrack_proto_sctp; \
47 fi; \
48 volumeMounts:
49 - name: host-rootfs
50 mountPath: /mnt/host-rootfs
Woojoong Kim67dac6d2019-08-02 12:20:31 -070051 containers:
52 - name: nats
53 image: {{ .Values.cu.accelleran.images.nats }}
54 imagePullPolicy: IfNotPresent
55 stdin: true
56 tty: true
57 env:
58 - name: NATS_SERVICE_NAME
59 value: {{ .Values.cu.accelleran.nats.servicename }}
60 command: [ "sh", "-c"]
61 args:
62 - gnatsd -DV -c /etc/gnatsd.conf;
63 resources:
64 limits:
65 cpu: {{ .Values.cu.accelleran.resources.cpu }}
66 memory: {{ .Values.cu.accelleran.resources.mem }}
Woojoong Kim67dac6d2019-08-02 12:20:31 -070067 securityContext:
68 capabilities:
69 add:
70 - NET_ADMIN
71 - IPC_LOCK
72 - name: redis
73 image: {{ .Values.cu.accelleran.images.redis }}
74 imagePullPolicy: IfNotPresent
75 stdin: true
76 tty: true
77 command: ["sh", "-c"]
78 args:
79 # FIXME: Redis can't support with dns resolution, can't set hostname at here.
Woojoong Kimd5caad62019-08-28 19:13:27 -070080 - (sleep 5; redis-cli -h localhost -p {{ .Values.cu.accelleran.ports.redis }} set NATS_SERVICE_URL "nat://{{ .Values.cu.accelleran.node_ip }}:{{ .Values.cu.accelleran.ports.nats }}";) &
Woojoong Kim67dac6d2019-08-02 12:20:31 -070081 /usr/local/bin/redis-server
82 resources:
83 limits:
84 cpu: {{ .Values.cu.accelleran.resources.cpu }}
85 memory: {{ .Values.cu.accelleran.resources.mem }}
Woojoong Kim67dac6d2019-08-02 12:20:31 -070086 securityContext:
87 capabilities:
88 add:
89 - NET_ADMIN
90 - IPC_LOCK
91 - name: bbu
92 image: {{ .Values.cu.accelleran.images.bbu }}
Woojoong Kimd5433682019-08-26 15:06:16 -070093 imagePullPolicy: IfNotPresent
Woojoong Kim67dac6d2019-08-02 12:20:31 -070094 env:
95 - name: MME_IP
96 value: {{ .Values.mme.nodeport_ip_addr }}
97 stdin: true
98 tty: true
99 command: ["sh", "-c"]
100 # Configure BBU SCTP source port to `s1ap_external`, MME endpoint port to `mme_port` and configure BBU to use
101 # Removed ProgRAN-related command - you can see about it in `helm-chart/mcord/mcord-bbu`
102 args:
103 - sqlite3 /mnt/app/datastore.db "update cellS1apConfig set enbSctpPort={{ .Values.cu.accelleran.ports.s1ap }};";
104 sqlite3 /mnt/app/datastoreRemRw.db "update FapServiceFapControlLteGateway set S1SigLinkPort={{ .Values.mme.port }};";
Woojoong Kim90397c52019-08-28 17:49:45 -0700105 sqlite3 /mnt/app/datastoreRemRw.db "update FapServiceCellConfigLteEpcPlmnList set PLMNID={{ .Values.epc.config.plmnid }};";
Woojoong Kim67dac6d2019-08-02 12:20:31 -0700106 sqlite3 /mnt/app/datastore.db "insert into enbSctpSocketInterface ('interfaceName') values ('{{ .Values.enb.socket_interface }}');";
107 sqlite3 /mnt/app/datastore.db "update logging set severity=7 where id=25;";
Woojoong Kime0c94a82019-08-27 10:27:27 -0700108{{- if .Values.cu.accelleran.progran.enabled }}
109 sqlite3 /mnt/app/datastore.db "update featureActivation set mmeSlicingEnabled=1;";
110 sqlite3 /mnt/app/datastore.db "update featureActivation set ranSlicingEnabled=1;";
111 sqlite3 /mnt/app/datastore.db "insert into pranServerAddress (pranServerIpAddress,pranServerPort) values ('{{ .Values.cu.accelleran.progran.ip }}', {{ .Values.cu.accelleran.progran.port }});";
112{{- end}}
Woojoong Kim67dac6d2019-08-02 12:20:31 -0700113 sleep 10;
114 /l3/l3start;
115 volumeMounts:
116 - name: bbu-config
117 mountPath: /mnt/app/bootstrap.txt
118 subPath: bootstrap.txt
119 resources:
120 limits:
121 cpu: {{ .Values.cu.accelleran.resources.cpu }}
122 memory: {{ .Values.cu.accelleran.resources.mem }}
Woojoong Kim67dac6d2019-08-02 12:20:31 -0700123 securityContext:
124 capabilities:
125 add:
126 - NET_ADMIN
127 - IPC_LOCK
128 - SYS_NICE
129 volumes:
130 - name: bbu-config
131 configMap:
132 name: l3-config
133 items:
134 - key: bootstrap.txt
Woojoong Kimd5433682019-08-26 15:06:16 -0700135 path: bootstrap.txt
Hyunsun Moon0fa831a2019-09-27 18:01:26 -0500136 - name: host-rootfs
137 hostPath:
138 path: /