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 | # Default values for mcord-vepc-helm. |
| 18 | # This is a YAML-formatted file. |
| 19 | # Declare variables to be passed into your templates. |
| 20 | --- |
| 21 | apiVersion: v1 |
| 22 | kind: ConfigMap |
| 23 | metadata: |
| 24 | name: {{ .Values.hss.name }} |
| 25 | data: |
| 26 | acl.conf: | |
| 27 | ALLOW_OLD_TLS *.cluster.local |
| 28 | hss.conf: | |
| 29 | Identity = "HSS_IDENTITY"; |
| 30 | Realm = "HSS_REALM"; |
| 31 | TLS_Cred = "CONF_DIR/HSS_HOST.cert.pem", "CONF_DIR/HSS_HOST.key.pem"; |
| 32 | TLS_CA = "CONF_DIR/cacert.pem"; |
| 33 | No_SCTP; |
| 34 | Prefer_TCP; |
| 35 | No_IPv6; |
| 36 | SCTP_streams = 3; |
| 37 | NoRelay; |
| 38 | AppServThreads = 4; |
| 39 | Port = 3868; |
| 40 | SecPort = 5868; |
| 41 | LoadExtension = "/usr/local/lib/freeDiameter/acl_wl.fdx" : "CONF_DIR/acl.conf"; |
| 42 | LoadExtension = "/usr/local/lib/freeDiameter/dict_3gpp2_avps.fdx"; |
| 43 | LoadExtension = "/usr/local/lib/freeDiameter/dict_draftload_avps.fdx"; |
| 44 | LoadExtension = "/usr/local/lib/freeDiameter/dict_etsi283034_avps.fdx"; |
| 45 | LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc4004_avps.fdx"; |
| 46 | LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc4006bis_avps.fdx"; |
| 47 | LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc4072_avps.fdx"; |
| 48 | LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc4590_avps.fdx"; |
| 49 | LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc5447_avps.fdx"; |
| 50 | LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc5580_avps.fdx"; |
| 51 | LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc5777_avps.fdx"; |
| 52 | LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc5778_avps.fdx"; |
| 53 | LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc6734_avps.fdx"; |
| 54 | LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc6942_avps.fdx"; |
| 55 | LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc7155_avps.fdx"; |
| 56 | LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc7683_avps.fdx"; |
| 57 | LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc7944_avps.fdx"; |
| 58 | LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29061_avps.fdx"; |
| 59 | LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29128_avps.fdx"; |
| 60 | LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29154_avps.fdx"; |
| 61 | LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29173_avps.fdx"; |
| 62 | LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29212_avps.fdx"; |
| 63 | LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29214_avps.fdx"; |
| 64 | LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29215_avps.fdx"; |
| 65 | LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29217_avps.fdx"; |
| 66 | LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29229_avps.fdx"; |
| 67 | LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29272_avps.fdx"; |
| 68 | LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29273_avps.fdx"; |
| 69 | LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29329_avps.fdx"; |
| 70 | LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29336_avps.fdx"; |
| 71 | LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29337_avps.fdx"; |
| 72 | LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29338_avps.fdx"; |
| 73 | LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29343_avps.fdx"; |
| 74 | LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29344_avps.fdx"; |
| 75 | LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29345_avps.fdx"; |
| 76 | LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29368_avps.fdx"; |
| 77 | LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29468_avps.fdx"; |
| 78 | LoadExtension = "/usr/local/lib/freeDiameter/dict_ts32299_avps.fdx"; |
| 79 | LoadExtension = "/usr/local/lib/freeDiameter/dict_S6as6d.fdx"; |
| 80 | LoadExtension = "/usr/local/lib/freeDiameter/dict_S6t.fdx"; |
| 81 | LoadExtension = "/usr/local/lib/freeDiameter/dict_S6c.fdx"; |
| 82 | hss.json: | |
| 83 | {"common": { |
| 84 | "fdcfg": "CONF_DIR/hss.conf", |
| 85 | "originhost": "HSS_IDENTITY", |
| 86 | "originrealm": "HSS_REALM" |
| 87 | }, |
| 88 | "hss": { |
| 89 | "gtwhost": "*", |
| 90 | "gtwport" : 9080, |
| 91 | "restport" : 9081, |
| 92 | "ossport" : 9082, |
| 93 | "casssrv": "HSSDB_ADDR", |
| 94 | "cassusr": "root", |
| 95 | "casspwd": "root", |
| 96 | "cassdb" : "vhss", |
| 97 | "casscoreconnections" : 2, |
| 98 | "cassmaxconnections" : 8, |
| 99 | "cassioqueuesize" : 32768, |
| 100 | "cassiothreads" : 2, |
| 101 | "randv" : true, |
| 102 | "optkey" : "63bfa50ee6523365ff14c1f45f88737d", |
| 103 | "reloadkey" : true, |
| 104 | "logsize": 20, |
| 105 | "lognumber": 5, |
| 106 | "logname": "LOGS_DIR/hss.log", |
| 107 | "logqsize": 8192, |
| 108 | "statlogsize": 20, |
| 109 | "statlognumber": 5, |
| 110 | "statlogname": "LOGS_DIR/hss_stat.log", |
| 111 | "auditlogsize": 20, |
| 112 | "auditlognumber": 5, |
| 113 | "auditlogname": "LOGS_DIR/hss_audit.log", |
| 114 | "statfreq": 2000, |
| 115 | "numworkers": 4, |
| 116 | "concurrent": 10, |
| 117 | "ossfile": "CONF_DIR/oss.json" |
| 118 | } |
| 119 | } |
| 120 | oss.json: | |
| 121 | { |
| 122 | "option": { |
| 123 | "id": "url", |
| 124 | "type": "string" |
| 125 | }, |
| 126 | "services": [ |
| 127 | { |
| 128 | "id": "logger", |
| 129 | "commands": [ |
| 130 | { |
| 131 | "id": "describe_loggers" |
| 132 | }, |
| 133 | { |
| 134 | "id": "set_logger_level", |
| 135 | "options": [ |
| 136 | { |
| 137 | "id": "name", |
| 138 | "type": "string" |
| 139 | }, |
| 140 | { |
| 141 | "id": "level", |
| 142 | "type": "integer" |
| 143 | } |
| 144 | ] |
| 145 | } |
| 146 | ] |
| 147 | }, |
| 148 | { |
| 149 | "id": "stats", |
| 150 | "commands": [ |
| 151 | { |
| 152 | "id": "describe_stats_frequency" |
| 153 | }, |
| 154 | { |
| 155 | "id": "describe_stats_live" |
| 156 | }, |
| 157 | { |
| 158 | "id": "set_stats_frequency", |
| 159 | "options": [ |
| 160 | { |
| 161 | "id": "frequency", |
| 162 | "type": "integer" |
| 163 | } |
| 164 | ] |
| 165 | } |
| 166 | ] |
| 167 | } |
| 168 | ] |
| 169 | } |
| 170 | launch.sh: | |
| 171 | #!/bin/bash -x |
| 172 | |
| 173 | CONF_DIR="/opt/c3po/hss/conf" |
| 174 | LOGS_DIR="/opt/c3po/hss/logs" |
| 175 | mkdir -p $CONF_DIR $LOGS_DIR |
| 176 | |
| 177 | cp /etc/hss/conf/{acl.conf,hss.json,hss.conf,oss.json} $CONF_DIR |
| 178 | |
| 179 | HSS_HOST=$(hostname) |
| 180 | HSS_DOMAIN=$(dnsdomainname) |
| 181 | |
| 182 | # from hss.json |
| 183 | sed -i "s!HSS_IDENTITY!$HSS_HOST.$HSS_DOMAIN!g" $CONF_DIR/hss.json |
| 184 | sed -i "s!HSS_REALM!$HSS_DOMAIN!g" $CONF_DIR/hss.json |
| 185 | sed -i "s!HSSDB_ADDR!$HSSDB_ADDR!g" $CONF_DIR/hss.json |
| 186 | sed -i "s!CONF_DIR!$CONF_DIR!g" $CONF_DIR/hss.json |
| 187 | sed -i "s!LOGS_DIR!$LOGS_DIR!g" $CONF_DIR/hss.json |
| 188 | |
| 189 | # from hss.conf |
| 190 | sed -i "s!HSS_IDENTITY!$HSS_HOST.$HSS_DOMAIN!g" $CONF_DIR/hss.conf |
| 191 | sed -i "s!HSS_REALM!$HSS_DOMAIN!g" $CONF_DIR/hss.conf |
| 192 | sed -i "s!HSS_HOST!$HSS_HOST!g" $CONF_DIR/hss.conf |
| 193 | sed -i "s!CONF_DIR!$CONF_DIR!g" $CONF_DIR/hss.conf |
| 194 | cat $CONF_DIR/{hss.json,hss.conf} |
| 195 | |
| 196 | # If necessary, calculate the OPc value for each UE (User Equipment). |
| 197 | #./bin/hss -j conf/hss.json --onlyloadkey |
| 198 | cd $CONF_DIR |
| 199 | make_certs.sh $(hostname) $(dnsdomainname) |
| 200 | cd .. |
| 201 | # finally, launch |
| 202 | hss -j $CONF_DIR/hss.json |
| 203 | --- |
| 204 | apiVersion: v1 |
| 205 | kind: Service |
| 206 | metadata: |
| 207 | name: {{ .Values.hss.name }} |
| 208 | spec: |
| 209 | selector: |
| 210 | app: {{ .Values.hss.name }} |
| 211 | clusterIP: None |
| 212 | ports: |
| 213 | - name: s6a |
| 214 | port: 3868 |
| 215 | protocol: TCP |
| 216 | --- |
| 217 | apiVersion: apps/v1 |
| 218 | kind: StatefulSet |
| 219 | metadata: |
| 220 | name: {{ .Values.hss.name }} |
| 221 | labels: |
| 222 | app: {{ .Values.hss.name }} |
| 223 | spec: |
| 224 | replicas: 1 |
| 225 | selector: |
| 226 | matchLabels: |
| 227 | app: {{ .Values.hss.name }} |
| 228 | serviceName: {{ .Values.hss.name }} |
| 229 | template: |
| 230 | metadata: |
| 231 | labels: |
| 232 | app: {{ .Values.hss.name }} |
| 233 | spec: |
| 234 | initContainers: |
| 235 | - name: init-hss |
| 236 | image: {{ .Values.hss.initimage }} |
| 237 | imagePullPolicy: Always |
| 238 | command: [ "bash", "-xc"] |
| 239 | # TODO: Move the SIM card configuration into values.yaml |
| 240 | args: |
| 241 | - until nslookup $HSSDB_ADDR; do echo "waiting for hssdb"; sleep 2; done; |
| 242 | until cqlsh --file /opt/c3po/hssdb/oai_db.cql $HSSDB_ADDR; do echo "provisioning hssdb"; sleep 2; done; |
| 243 | until data_provisioning_users.sh 208014567891200 1122334455 apn1 465B5CE8B199B49FAA5F0A2EE238A6BC 10 $HSSDB_ADDR $MME_HOST.$MME_REALM $MME_REALM; |
| 244 | do echo "setting up users"; sleep 2; done; |
| 245 | until data_provisioning_mme.sh 1 19136246000 $MME_HOST.$MME_REALM $MME_REALM 1 $HSSDB_ADDR; do echo "setting up mme"; sleep 2; done; |
| 246 | until data_provisioning_mme.sh 1 19136246000 smsrouter.test3gpp.net test3gpp.net 0 $HSSDB_ADDR; do echo "setting up smsrouter"; sleep 2; done; |
| 247 | env: |
| 248 | - name: HSSDB_ADDR |
| 249 | value: {{ .Values.hssdb.name }} |
| 250 | - name: MME_HOST |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 251 | value: {{ tuple "mme" "host" . | include "mcord-services.endpoint_lookup" | quote }} |
Wei-Yu Chen | 0f12b9c | 2019-04-18 11:12:59 -0700 | [diff] [blame] | 252 | - name: MME_REALM |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 253 | value: {{ tuple "mme" "realm" . | include "mcord-services.endpoint_lookup" | quote }} |
Wei-Yu Chen | 0f12b9c | 2019-04-18 11:12:59 -0700 | [diff] [blame] | 254 | containers: |
| 255 | - name: hss |
| 256 | image: {{ .Values.hss.image }} |
| 257 | imagePullPolicy: {{ .Values.global.imagepullpolicy }} |
| 258 | stdin: true |
| 259 | tty: true |
| 260 | env: |
| 261 | - name: HSSDB_ADDR |
| 262 | value: {{ .Values.hssdb.name | quote }} |
| 263 | - name: MME_IDENTITY |
Hyunsun Moon | 636e17d | 2019-07-03 12:52:15 -0500 | [diff] [blame] | 264 | value: {{ tuple "mme" "identity" . | include "mcord-services.endpoint_lookup" | quote }} |
Wei-Yu Chen | 0f12b9c | 2019-04-18 11:12:59 -0700 | [diff] [blame] | 265 | command: ["bash", "-c", "/opt/c3po/hss/launch.sh; sleep 3600"] |
| 266 | resources: |
| 267 | limits: |
| 268 | cpu: {{ .Values.hss.cpu | quote }} |
| 269 | memory: {{ .Values.hss.memory }} |
| 270 | volumeMounts: |
| 271 | - name: hss-script |
| 272 | mountPath: /opt/c3po/hss/launch.sh |
| 273 | subPath: launch.sh |
| 274 | - name: hss-config |
| 275 | mountPath: /etc/hss/conf |
| 276 | volumes: |
| 277 | - name: hss-script |
| 278 | configMap: |
| 279 | name: {{ .Values.hss.name }} |
| 280 | defaultMode: 493 |
| 281 | - name: hss-config |
| 282 | configMap: |
| 283 | name: {{ .Values.hss.name }} |
| 284 | defaultMode: 420 |