blob: 06f47bed4d096e94d90bab012bff7bb0d1b4e31f [file] [log] [blame]
Wei-Yu Chen0f12b9c2019-04-18 11:12:59 -07001---
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.
Hyunsun Moon636e17d2019-07-03 12:52:15 -050016
17{{- if eq .Values.mme.type "c3po" }}
Wei-Yu Chen0f12b9c2019-04-18 11:12:59 -070018---
19apiVersion: v1
20kind: ConfigMap
21metadata:
22 name: {{ .Values.mme.name }}
23data:
24 launch.sh: |
25 #!/bin/bash
26
27 cd /opt/c3po/mme/bin
28 cp /etc/mme/conf/{vbsm_cfg.txt,vbfd.conf} .
29
30 # from vbsm_cfg.txt
31 SGW_S11_IP=${SGW_S11_IP:-sgw.localdomain}
32 ENB_S1AP_IP=${ENB_S1AP_IP:-enb1.localdomain}
33 ENB_S1AP_PORT=${ENB_S1AP_PORT:-36412}
34 MME_ETH0_IP=${MME_ETH0_IP:-0.0.0.0}
35
36 # from vbfd.conf
37 HSS_CONNECT_PEER=${HSS_CONNECT_PEER:-hss.localdomain}
38 HSS_S6A_IP=${HSS_S6A_IP:-hss.localdomain}
39 HSS_PORT=${HSS_PORT:-3868}
40 VAR_HSS_REALM=${VAR_HSS_REALM:-openair4G.eur}
41
42 sed -i "s/SGW_S11_IP/$(dig $SGW_S11_IP +short)/g" vbsm_cfg.txt
43 sed -i "s/ENB_S1AP_IP/$ENB_S1AP_IP/g" vbsm_cfg.txt
44 sed -i "s/ENB_S1AP_PORT/$ENB_S1AP_PORT/g" vbsm_cfg.txt
45 sed -i "s/MME_ETH0_IP/$MME_ETH0_IP/g" vbsm_cfg.txt
46 sed -i "s/VAR_HSS_HOST/$HSS_CONNECT_PEER/g" vbsm_cfg.txt
47 sed -i "s/VAR_HSS_REALM/$VAR_HSS_REALM/g" vbsm_cfg.txt
48
49 MME_HOST=$(hostname)
50 MME_DOMAIN=$(dnsdomainname)
51 sed -i "s/HSS_CONNECT_PEER/$HSS_CONNECT_PEER/g" vbfd.conf
52 sed -i "s/HSS_S6A_IP/$HSS_S6A_IP/g" vbfd.conf
53 sed -i "s/HSS_PORT/$HSS_PORT/g" vbfd.conf
54 sed -i "s/MME_IDENTITY/$MME_HOST.$MME_DOMAIN/g" vbfd.conf
55 sed -i "s/MME_REALM/$MME_DOMAIN/g" vbfd.conf
56 sed -i "s/MME_HOST/$MME_HOST/g" vbfd.conf
57
58 # generate the certs
59 ./make_certs.sh $MME_HOST $MME_DOMAIN
60
61 # finally, launch
62 ./vb_acc
63 vbfd.conf: |
64 # -------- Test configuration ---------
65
66 # Identity = "<diameter_host>.<diameter_realm>";
67 Identity = "MME_IDENTITY";
68 Realm = "MME_REALM";
69 # Port = 3868;
70 # SecPort = 3869;
71
72 ConnectPeer = "HSS_CONNECT_PEER" { ConnectTo = "HSS_S6A_IP"; No_TLS; port = HSS_PORT; };
73
74 # TLS_Cred = "<diameter_host>.cert.pem", "<diameter_host>.key.pem";
75 TLS_Cred = "MME_HOST.cert.pem",
76 "MME_HOST.key.pem";
77 TLS_CA = "cacert.pem";
78
79 LoadExtension = "/usr/local/lib/freeDiameter/dict_3gpp2_avps.fdx";
80 LoadExtension = "/usr/local/lib/freeDiameter/dict_draftload_avps.fdx";
81 LoadExtension = "/usr/local/lib/freeDiameter/dict_etsi283034_avps.fdx";
82 LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc4004_avps.fdx";
83 LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc4006bis_avps.fdx";
84 LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc4072_avps.fdx";
85 LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc4590_avps.fdx";
86 LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc5447_avps.fdx";
87 LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc5580_avps.fdx";
88 LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc5777_avps.fdx";
89 LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc5778_avps.fdx";
90 LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc6734_avps.fdx";
91 LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc6942_avps.fdx";
92 LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc7155_avps.fdx";
93 LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc7683_avps.fdx";
94 LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc7944_avps.fdx";
95 LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29061_avps.fdx";
96 LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29128_avps.fdx";
97 LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29154_avps.fdx";
98 LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29173_avps.fdx";
99 LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29212_avps.fdx";
100 LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29214_avps.fdx";
101 LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29215_avps.fdx";
102 LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29217_avps.fdx";
103 LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29229_avps.fdx";
104 LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29272_avps.fdx";
105 LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29273_avps.fdx";
106 LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29329_avps.fdx";
107 LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29336_avps.fdx";
108 LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29337_avps.fdx";
109 LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29338_avps.fdx";
110 LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29343_avps.fdx";
111 LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29344_avps.fdx";
112 LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29345_avps.fdx";
113 LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29368_avps.fdx";
114 LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29468_avps.fdx";
115 LoadExtension = "/usr/local/lib/freeDiameter/dict_ts32299_avps.fdx";
116 LoadExtension = "/usr/local/lib/freeDiameter/dict_S6as6d.fdx";
117 LoadExtension = "/usr/local/lib/freeDiameter/dict_S6c.fdx";
118 LoadExtension = "/usr/local/lib/freeDiameter/dict_S6t.fdx";
119 LoadExtension = "/usr/local/lib/freeDiameter/dict_SGd.fdx";
120 LoadExtension = "/usr/local/lib/freeDiameter/dict_T6aT6bT7.fdx";
121 vbsm_cfg.txt: |
122 # Configuration file for MME
123
124 ##### NOTE: Please Do NOT change the order of the parameters #####
125
126 # EGTP related
127 VBSM_EG_DFLT_PORT 2123 # EGTP Default port
128 VBSM_EG_NONDFLT_PORT 2124 # EGTP Non Default port
129 VBSM_EG_S10_NONDFLT_PORT 2125 # EGTP Non Default
130 VBSM_EG_S3_NONDFLT_PORT 2126 # EGTP Non Default port for S3 interface towards SGSN
131 # port for S10
132 VBSM_EG_DFLT_HOST_NAME "sutlej.ccin.ccpu.com" # EGTP host name
133
134 # E-NodeB related
135 VBSM_ENB_ADDR_1 "ENB_S1AP_IP" # IP address of eNodeB
136 VBSM_ENB_PORT_1 "ENB_S1AP_PORT" # eNodeB port
137 #VBSM_ENB_ADDR_2 "172.26.20.180" # IP address of eNodeB
138 #VBSM_ENB_PORT_2 36422 # eNodeB port
139
140 # MME related
141 VBSM_MME_IPADDR "MME_ETH0_IP" # MME IP address
142 VBSM_MME_S1AP_IPADDR "MME_ETH0_IP" # MME IP address associated with the S1AP interface
143 VBSM_MME_EGTP_IPADDR "MME_ETH0_IP" # MME IP address associated with the EGTP interface
144 VBSM_MME_SCTP_PORT 36412 # MME SCTP port
145
146 VBSM_SGW_IPADDR "SGW_S11_IP" # SGW IP address
147 VBSM_PGW_IPADDR "192.168.1.105" # PDN-GW IP address
148
149 VBSM_UE_NUM 1000 # Support 1000 UE's
150 VBSM_SCTP_UDP_SERV_TYPE 0 #service type,default 0 SCTP
151
152 # Debug mask to be set; each represent
153 #different debug masks to be set (1 and 0 to unset)
154 #in the form |LVB_DBGMASK_INFO|LVB_DBGMASK_ERROR|LVB_DBGMASK_TRC|LVB_DBGMASK_MEM
155
156 VBSM_MME_DBG_MASK 1111
157 VBSM_DBG_MASK 1111
158 VBSM_NW_INIATED_DETACH_TIMER 1000
159
160 VBSM_MCC_DIG1 2
161 VBSM_MCC_DIG2 0
162 VBSM_MCC_DIG3 8
163
164 VBSM_MNC_DIG1 0
165 VBSM_MNC_DIG2 1
166 VBSM_MNC_DIG3 -1
167
168 # Target PLMN ID format [ MCC + MNC], + is concatination operator
169 # If MNC has two digits, the last charater shall be 'f'
170 # Valid Configurations: 11223f, 112345.
171 VBSM_TARGET_MME_PLMN_ID 31310f
172 VBSM_TARGET_MME_IP_ADDR "192.25.1.100"
173
174 VBSM_T3412 32
175
176 VBSM_SGSN_IP_ADDR "192.25.1.195"
177
178
179 VBSM_SGSN_PLMN_ID 31311f
180
181 VBSM_FD_CFG "vbfd.conf"
182 VBSM_HSS_HOST "VAR_HSS_HOST"
183 VBSM_HSS_REALM "VAR_HSS_REALM"
184
185 # set VBSM_DISABLE_EPC_DNS 0 - enable DNS, 1 - disable DNS
186 VBSM_DISABLE_EPC_DNS 1
187 VBSM_DISABLE_EIA0 1
188 VBSM_REL_CAP 1
189 VBSM_MME_NAME "vmmestandalone"
190 VBSM_S1C_SCTP_INSTREAMS 10
191 VBSM_S1C_SCTP_OUTSTREAMS 10
192 VBSM_MAX_ENB 2
193 VBSM_NO_OFGUMMEIS 1
194 VBSM_MMECODE 1
195 VBSM_MMEGRPID 1
196 VBSM_NO_OF_TAI 1
197 VBSM_TAI_LIST {{"{{1,2,0,8,0,1,1}}"}}
198
199 VBSM_SMS_ROUTER_HOST "smsrouter.test3gpp.net"
200 VBSM_SMS_ROUTER_REALM "test3gpp.net"
201---
202apiVersion: v1
203kind: Service
204metadata:
205 name: mme
206spec:
207 selector:
208 app: mme
209 clusterIP: None
210 ports:
211 - name: s11
212 port: 2123
213 protocol: UDP
214 - name: s1ap
215 port: 36412
216 protocol: TCP
217 - name: s6a
218 port: 3868
219 protocol: TCP
220---
221apiVersion: apps/v1
222kind: StatefulSet
223metadata:
224 name: {{ .Values.mme.name }}
225 labels:
226 app: {{ .Values.mme.name }}
227spec:
228 replicas: 1
229 selector:
230 matchLabels:
231 app: {{ .Values.mme.name }}
232 serviceName: {{ .Values.mme.name | quote }}
233 template:
234 metadata:
235 labels:
236 app: {{ .Values.mme.name }}
237 spec:
238 # Insert iptable rules as MME implements a userspace SCTP stack
239 initContainers:
240 - name: init-mme
241 image: {{ .Values.mme.initimage }}
242 command: [ "sh", "-c"]
243 securityContext:
244 capabilities:
245 add:
246 - NET_ADMIN
247 args:
248 - iptables -A OUTPUT -p sctp --sport 36412 --chunk-types any ABORT -j DROP;
249 until nslookup hss-0.{{ .Values.hss.name }}.{{ .Values.global.namespace }}.{{ .Values.global.fqdn }};
250 do echo "waiting for hss"; sleep 2; done;
251 containers:
252 - name: mme
253 image: {{ .Values.mme.image | quote }}
254 imagePullPolicy: {{ .Values.global.imagepullpolicy }}
255 env:
256 - name: SGW_S11_IP
257 value: cp-0.cp
258 - name: MME_ETH0_IP
259 valueFrom:
260 fieldRef:
261 fieldPath: status.podIP
262 - name: ENB_S1AP_IP
263 value: {{ .Values.enb.host | quote }}
264 - name: ENB_S1AP_PORT
265 value: {{ .Values.enb.port | quote }}
266 - name: HSS_CONNECT_PEER
267 value: hss-0.{{ .Values.hss.name }}.{{ .Values.global.namespace }}.{{ .Values.global.fqdn }}
268 - name: VAR_HSS_REALM
269 value: {{ .Values.hss.name }}.{{ .Values.global.namespace }}.{{ .Values.global.fqdn }}
270 - name: HSS_S6A_IP
271 value: hss-0.{{ .Values.hss.name }}.{{ .Values.global.namespace }}.{{ .Values.global.fqdn }}
272 - name: HSS_PORT
273 value: "3868"
274 stdin: true
275 tty: true
276 #command: [ "sleep", "3600"]
277 resources:
278 limits:
279 cpu: {{ .Values.mme.cpu | quote }}
280 memory: {{ .Values.mme.memory }}
281 volumeMounts:
282 - name: mme-script
283 mountPath: /opt/c3po/mme/bin/launch.sh
284 subPath: launch.sh
285 - name: mme-config
286 mountPath: /etc/mme/conf
287 volumes:
288 - name: mme-script
289 configMap:
290 name: {{ .Values.mme.name }}
291 defaultMode: 493
292 - name: mme-config
293 configMap:
294 name: {{ .Values.mme.name }}
295 defaultMode: 420
Hyunsun Moon636e17d2019-07-03 12:52:15 -0500296{{- end }}