blob: c47266c9cd1cc450bffe8372c072dfe1bec74277 [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 }}
33 annotations:
34 k8s.v1.cni.cncf.io/networks: '[
35 { "name": "f1-net-cu", "interface": "f1-net-cu" }
36 ]'
37
38 spec:
39 nodeSelector:
40{{ toYaml .Values.cu.nodeselector | indent 8 }}
41 initContainers:
42 - name: init-iptables
43 image: {{ .Values.cu.accelleran.images.init }}
44 command: [ "sh", "-c"]
45 args:
46 - iptables -I OUTPUT -p icmp --icmp-type destination-unreachable -j DROP;
47 securityContext:
48 capabilities:
49 add:
50 - NET_ADMIN
51 terminationGracePeriodSeconds: 1
52 containers:
53 - name: nats
54 image: {{ .Values.cu.accelleran.images.nats }}
55 imagePullPolicy: IfNotPresent
56 stdin: true
57 tty: true
58 env:
59 - name: NATS_SERVICE_NAME
60 value: {{ .Values.cu.accelleran.nats.servicename }}
61 command: [ "sh", "-c"]
62 args:
63 - gnatsd -DV -c /etc/gnatsd.conf;
64 resources:
65 limits:
66 cpu: {{ .Values.cu.accelleran.resources.cpu }}
67 memory: {{ .Values.cu.accelleran.resources.mem }}
68{{- if .Values.network.sriov.enabled }}
69 intel.com/sriov_netdevice: '2'
70{{- end }}
71 securityContext:
72 capabilities:
73 add:
74 - NET_ADMIN
75 - IPC_LOCK
76 - name: redis
77 image: {{ .Values.cu.accelleran.images.redis }}
78 imagePullPolicy: IfNotPresent
79 stdin: true
80 tty: true
81 command: ["sh", "-c"]
82 args:
83 # FIXME: Redis can't support with dns resolution, can't set hostname at here.
84 - (sleep 5; redis-cli -h localhost -p 6379 set NATS_SERVICE_URL "nat://$(ip route get 116 | awk '{print $NF;exit}'):4222";) &
85 /usr/local/bin/redis-server
86 resources:
87 limits:
88 cpu: {{ .Values.cu.accelleran.resources.cpu }}
89 memory: {{ .Values.cu.accelleran.resources.mem }}
90{{- if .Values.network.sriov.enabled }}
91 intel.com/sriov_netdevice: '2'
92{{- end }}
93 securityContext:
94 capabilities:
95 add:
96 - NET_ADMIN
97 - IPC_LOCK
98 - name: bbu
99 image: {{ .Values.cu.accelleran.images.bbu }}
Woojoong Kimd5433682019-08-26 15:06:16 -0700100 imagePullPolicy: IfNotPresent
Woojoong Kim67dac6d2019-08-02 12:20:31 -0700101 env:
102 - name: MME_IP
103 value: {{ .Values.mme.nodeport_ip_addr }}
104 stdin: true
105 tty: true
106 command: ["sh", "-c"]
107 # Configure BBU SCTP source port to `s1ap_external`, MME endpoint port to `mme_port` and configure BBU to use
108 # Removed ProgRAN-related command - you can see about it in `helm-chart/mcord/mcord-bbu`
109 args:
110 - sqlite3 /mnt/app/datastore.db "update cellS1apConfig set enbSctpPort={{ .Values.cu.accelleran.ports.s1ap }};";
111 sqlite3 /mnt/app/datastoreRemRw.db "update FapServiceFapControlLteGateway set S1SigLinkPort={{ .Values.mme.port }};";
112 sqlite3 /mnt/app/datastore.db "insert into enbSctpSocketInterface ('interfaceName') values ('{{ .Values.enb.socket_interface }}');";
113 sqlite3 /mnt/app/datastore.db "update logging set severity=7 where id=25;";
114 sleep 10;
115 /l3/l3start;
116 volumeMounts:
117 - name: bbu-config
118 mountPath: /mnt/app/bootstrap.txt
119 subPath: bootstrap.txt
120 resources:
121 limits:
122 cpu: {{ .Values.cu.accelleran.resources.cpu }}
123 memory: {{ .Values.cu.accelleran.resources.mem }}
124{{- if .Values.network.sriov.enabled }}
125 intel.com/sriov_netdevice: '2'
126{{- end }}
127 securityContext:
128 capabilities:
129 add:
130 - NET_ADMIN
131 - IPC_LOCK
132 - SYS_NICE
133 volumes:
134 - name: bbu-config
135 configMap:
136 name: l3-config
137 items:
138 - key: bootstrap.txt
Woojoong Kimd5433682019-08-26 15:06:16 -0700139 path: bootstrap.txt