blob: c6d0467558ad0fb0951efa83463151bd7860c874 [file] [log] [blame]
Wei-Yu Chen4182f962019-01-24 15:47:39 -08001---
2# Copyright 2018-present Open Networking Foundation
3# Copyright 2018 Intel Corporation
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
17---
18apiVersion: v1
19kind: Service
20metadata:
21 name: accelleran
22spec:
23 selector:
24 app: accelleran
25 clusterIP: None
26 ports:
27 - name: s1ap
28 port: {{ .Values.accelleran.ports.s1ap }}
29 protocol: TCP
30
31---
32apiVersion: apps/v1
33kind: StatefulSet
34metadata:
35 name: accelleran
36 labels:
37 app: accelleran
38spec:
39 replicas: {{ .Values.accelleran.replicas }}
40 selector:
41 matchLabels:
42 app: accelleran
43 serviceName: "accelleran"
44 template:
45 metadata:
46 labels:
47 app: accelleran
48 annotations:
49 k8s.v1.cni.cncf.io/networks: '[
50 { "name": "bbu-net", "interface": "vbbu-net", "namespace": "default" }
51 ]'
52 spec:
53 initContainers:
54 - name: init-iptables
55 image: {{ .Values.accelleran.images.init }}
56 command: [ "sh", "-c"]
57 args:
58 - iptables -I OUTPUT -p icmp --icmp-type destination-unreachable -j DROP;
59 securityContext:
60 capabilities:
61 add:
62 - NET_ADMIN
63 terminationGracePeriodSeconds: 1
64 containers:
65 - name: nats
66 image: {{ .Values.accelleran.images.nats }}
67 imagePullPolicy: IfNotPresent
68 stdin: true
69 tty: true
70 env:
71 - name: NATS_SERVICE_NAME
72 value: {{ .Values.accelleran.nats_service_name }}
73 command: [ "sh", "-c"]
74 args:
75 - gnatsd -DV -c /etc/gnatsd.conf;
76 resources:
77 limits:
78 cpu: {{ .Values.accelleran.resources.cpu }}
79 memory: {{ .Values.accelleran.resources.mem }}
80 intel.com/sriov: '2'
81 securityContext:
82 capabilities:
83 add:
84 - NET_ADMIN
85 - IPC_LOCK
86 - name: redis
87 image: {{ .Values.accelleran.images.redis }}
88 imagePullPolicy: IfNotPresent
89 stdin: true
90 tty: true
91 command: ["sh", "-c"]
92 args:
93 # FIXME: Redis can't support with dns resolution, can't set hostname at here.
Wei-Yu Chen353512d2019-01-30 13:28:48 -080094 - (sleep 5; redis-cli -h localhost -p 6379 set NATS_SERVICE_URL "nat://$(ip route get 116 | awk '{print $NF;exit}'):4222";) &
Wei-Yu Chen4182f962019-01-24 15:47:39 -080095 /usr/local/bin/redis-server
96 resources:
97 limits:
98 cpu: {{ .Values.accelleran.resources.cpu }}
99 memory: {{ .Values.accelleran.resources.mem }}
100 intel.com/sriov: '2'
101 securityContext:
102 capabilities:
103 add:
104 - NET_ADMIN
105 - IPC_LOCK
106 - name: bbu
107 image: {{ .Values.accelleran.images.bbu }}
Wei-Yu Chenb92af452019-01-31 12:08:19 -0800108 imagePullPolicy: Always
Wei-Yu Chen4182f962019-01-24 15:47:39 -0800109 env:
Wei-Yu Chenb92af452019-01-31 12:08:19 -0800110 - name: MME_IP
111 value: {{ .Values.mme_hostname }}
Wei-Yu Chen4182f962019-01-24 15:47:39 -0800112 stdin: true
113 tty: true
114 command: ["sh", "-c"]
115 args:
Wei-Yu Chenb92af452019-01-31 12:08:19 -0800116 - sqlite3 /mnt/app/datastore.db "insert into enbSctpSocketInterface ('interfaceName') values ('eth0');";
117 sqlite3 /mnt/app/datastore.db "update logging set severity=7 where id=25;"
Wei-Yu Chen4182f962019-01-24 15:47:39 -0800118 sleep 10;
119 /l3/l3start;
120 volumeMounts:
121 - name: bbu-config
122 mountPath: /mnt/app/bootstrap.txt
123 subPath: bootstrap.txt
124 resources:
125 limits:
126 cpu: {{ .Values.accelleran.resources.cpu }}
127 memory: {{ .Values.accelleran.resources.mem }}
128 intel.com/sriov: '2'
129 securityContext:
130 capabilities:
131 add:
132 - NET_ADMIN
133 - IPC_LOCK
134 - SYS_NICE
135 volumes:
136 - name: bbu-config
137 configMap:
138 name: l3-config
139 items:
140 - key: bootstrap.txt
141 path: bootstrap.txt
142