blob: dbf2655afebdc0fee8e52a0a20b9e8316f9d7a49 [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
Pingping Lin79f84702019-02-05 18:38:40 -080025 clusterIP: None
Wei-Yu Chen4182f962019-01-24 15:47:39 -080026 ports:
27 - name: s1ap
28 port: {{ .Values.accelleran.ports.s1ap }}
29 protocol: TCP
Matteo Scandolodec3f272019-02-04 13:57:35 -080030---
31apiVersion: v1
32kind: Service
33metadata:
Pingping Lin79f84702019-02-05 18:38:40 -080034 name: accelleran-external
Matteo Scandolodec3f272019-02-04 13:57:35 -080035spec:
36 selector:
Pingping Lin79f84702019-02-05 18:38:40 -080037 app: accelleran-external
Matteo Scandolodec3f272019-02-04 13:57:35 -080038 type: NodePort
39 ports:
40 - port: {{ .Values.accelleran.ports.s1ap }}
Pingping Lin79f84702019-02-05 18:38:40 -080041 nodePort: {{ .Values.accelleran.ports.s1ap_external }}
Matteo Scandolodec3f272019-02-04 13:57:35 -080042 protocol: TCP
Wei-Yu Chen4182f962019-01-24 15:47:39 -080043---
44apiVersion: apps/v1
45kind: StatefulSet
46metadata:
47 name: accelleran
48 labels:
49 app: accelleran
50spec:
51 replicas: {{ .Values.accelleran.replicas }}
52 selector:
53 matchLabels:
54 app: accelleran
55 serviceName: "accelleran"
56 template:
57 metadata:
58 labels:
59 app: accelleran
60 annotations:
61 k8s.v1.cni.cncf.io/networks: '[
62 { "name": "bbu-net", "interface": "vbbu-net", "namespace": "default" }
63 ]'
64 spec:
65 initContainers:
66 - name: init-iptables
67 image: {{ .Values.accelleran.images.init }}
68 command: [ "sh", "-c"]
69 args:
70 - iptables -I OUTPUT -p icmp --icmp-type destination-unreachable -j DROP;
71 securityContext:
72 capabilities:
73 add:
74 - NET_ADMIN
75 terminationGracePeriodSeconds: 1
76 containers:
77 - name: nats
78 image: {{ .Values.accelleran.images.nats }}
79 imagePullPolicy: IfNotPresent
80 stdin: true
81 tty: true
82 env:
83 - name: NATS_SERVICE_NAME
84 value: {{ .Values.accelleran.nats_service_name }}
85 command: [ "sh", "-c"]
86 args:
87 - gnatsd -DV -c /etc/gnatsd.conf;
88 resources:
89 limits:
90 cpu: {{ .Values.accelleran.resources.cpu }}
91 memory: {{ .Values.accelleran.resources.mem }}
92 intel.com/sriov: '2'
93 securityContext:
94 capabilities:
95 add:
96 - NET_ADMIN
97 - IPC_LOCK
98 - name: redis
99 image: {{ .Values.accelleran.images.redis }}
100 imagePullPolicy: IfNotPresent
101 stdin: true
102 tty: true
103 command: ["sh", "-c"]
104 args:
105 # FIXME: Redis can't support with dns resolution, can't set hostname at here.
Wei-Yu Chen353512d2019-01-30 13:28:48 -0800106 - (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 -0800107 /usr/local/bin/redis-server
108 resources:
109 limits:
110 cpu: {{ .Values.accelleran.resources.cpu }}
111 memory: {{ .Values.accelleran.resources.mem }}
112 intel.com/sriov: '2'
113 securityContext:
114 capabilities:
115 add:
116 - NET_ADMIN
117 - IPC_LOCK
118 - name: bbu
119 image: {{ .Values.accelleran.images.bbu }}
Wei-Yu Chenb92af452019-01-31 12:08:19 -0800120 imagePullPolicy: Always
Wei-Yu Chen4182f962019-01-24 15:47:39 -0800121 env:
Wei-Yu Chenb92af452019-01-31 12:08:19 -0800122 - name: MME_IP
123 value: {{ .Values.mme_hostname }}
Wei-Yu Chen4182f962019-01-24 15:47:39 -0800124 stdin: true
125 tty: true
126 command: ["sh", "-c"]
127 args:
Wei-Yu Chenb92af452019-01-31 12:08:19 -0800128 - sqlite3 /mnt/app/datastore.db "insert into enbSctpSocketInterface ('interfaceName') values ('eth0');";
129 sqlite3 /mnt/app/datastore.db "update logging set severity=7 where id=25;"
Wei-Yu Chen4182f962019-01-24 15:47:39 -0800130 sleep 10;
131 /l3/l3start;
132 volumeMounts:
133 - name: bbu-config
134 mountPath: /mnt/app/bootstrap.txt
135 subPath: bootstrap.txt
136 resources:
137 limits:
138 cpu: {{ .Values.accelleran.resources.cpu }}
139 memory: {{ .Values.accelleran.resources.mem }}
140 intel.com/sriov: '2'
141 securityContext:
142 capabilities:
143 add:
144 - NET_ADMIN
145 - IPC_LOCK
146 - SYS_NICE
147 volumes:
148 - name: bbu-config
149 configMap:
150 name: l3-config
151 items:
152 - key: bootstrap.txt
153 path: bootstrap.txt
154