blob: 71f22dd98cb5422e22358306ff2ce7afb9c1bb54 [file] [log] [blame]
---
# Copyright 2019-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ .Values.cu.name }}
labels:
app: {{ .Values.cu.name }}
spec:
replicas: {{ .Values.cu.accelleran.replicas }}
selector:
matchLabels:
app: {{ .Values.cu.name }}
serviceName: {{ .Values.cu.name | quote }}
template:
metadata:
labels:
app: {{ .Values.cu.name }}
spec:
terminationGracePeriodSeconds: 1
initContainers:
- name: cu-init
image: {{ .Values.cu.accelleran.images.init }}
securityContext:
privileged: true
runAsUser: 0
command: [ "sh", "-c"]
args:
- >
iptables -I OUTPUT -p icmp --icmp-type destination-unreachable -j DROP;
if chroot /mnt/host-rootfs modinfo nf_conntrack_proto_sctp > /dev/null 2>&1; then \
chroot /mnt/host-rootfs modprobe nf_conntrack_proto_sctp; \
fi; \
volumeMounts:
- name: host-rootfs
mountPath: /mnt/host-rootfs
containers:
- name: nats
image: {{ .Values.cu.accelleran.images.nats }}
imagePullPolicy: IfNotPresent
stdin: true
tty: true
env:
- name: NATS_SERVICE_NAME
value: {{ .Values.cu.accelleran.nats.servicename }}
command: [ "sh", "-c"]
args:
- gnatsd -DV -c /etc/gnatsd.conf;
resources:
limits:
cpu: {{ .Values.cu.accelleran.resources.cpu }}
memory: {{ .Values.cu.accelleran.resources.mem }}
securityContext:
capabilities:
add:
- NET_ADMIN
- IPC_LOCK
- name: redis
image: {{ .Values.cu.accelleran.images.redis }}
imagePullPolicy: IfNotPresent
stdin: true
tty: true
command: ["sh", "-c"]
args:
# FIXME: Redis can't support with dns resolution, can't set hostname at here.
- (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 }}";) &
/usr/local/bin/redis-server
resources:
limits:
cpu: {{ .Values.cu.accelleran.resources.cpu }}
memory: {{ .Values.cu.accelleran.resources.mem }}
securityContext:
capabilities:
add:
- NET_ADMIN
- IPC_LOCK
- name: bbu
image: {{ .Values.cu.accelleran.images.bbu }}
imagePullPolicy: IfNotPresent
env:
- name: MME_IP
value: {{ .Values.mme.nodeport_ip_addr }}
stdin: true
tty: true
command: ["sh", "-c"]
# Configure BBU SCTP source port to `s1ap_external`, MME endpoint port to `mme_port` and configure BBU to use
# Removed ProgRAN-related command - you can see about it in `helm-chart/mcord/mcord-bbu`
args:
- sqlite3 /mnt/app/datastore.db "update cellS1apConfig set enbSctpPort={{ .Values.cu.accelleran.ports.s1ap }};";
sqlite3 /mnt/app/datastoreRemRw.db "update FapServiceFapControlLteGateway set S1SigLinkPort={{ .Values.mme.port }};";
sqlite3 /mnt/app/datastoreRemRw.db "update FapServiceCellConfigLteEpcPlmnList set PLMNID={{ .Values.epc.config.plmnid }};";
sqlite3 /mnt/app/datastore.db "insert into enbSctpSocketInterface ('interfaceName') values ('{{ .Values.enb.socket_interface }}');";
sqlite3 /mnt/app/datastore.db "update logging set severity=7 where id=25;";
{{- if .Values.cu.accelleran.progran.enabled }}
sqlite3 /mnt/app/datastore.db "update featureActivation set mmeSlicingEnabled=1;";
sqlite3 /mnt/app/datastore.db "update featureActivation set ranSlicingEnabled=1;";
sqlite3 /mnt/app/datastore.db "insert into pranServerAddress (pranServerIpAddress,pranServerPort) values ('{{ .Values.cu.accelleran.progran.ip }}', {{ .Values.cu.accelleran.progran.port }});";
{{- end}}
sleep 10;
/l3/l3start;
volumeMounts:
- name: bbu-config
mountPath: /mnt/app/bootstrap.txt
subPath: bootstrap.txt
resources:
limits:
cpu: {{ .Values.cu.accelleran.resources.cpu }}
memory: {{ .Values.cu.accelleran.resources.mem }}
securityContext:
capabilities:
add:
- NET_ADMIN
- IPC_LOCK
- SYS_NICE
volumes:
- name: bbu-config
configMap:
name: l3-config
items:
- key: bootstrap.txt
path: bootstrap.txt
- name: host-rootfs
hostPath:
path: /