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