blob: f773eb106e3ff5be26e9a348e94908fc41a46a0e [file] [log] [blame]
Hyunsun Moon06f98552019-08-15 13:44:47 -06001{{/*
2Copyright 2018-present Open Networking Foundation
3Copyright 2018 Intel Corporation
Wei-Yu Chen0f12b9c2019-04-18 11:12:59 -07004
Hyunsun Moon06f98552019-08-15 13:44:47 -06005Licensed under the Apache License, Version 2.0 (the "License");
6you may not use this file except in compliance with the License.
7You may obtain a copy of the License at
8
9http://www.apache.org/licenses/LICENSE-2.0
10
11Unless required by applicable law or agreed to in writing, software
12distributed under the License is distributed on an "AS IS" BASIS,
13WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14See the License for the specific language governing permissions and
15limitations under the License.
16
17Default values for mcord-vepc-helm.
18This is a YAML-formatted file.
19Declare variables to be passed into your templates.
20*/}}
Hyunsun Moond8804b32019-08-18 00:31:43 -060021
22{{- if not (hasKey .Values.config.hss "hssdb") -}}
23{{- $_ := .Values.cassandra.fullnameOverride | set .Values.config.hss "hssdb" -}}
24{{- end }}
Wei-Yu Chen0f12b9c2019-04-18 11:12:59 -070025---
26apiVersion: v1
27kind: ConfigMap
28metadata:
Hyunsun Moon06f98552019-08-15 13:44:47 -060029 name: hss
30 labels:
Hyunsun Moon7a007bb2019-08-19 16:41:36 -060031{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 4 }}
Wei-Yu Chen0f12b9c2019-04-18 11:12:59 -070032data:
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---
211apiVersion: v1
212kind: Service
213metadata:
Hyunsun Moon06f98552019-08-15 13:44:47 -0600214 name: hss
215 labels:
Hyunsun Moon7a007bb2019-08-19 16:41:36 -0600216{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 4 }}
Wei-Yu Chen0f12b9c2019-04-18 11:12:59 -0700217spec:
218 selector:
Hyunsun Moon7a007bb2019-08-19 16:41:36 -0600219{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 4 }}
Wei-Yu Chen0f12b9c2019-04-18 11:12:59 -0700220 clusterIP: None
221 ports:
222 - name: s6a
223 port: 3868
224 protocol: TCP
225---
226apiVersion: apps/v1
227kind: StatefulSet
228metadata:
Hyunsun Moon06f98552019-08-15 13:44:47 -0600229 name: hss
Wei-Yu Chen0f12b9c2019-04-18 11:12:59 -0700230 labels:
Hyunsun Moon7a007bb2019-08-19 16:41:36 -0600231{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 4 }}
Wei-Yu Chen0f12b9c2019-04-18 11:12:59 -0700232spec:
233 replicas: 1
234 selector:
235 matchLabels:
Hyunsun Moon7a007bb2019-08-19 16:41:36 -0600236{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 6 }}
Hyunsun Moon06f98552019-08-15 13:44:47 -0600237 serviceName: hss
Wei-Yu Chen0f12b9c2019-04-18 11:12:59 -0700238 template:
239 metadata:
240 labels:
Hyunsun Moon7a007bb2019-08-19 16:41:36 -0600241{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 8 }}
Wei-Yu Chen0f12b9c2019-04-18 11:12:59 -0700242 spec:
Hyunsun Moon06f98552019-08-15 13:44:47 -0600243 {{- if .Values.nodeSelectors.enabled }}
244 nodeSelector:
245 {{ .Values.nodeSelectors.hss.label }}: {{ .Values.nodeSelectors.hss.value }}
246 {{- end }}
Wei-Yu Chen0f12b9c2019-04-18 11:12:59 -0700247 initContainers:
248 - name: init-hss
Hyunsun Moon06f98552019-08-15 13:44:47 -0600249 image: {{ .Values.images.tags.hssdb }}
250 imagePullPolicy: {{ .Values.images.pullPolicy }}
Wei-Yu Chen0f12b9c2019-04-18 11:12:59 -0700251 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 Moond8804b32019-08-18 00:31:43 -0600262 value: {{ .Values.config.hss.hssdb }}
Wei-Yu Chen0f12b9c2019-04-18 11:12:59 -0700263 - name: MME_HOST
Hyunsun Moon7a007bb2019-08-19 16:41:36 -0600264 value: {{ tuple "mme" "host" . | include "omec-control-plane.endpoint_lookup" | quote }}
Wei-Yu Chen0f12b9c2019-04-18 11:12:59 -0700265 - name: MME_REALM
Hyunsun Moon7a007bb2019-08-19 16:41:36 -0600266 value: {{ tuple "mme" "realm" . | include "omec-control-plane.endpoint_lookup" | quote }}
Wei-Yu Chen0f12b9c2019-04-18 11:12:59 -0700267 containers:
268 - name: hss
Hyunsun Moon06f98552019-08-15 13:44:47 -0600269 image: {{ .Values.images.tags.hss }}
270 imagePullPolicy: {{ .Values.images.pullPolicy }}
Wei-Yu Chen0f12b9c2019-04-18 11:12:59 -0700271 stdin: true
272 tty: true
273 env:
274 - name: HSSDB_ADDR
Hyunsun Moond8804b32019-08-18 00:31:43 -0600275 value: {{ .Values.config.hss.hssdb }}
Wei-Yu Chen0f12b9c2019-04-18 11:12:59 -0700276 - name: MME_IDENTITY
Hyunsun Moon7a007bb2019-08-19 16:41:36 -0600277 value: {{ tuple "mme" "identity" . | include "omec-control-plane.endpoint_lookup" | quote }}
Wei-Yu Chen0f12b9c2019-04-18 11:12:59 -0700278 command: ["bash", "-c", "/opt/c3po/hss/launch.sh; sleep 3600"]
Hyunsun Moon06f98552019-08-15 13:44:47 -0600279 {{- if .Values.resources.enabled }}
Wei-Yu Chen0f12b9c2019-04-18 11:12:59 -0700280 resources:
Hyunsun Moon06f98552019-08-15 13:44:47 -0600281{{ toYaml .Values.resources.hss | indent 10 }}
282 {{- end }}
Wei-Yu Chen0f12b9c2019-04-18 11:12:59 -0700283 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 Moon06f98552019-08-15 13:44:47 -0600292 name: hss
Wei-Yu Chen0f12b9c2019-04-18 11:12:59 -0700293 defaultMode: 493
294 - name: hss-config
295 configMap:
Hyunsun Moon06f98552019-08-15 13:44:47 -0600296 name: hss
Wei-Yu Chen0f12b9c2019-04-18 11:12:59 -0700297 defaultMode: 420