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