blob: f0a88f0d4e261637b27bd0c6397f053a7004b2ed [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:
Woojoong Kim67dac6d2019-08-02 12:20:31 -070034 initContainers:
35 - name: init-iptables
36 image: {{ .Values.cu.accelleran.images.init }}
37 command: [ "sh", "-c"]
38 args:
39 - iptables -I OUTPUT -p icmp --icmp-type destination-unreachable -j DROP;
40 securityContext:
41 capabilities:
42 add:
43 - NET_ADMIN
44 terminationGracePeriodSeconds: 1
45 containers:
46 - name: nats
47 image: {{ .Values.cu.accelleran.images.nats }}
48 imagePullPolicy: IfNotPresent
49 stdin: true
50 tty: true
51 env:
52 - name: NATS_SERVICE_NAME
53 value: {{ .Values.cu.accelleran.nats.servicename }}
54 command: [ "sh", "-c"]
55 args:
56 - gnatsd -DV -c /etc/gnatsd.conf;
57 resources:
58 limits:
59 cpu: {{ .Values.cu.accelleran.resources.cpu }}
60 memory: {{ .Values.cu.accelleran.resources.mem }}
Woojoong Kim67dac6d2019-08-02 12:20:31 -070061 securityContext:
62 capabilities:
63 add:
64 - NET_ADMIN
65 - IPC_LOCK
66 - name: redis
67 image: {{ .Values.cu.accelleran.images.redis }}
68 imagePullPolicy: IfNotPresent
69 stdin: true
70 tty: true
71 command: ["sh", "-c"]
72 args:
73 # FIXME: Redis can't support with dns resolution, can't set hostname at here.
Woojoong Kimd5caad62019-08-28 19:13:27 -070074 - (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 -070075 /usr/local/bin/redis-server
76 resources:
77 limits:
78 cpu: {{ .Values.cu.accelleran.resources.cpu }}
79 memory: {{ .Values.cu.accelleran.resources.mem }}
Woojoong Kim67dac6d2019-08-02 12:20:31 -070080 securityContext:
81 capabilities:
82 add:
83 - NET_ADMIN
84 - IPC_LOCK
85 - name: bbu
86 image: {{ .Values.cu.accelleran.images.bbu }}
Woojoong Kimd5433682019-08-26 15:06:16 -070087 imagePullPolicy: IfNotPresent
Woojoong Kim67dac6d2019-08-02 12:20:31 -070088 env:
89 - name: MME_IP
90 value: {{ .Values.mme.nodeport_ip_addr }}
91 stdin: true
92 tty: true
93 command: ["sh", "-c"]
94 # Configure BBU SCTP source port to `s1ap_external`, MME endpoint port to `mme_port` and configure BBU to use
95 # Removed ProgRAN-related command - you can see about it in `helm-chart/mcord/mcord-bbu`
96 args:
97 - sqlite3 /mnt/app/datastore.db "update cellS1apConfig set enbSctpPort={{ .Values.cu.accelleran.ports.s1ap }};";
98 sqlite3 /mnt/app/datastoreRemRw.db "update FapServiceFapControlLteGateway set S1SigLinkPort={{ .Values.mme.port }};";
Woojoong Kim90397c52019-08-28 17:49:45 -070099 sqlite3 /mnt/app/datastoreRemRw.db "update FapServiceCellConfigLteEpcPlmnList set PLMNID={{ .Values.epc.config.plmnid }};";
Woojoong Kim67dac6d2019-08-02 12:20:31 -0700100 sqlite3 /mnt/app/datastore.db "insert into enbSctpSocketInterface ('interfaceName') values ('{{ .Values.enb.socket_interface }}');";
101 sqlite3 /mnt/app/datastore.db "update logging set severity=7 where id=25;";
Woojoong Kime0c94a82019-08-27 10:27:27 -0700102{{- if .Values.cu.accelleran.progran.enabled }}
103 sqlite3 /mnt/app/datastore.db "update featureActivation set mmeSlicingEnabled=1;";
104 sqlite3 /mnt/app/datastore.db "update featureActivation set ranSlicingEnabled=1;";
105 sqlite3 /mnt/app/datastore.db "insert into pranServerAddress (pranServerIpAddress,pranServerPort) values ('{{ .Values.cu.accelleran.progran.ip }}', {{ .Values.cu.accelleran.progran.port }});";
106{{- end}}
Woojoong Kim67dac6d2019-08-02 12:20:31 -0700107 sleep 10;
108 /l3/l3start;
109 volumeMounts:
110 - name: bbu-config
111 mountPath: /mnt/app/bootstrap.txt
112 subPath: bootstrap.txt
113 resources:
114 limits:
115 cpu: {{ .Values.cu.accelleran.resources.cpu }}
116 memory: {{ .Values.cu.accelleran.resources.mem }}
Woojoong Kim67dac6d2019-08-02 12:20:31 -0700117 securityContext:
118 capabilities:
119 add:
120 - NET_ADMIN
121 - IPC_LOCK
122 - SYS_NICE
123 volumes:
124 - name: bbu-config
125 configMap:
126 name: l3-config
127 items:
128 - key: bootstrap.txt
Woojoong Kimd5433682019-08-26 15:06:16 -0700129 path: bootstrap.txt