COMAC-165 Refactoring omec-control-plane HSS

- Split hss.yaml to resource specific files
- Separate job for DB sync and initial MME and user
- Make initial MME and user data configurable
- Change to use static OPC for default users

Change-Id: Ic4be24fcc5a00282ac6bd39f07a1cfc886829823
diff --git a/omec/omec-control-plane/Chart.yaml b/omec/omec-control-plane/Chart.yaml
index a3ba319..f6018f7 100644
--- a/omec/omec-control-plane/Chart.yaml
+++ b/omec/omec-control-plane/Chart.yaml
@@ -18,4 +18,4 @@
 appVersion: "1.0"
 description: OMEC control plane services
 name: omec-control-plane
-version: 0.1.1
+version: 0.1.2
diff --git a/omec/omec-control-plane/templates/bin/_hss-bootstrap.sh.tpl b/omec/omec-control-plane/templates/bin/_hss-bootstrap.sh.tpl
new file mode 100644
index 0000000..096a434
--- /dev/null
+++ b/omec/omec-control-plane/templates/bin/_hss-bootstrap.sh.tpl
@@ -0,0 +1,92 @@
+#!/bin/bash
+#
+# Copyright 2019-present Open Networking Foundation
+# Copyright 2018 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -ex
+
+function provision_users() {
+    imsi=$1
+    msisdn=$2
+    apn=$3
+    key=$4
+    opc=$5
+    no_of_users=$6
+    cassandra_ip=$7
+    mmeidentity=$8
+    mmerealm=$9
+
+    for (( i=1; i<=$no_of_users; i++ )); do
+        echo "IMSI=$imsi MSISDN=$msisdn"
+        cqlsh $cassandra_ip -e "INSERT INTO vhss.users_imsi (imsi, msisdn, access_restriction, key, opc, mmehost, mmeidentity_idmmeidentity, mmerealm, rand, sqn, subscription_data) VALUES ('$imsi', $msisdn, 41, '$key', '$opc', '$mmeidentity', 3, '$mmerealm', '2683b376d1056746de3b254012908e0e', 96, '{\"Subscription-Data\":{\"Access-Restriction-Data\":41,\"Subscriber-Status\":0,\"Network-Access-Mode\":2,\"Regional-Subscription-Zone-Code\":[\"0x0123\",\"0x4567\",\"0x89AB\",\"0xCDEF\",\"0x1234\",\"0x5678\",\"0x9ABC\",\"0xDEF0\",\"0x2345\",\"0x6789\"],\"MSISDN\":\"0x$msisdn\",\"AMBR\":{\"Max-Requested-Bandwidth-UL\":50000000,\"Max-Requested-Bandwidth-DL\":100000000},\"APN-Configuration-Profile\":{\"Context-Identifier\":0,\"All-APN-Configurations-Included-Indicator\":0,\"APN-Configuration\":{\"Context-Identifier\":0,\"PDN-Type\":0,\"Served-Party-IP-Address\":[\"10.0.0.1\",\"10.0.0.2\"],\"Service-Selection\":\"apn1\",\"EPS-Subscribed-QoS-Profile\":{\"QoS-Class-Identifier\":9,\"Allocation-Retention-Priority\":{\"Priority-Level\":15,\"Pre-emption-Capability\":0,\"Pre-emption-Vulnerability\":0}},\"AMBR\":{\"Max-Requested-Bandwidth-UL\":50000000,\"Max-Requested-Bandwidth-DL\":100000000},\"PDN-GW-Allocation-Type\":0,\"MIP6-Agent-Info\":{\"MIP-Home-Agent-Address\":[\"172.26.17.183\"]}}},\"Subscribed-Periodic-RAU-TAU-Timer\":0}}');"
+        if [ $? -ne 0 ];then
+           echo -e "oops! Something went wrong adding to vhss.users_imsi!\n"
+           exit 1
+        fi
+
+        cqlsh $cassandra_ip -e "INSERT INTO vhss.msisdn_imsi (msisdn, imsi) VALUES ($msisdn, '$imsi');"
+        if [ $? -ne 0 ];then
+           echo -e "oops! Something went wrong adding to vhss.msisdn_imsi!\n"
+           exit 1
+        fi
+
+        imsi=`expr $imsi + 1`;
+        msisdn=`expr $msisdn + 1`
+    done
+
+    echo -e "The provisioning is successful\n"
+}
+
+function provision_mme() {
+    id=$1
+    isdn=$2
+    host=$3
+    realm=$4
+    uereachability=$5
+    cassandra_ip=$6
+
+    cqlsh $cassandra_ip -e "INSERT INTO vhss.mmeidentity (idmmeidentity, mmeisdn, mmehost, mmerealm, ue_reachability) VALUES ($id, '$isdn', '$host', '$realm', $uereachability);"
+    if [ $? -ne 0 ];then
+       echo -e "oops! Something went wrong adding to vhss.mmeidentity!\n"
+       exit 1
+    fi
+
+    cqlsh $cassandra_ip -e "INSERT INTO vhss.mmeidentity_host (idmmeidentity, mmeisdn, mmehost, mmerealm, ue_reachability) VALUES ($id, '$isdn', '$host', '$realm', $uereachability);"
+    if [ $? -ne 0 ];then
+       echo -e "oops! Something went wrong adding to vhss.mmeidentity_host!\n"
+       exit 1
+    fi
+
+    echo -e "The mme identity provisioning is successfull\n"
+}
+
+provision_users \
+    {{ .Values.config.hss.bootstrap.users.imsi }} \
+    {{ .Values.config.hss.bootstrap.users.msisdn }} \
+    {{ .Values.config.hss.bootstrap.users.apn }} \
+    {{ .Values.config.hss.bootstrap.users.key }} \
+    {{ .Values.config.hss.bootstrap.users.opc }} \
+    {{ .Values.config.hss.bootstrap.users.numbers }} \
+    {{ .Values.config.hss.hssdb }} \
+    {{ tuple "mme" "identity" . | include "omec-control-plane.endpoint_lookup" }} \
+    {{ tuple "mme" "reaml" . | include "omec-control-plane.endpoint_lookup" }}
+
+provision_mme \
+    {{ .Values.config.hss.bootstrap.mme.id }} \
+    {{ .Values.config.hss.bootstrap.mme.isdn }} \
+    {{ tuple "mme" "identity" . | include "omec-control-plane.endpoint_lookup" }} \
+    {{ tuple "mme" "realm" . | include "omec-control-plane.endpoint_lookup" }} \
+    {{ .Values.config.hss.bootstrap.mme.unreachability }} \
+    {{ .Values.config.hss.hssdb }}
diff --git a/omec/omec-control-plane/templates/bin/_hss-run.sh.tpl b/omec/omec-control-plane/templates/bin/_hss-run.sh.tpl
new file mode 100644
index 0000000..9782de2
--- /dev/null
+++ b/omec/omec-control-plane/templates/bin/_hss-run.sh.tpl
@@ -0,0 +1,30 @@
+#!/bin/bash
+#
+# Copyright 2019-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -ex
+
+CONF_DIR="/opt/c3po/hss/conf"
+LOGS_DIR="/opt/c3po/hss/logs"
+mkdir -p $CONF_DIR $LOGS_DIR
+
+cp /etc/hss/conf/{acl.conf,hss.json,hss.conf,oss.json} $CONF_DIR
+cat $CONF_DIR/{hss.json,hss.conf}
+
+cd $CONF_DIR
+make_certs.sh {{ tuple "hss" "host" . | include "omec-control-plane.endpoint_lookup" }} {{ tuple "hss" "realm" . | include "omec-control-plane.endpoint_lookup" }}
+
+cd ..
+hss -j $CONF_DIR/hss.json
diff --git a/omec/omec-control-plane/templates/configmap-hss.yaml b/omec/omec-control-plane/templates/configmap-hss.yaml
new file mode 100644
index 0000000..76760e0
--- /dev/null
+++ b/omec/omec-control-plane/templates/configmap-hss.yaml
@@ -0,0 +1,110 @@
+{{/*
+Copyright 2019-present Open Networking Foundation
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+Default values for mcord-vepc-helm.
+This is a YAML-formatted file.
+Declare variables to be passed into your templates.
+*/}}
+
+{{- $hssJson := index .Values.config.hss.cfgFiles "hss.json" }}
+{{- $hssJsonCommon := index $hssJson "common" }}
+{{- $hssJsonHss := index $hssJson "hss" }}
+
+{{- if not (hasKey $hssJsonCommon "originhost") -}}
+{{- $_ := tuple "hss" "identity" . | include "omec-control-plane.endpoint_lookup" | set $hssJsonCommon "originhost" -}}
+{{- end }}
+{{- if not (hasKey $hssJsonCommon "originrealm") -}}
+{{- $_ := tuple "hss" "realm" . | include "omec-control-plane.endpoint_lookup" | set $hssJsonCommon "originrealm" -}}
+{{- end }}
+{{- if not (hasKey $hssJsonHss "casssrv") -}}
+{{- $_ := .Values.cassandra.fullnameOverride | set $hssJsonHss "casssrv" -}}
+{{- end }}
+---
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: hss
+  labels:
+{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+data:
+  acl.conf: |
+  {{- if hasKey .Values.config.hss.acl "oldTls" }}
+    ALLOW_OLD_TLS {{ .Values.config.hss.acl.oldTls }}
+  {{- end }}
+  {{- if hasKey .Values.config.hss.acl "ipSec" }}
+    ALLOW_IPSEC {{ .Values.config.hss.acl.ipSec }}
+  {{- end }}
+  hss.conf: |
+    Identity = {{ tuple "hss" "identity" . | include "omec-control-plane.endpoint_lookup" | quote }};
+    Realm = {{ tuple "hss" "realm" . | include "omec-control-plane.endpoint_lookup" | quote }};
+    TLS_Cred = "/opt/c3po/hss/conf/{{ tuple "hss" "host" . | include "omec-control-plane.endpoint_lookup" }}.cert.pem",
+               "/opt/c3po/hss/conf/{{ tuple "hss" "host" . | include "omec-control-plane.endpoint_lookup" }}.key.pem";
+    TLS_CA = "/opt/c3po/hss/conf/cacert.pem";
+    No_SCTP;
+    Prefer_TCP;
+    No_IPv6;
+    SCTP_streams = 3;
+    NoRelay;
+    AppServThreads = 4;
+    Port = 3868;
+    SecPort = 5868;
+    LoadExtension = "/usr/local/lib/freeDiameter/acl_wl.fdx" : "/opt/c3po/hss/conf/acl.conf";
+    LoadExtension = "/usr/local/lib/freeDiameter/dict_3gpp2_avps.fdx";
+    LoadExtension = "/usr/local/lib/freeDiameter/dict_draftload_avps.fdx";
+    LoadExtension = "/usr/local/lib/freeDiameter/dict_etsi283034_avps.fdx";
+    LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc4004_avps.fdx";
+    LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc4006bis_avps.fdx";
+    LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc4072_avps.fdx";
+    LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc4590_avps.fdx";
+    LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc5447_avps.fdx";
+    LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc5580_avps.fdx";
+    LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc5777_avps.fdx";
+    LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc5778_avps.fdx";
+    LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc6734_avps.fdx";
+    LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc6942_avps.fdx";
+    LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc7155_avps.fdx";
+    LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc7683_avps.fdx";
+    LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc7944_avps.fdx";
+    LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29061_avps.fdx";
+    LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29128_avps.fdx";
+    LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29154_avps.fdx";
+    LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29173_avps.fdx";
+    LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29212_avps.fdx";
+    LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29214_avps.fdx";
+    LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29215_avps.fdx";
+    LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29217_avps.fdx";
+    LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29229_avps.fdx";
+    LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29272_avps.fdx";
+    LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29273_avps.fdx";
+    LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29329_avps.fdx";
+    LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29336_avps.fdx";
+    LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29337_avps.fdx";
+    LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29338_avps.fdx";
+    LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29343_avps.fdx";
+    LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29344_avps.fdx";
+    LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29345_avps.fdx";
+    LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29368_avps.fdx";
+    LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29468_avps.fdx";
+    LoadExtension = "/usr/local/lib/freeDiameter/dict_ts32299_avps.fdx";
+    LoadExtension = "/usr/local/lib/freeDiameter/dict_S6as6d.fdx";
+    LoadExtension = "/usr/local/lib/freeDiameter/dict_S6t.fdx";
+    LoadExtension = "/usr/local/lib/freeDiameter/dict_S6c.fdx";
+  hss-run.sh: |
+{{ tuple "bin/_hss-run.sh.tpl" . | include "omec-control-plane.template" | indent 4 }}
+  hss-bootstrap.sh: |
+{{ tuple "bin/_hss-bootstrap.sh.tpl" . | include "omec-control-plane.template" | indent 4 }}
+{{- range $key, $value := .Values.config.hss.cfgFiles }}
+  {{ $key }}: {{ toJson $value | quote }}
+{{- end }}
diff --git a/omec/omec-control-plane/templates/configmap-mme.yaml b/omec/omec-control-plane/templates/configmap-mme.yaml
index 7ca3852..663af63 100644
--- a/omec/omec-control-plane/templates/configmap-mme.yaml
+++ b/omec/omec-control-plane/templates/configmap-mme.yaml
@@ -14,11 +14,14 @@
 limitations under the License.
 */}}
 
-{{- if not (hasKey .Values.config.mme.appConfig.s6a "host") -}}
-{{- $_ := tuple "hss" "identity" . | include "omec-control-plane.endpoint_lookup" | set .Values.config.mme.appConfig.s6a "host" -}}
+{{- $configJson := index .Values.config.mme.cfgFiles "config.json" }}
+{{- $configJsonS6a := index $configJson "s6a" }}
+
+{{- if not (hasKey $configJsonS6a "host") -}}
+{{- $_ := tuple "hss" "identity" . | include "omec-control-plane.endpoint_lookup" | set $configJsonS6a "host" -}}
 {{- end }}
-{{- if not (hasKey .Values.config.mme.appConfig.s6a "realm") -}}
-{{- $_ := tuple "hss" "realm" . | include "omec-control-plane.endpoint_lookup" | set .Values.config.mme.appConfig.s6a "realm" -}}
+{{- if not (hasKey $configJsonS6a "realm") -}}
+{{- $_ := tuple "hss" "realm" . | include "omec-control-plane.endpoint_lookup" | set $configJsonS6a "realm" -}}
 {{- end }}
 ---
 apiVersion: v1
@@ -28,26 +31,21 @@
   labels:
 {{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 4 }}
 data:
-  config.json: {{ toJson .Values.config.mme.appConfig | quote }}
   s6a_fd.conf: |
+    Identity = {{ tuple "mme" "identity" . | include "omec-control-plane.endpoint_lookup" | quote }};
+    Realm = {{ tuple "mme" "realm" . | include "omec-control-plane.endpoint_lookup" | quote }};
+    TLS_Cred = "conf/{{ tuple "mme" "host" . | include "omec-control-plane.endpoint_lookup" }}.cert.pem",
+               "conf/{{ tuple "mme" "host" . | include "omec-control-plane.endpoint_lookup" }}.key.pem";
+    TLS_CA = "conf/cacert.pem";
     AppServThreads = 40;
     SCTP_streams = 3;
     NoRelay;
     No_IPv6;
-
-    # Identity = "<diameter_host>.<diameter_realm>";
-    Identity = {{ tuple "mme" "identity" . | include "omec-control-plane.endpoint_lookup" | quote }};
-    Realm = {{ tuple "mme" "realm" . | include "omec-control-plane.endpoint_lookup" | quote }};
-    # Port = 3868;
-    # SecPort = 3869;
+    #Port = 3868;
+    #SecPort = 3869;
 
     ConnectPeer = {{ tuple "hss" "identity" . | include "omec-control-plane.endpoint_lookup" | quote }} { No_TLS; port = 3868; };
 
-    # TLS_Cred = "<diameter_host>.cert.pem", "<diameter_host>.key.pem";
-    TLS_Cred = "conf/{{ tuple "mme" "host" . | include "omec-control-plane.endpoint_lookup" }}.cert.pem",
-               "conf/{{ tuple "mme" "host" . | include "omec-control-plane.endpoint_lookup" }}.key.pem";
-    TLS_CA = "conf/cacert.pem";
-
     LoadExtension = "/usr/local/lib/freeDiameter/dict_3gpp2_avps.fdx";
     LoadExtension = "/usr/local/lib/freeDiameter/dict_draftload_avps.fdx";
     LoadExtension = "/usr/local/lib/freeDiameter/dict_etsi283034_avps.fdx";
@@ -98,3 +96,6 @@
   mme-ip.sh: |
 {{ tuple "bin/_mme-ip.sh.tpl" . | include "omec-control-plane.template" | indent 4 }}
 {{- end }}
+{{- range $key, $value := .Values.config.mme.cfgFiles }}
+  {{ $key }}: {{ toJson $value | quote }}
+{{- end }}
diff --git a/omec/omec-control-plane/templates/hss.yaml b/omec/omec-control-plane/templates/hss.yaml
deleted file mode 100644
index f773eb1..0000000
--- a/omec/omec-control-plane/templates/hss.yaml
+++ /dev/null
@@ -1,297 +0,0 @@
-{{/*
-Copyright 2018-present Open Networking Foundation
-Copyright 2018 Intel Corporation
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-Default values for mcord-vepc-helm.
-This is a YAML-formatted file.
-Declare variables to be passed into your templates.
-*/}}
-
-{{- if not (hasKey .Values.config.hss "hssdb") -}}
-{{- $_ := .Values.cassandra.fullnameOverride | set .Values.config.hss "hssdb" -}}
-{{- end }}
----
-apiVersion: v1
-kind: ConfigMap
-metadata:
-  name: hss
-  labels:
-{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 4 }}
-data:
-  acl.conf: |
-    ALLOW_OLD_TLS   *.cluster.local
-  hss.conf: |
-    Identity = "HSS_IDENTITY";
-    Realm = "HSS_REALM";
-    TLS_Cred = "CONF_DIR/HSS_HOST.cert.pem", "CONF_DIR/HSS_HOST.key.pem";
-    TLS_CA = "CONF_DIR/cacert.pem";
-    No_SCTP;
-    Prefer_TCP;
-    No_IPv6;
-    SCTP_streams = 3;
-    NoRelay;
-    AppServThreads = 4;
-    Port = 3868;
-    SecPort = 5868;
-    LoadExtension = "/usr/local/lib/freeDiameter/acl_wl.fdx" : "CONF_DIR/acl.conf";
-    LoadExtension = "/usr/local/lib/freeDiameter/dict_3gpp2_avps.fdx";
-    LoadExtension = "/usr/local/lib/freeDiameter/dict_draftload_avps.fdx";
-    LoadExtension = "/usr/local/lib/freeDiameter/dict_etsi283034_avps.fdx";
-    LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc4004_avps.fdx";
-    LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc4006bis_avps.fdx";
-    LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc4072_avps.fdx";
-    LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc4590_avps.fdx";
-    LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc5447_avps.fdx";
-    LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc5580_avps.fdx";
-    LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc5777_avps.fdx";
-    LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc5778_avps.fdx";
-    LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc6734_avps.fdx";
-    LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc6942_avps.fdx";
-    LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc7155_avps.fdx";
-    LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc7683_avps.fdx";
-    LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc7944_avps.fdx";
-    LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29061_avps.fdx";
-    LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29128_avps.fdx";
-    LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29154_avps.fdx";
-    LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29173_avps.fdx";
-    LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29212_avps.fdx";
-    LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29214_avps.fdx";
-    LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29215_avps.fdx";
-    LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29217_avps.fdx";
-    LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29229_avps.fdx";
-    LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29272_avps.fdx";
-    LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29273_avps.fdx";
-    LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29329_avps.fdx";
-    LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29336_avps.fdx";
-    LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29337_avps.fdx";
-    LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29338_avps.fdx";
-    LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29343_avps.fdx";
-    LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29344_avps.fdx";
-    LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29345_avps.fdx";
-    LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29368_avps.fdx";
-    LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29468_avps.fdx";
-    LoadExtension = "/usr/local/lib/freeDiameter/dict_ts32299_avps.fdx";
-    LoadExtension = "/usr/local/lib/freeDiameter/dict_S6as6d.fdx";
-    LoadExtension = "/usr/local/lib/freeDiameter/dict_S6t.fdx";
-    LoadExtension = "/usr/local/lib/freeDiameter/dict_S6c.fdx";
-  hss.json: |
-    {"common": {
-        "fdcfg": "CONF_DIR/hss.conf",
-        "originhost": "HSS_IDENTITY",
-        "originrealm": "HSS_REALM"
-    },
-    "hss": {
-        "gtwhost": "*",
-        "gtwport" : 9080,
-        "restport" : 9081,
-        "ossport" : 9082,
-        "casssrv": "HSSDB_ADDR",
-        "cassusr": "root",
-        "casspwd": "root",
-        "cassdb" : "vhss",
-        "casscoreconnections" : 2,
-        "cassmaxconnections" : 8,
-        "cassioqueuesize" : 32768,
-        "cassiothreads" : 2,
-        "randv"  : true,
-        "optkey" : "63bfa50ee6523365ff14c1f45f88737d",
-        "reloadkey"  : true,
-        "logsize": 20,
-        "lognumber": 5,
-        "logname": "LOGS_DIR/hss.log",
-        "logqsize": 8192,
-        "statlogsize": 20,
-        "statlognumber": 5,
-        "statlogname": "LOGS_DIR/hss_stat.log",
-        "auditlogsize": 20,
-        "auditlognumber": 5,
-        "auditlogname": "LOGS_DIR/hss_audit.log",
-        "statfreq": 2000,
-        "numworkers": 4,
-        "concurrent": 10,
-        "ossfile": "CONF_DIR/oss.json"
-    }
-    }
-  oss.json: |
-    {
-      "option": {
-        "id": "url",
-        "type": "string"
-      },
-      "services": [
-        {
-          "id": "logger",
-          "commands": [
-            {
-              "id": "describe_loggers"
-            },
-            {
-              "id": "set_logger_level",
-              "options": [
-                {
-                  "id": "name",
-                  "type": "string"
-                },
-                {
-                  "id": "level",
-                  "type": "integer"
-                }
-              ]
-            }
-          ]
-        },
-        {
-          "id": "stats",
-          "commands": [
-            {
-              "id": "describe_stats_frequency"
-            },
-            {
-              "id": "describe_stats_live"
-            },
-            {
-              "id": "set_stats_frequency",
-              "options": [
-                {
-                  "id": "frequency",
-                  "type": "integer"
-                }
-              ]
-            }
-          ]
-        }
-      ]
-    }
-  launch.sh: |
-    #!/bin/bash -x
-
-    CONF_DIR="/opt/c3po/hss/conf"
-    LOGS_DIR="/opt/c3po/hss/logs"
-    mkdir -p $CONF_DIR $LOGS_DIR
-
-    cp /etc/hss/conf/{acl.conf,hss.json,hss.conf,oss.json} $CONF_DIR
-
-    HSS_HOST=$(hostname)
-    HSS_DOMAIN=$(dnsdomainname)
-
-    # from hss.json
-    sed -i "s!HSS_IDENTITY!$HSS_HOST.$HSS_DOMAIN!g" $CONF_DIR/hss.json
-    sed -i "s!HSS_REALM!$HSS_DOMAIN!g" $CONF_DIR/hss.json
-    sed -i "s!HSSDB_ADDR!$HSSDB_ADDR!g" $CONF_DIR/hss.json
-    sed -i "s!CONF_DIR!$CONF_DIR!g" $CONF_DIR/hss.json
-    sed -i "s!LOGS_DIR!$LOGS_DIR!g" $CONF_DIR/hss.json
-
-    # from hss.conf
-    sed -i "s!HSS_IDENTITY!$HSS_HOST.$HSS_DOMAIN!g" $CONF_DIR/hss.conf
-    sed -i "s!HSS_REALM!$HSS_DOMAIN!g" $CONF_DIR/hss.conf
-    sed -i "s!HSS_HOST!$HSS_HOST!g" $CONF_DIR/hss.conf
-    sed -i "s!CONF_DIR!$CONF_DIR!g" $CONF_DIR/hss.conf
-    cat $CONF_DIR/{hss.json,hss.conf}
-
-    # If necessary, calculate the OPc value for each UE (User Equipment).
-    #./bin/hss -j conf/hss.json --onlyloadkey
-    cd $CONF_DIR
-    make_certs.sh $(hostname) $(dnsdomainname)
-    cd ..
-    # finally, launch
-    hss -j $CONF_DIR/hss.json
----
-apiVersion: v1
-kind: Service
-metadata:
-  name: hss
-  labels:
-{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 4 }}
-spec:
-  selector:
-{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 4 }}
-  clusterIP: None
-  ports:
-  - name: s6a
-    port: 3868
-    protocol: TCP
----
-apiVersion: apps/v1
-kind: StatefulSet
-metadata:
-  name: hss
-  labels:
-{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 4 }}
-spec:
-  replicas: 1
-  selector:
-    matchLabels:
-{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 6 }}
-  serviceName: hss
-  template:
-    metadata:
-      labels:
-{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 8 }}
-    spec:
-    {{- if .Values.nodeSelectors.enabled }}
-      nodeSelector:
-        {{ .Values.nodeSelectors.hss.label }}: {{ .Values.nodeSelectors.hss.value }}
-    {{- end }}
-      initContainers:
-      - name: init-hss
-        image: {{ .Values.images.tags.hssdb }}
-        imagePullPolicy: {{ .Values.images.pullPolicy }}
-        command: [ "bash", "-xc"]
-        # TODO: Move the SIM card configuration into values.yaml
-        args:
-        - until nslookup $HSSDB_ADDR; do echo "waiting for hssdb"; sleep 2; done;
-          until cqlsh --file /opt/c3po/hssdb/oai_db.cql $HSSDB_ADDR; do echo "provisioning hssdb"; sleep 2; done;
-          until data_provisioning_users.sh 208014567891200 1122334455 apn1 465B5CE8B199B49FAA5F0A2EE238A6BC 10 $HSSDB_ADDR $MME_HOST.$MME_REALM $MME_REALM;
-          do echo "setting up users"; sleep 2; done;
-          until data_provisioning_mme.sh 1 19136246000 $MME_HOST.$MME_REALM $MME_REALM 1 $HSSDB_ADDR; do echo "setting up mme"; sleep 2; done;
-          until data_provisioning_mme.sh 1 19136246000 smsrouter.test3gpp.net test3gpp.net 0 $HSSDB_ADDR; do echo "setting up smsrouter"; sleep 2; done;
-        env:
-        - name: HSSDB_ADDR
-          value: {{ .Values.config.hss.hssdb }}
-        - name: MME_HOST
-          value: {{ tuple "mme" "host" . | include "omec-control-plane.endpoint_lookup" | quote }}
-        - name: MME_REALM
-          value: {{ tuple "mme" "realm" . | include "omec-control-plane.endpoint_lookup" | quote }}
-      containers:
-      - name: hss
-        image: {{ .Values.images.tags.hss }}
-        imagePullPolicy: {{ .Values.images.pullPolicy }}
-        stdin: true
-        tty: true
-        env:
-        - name: HSSDB_ADDR
-          value: {{ .Values.config.hss.hssdb }}
-        - name: MME_IDENTITY
-          value: {{ tuple "mme" "identity" . | include "omec-control-plane.endpoint_lookup" | quote }}
-        command: ["bash", "-c", "/opt/c3po/hss/launch.sh; sleep 3600"]
-      {{- if .Values.resources.enabled }}
-        resources:
-{{ toYaml .Values.resources.hss | indent 10 }}
-      {{- end }}
-        volumeMounts:
-        - name: hss-script
-          mountPath: /opt/c3po/hss/launch.sh
-          subPath: launch.sh
-        - name: hss-config
-          mountPath: /etc/hss/conf
-      volumes:
-      - name: hss-script
-        configMap:
-          name: hss
-          defaultMode: 493
-      - name: hss-config
-        configMap:
-          name: hss
-          defaultMode: 420
diff --git a/omec/omec-control-plane/templates/job-hss-bootstrap.yaml b/omec/omec-control-plane/templates/job-hss-bootstrap.yaml
new file mode 100644
index 0000000..03ac80d
--- /dev/null
+++ b/omec/omec-control-plane/templates/job-hss-bootstrap.yaml
@@ -0,0 +1,74 @@
+{{/*
+Copyright 2019-present Open Networking Foundation
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/}}
+
+{{- if .Values.config.hss.bootstrap }}
+---
+apiVersion: batch/v1
+kind: Job
+metadata:
+  name: job-hss-bootstrap
+  labels:
+{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+spec:
+  template:
+    metadata:
+{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 8 }}
+    spec:
+    {{- if .Values.nodeSelectors.enabled }}
+      nodeSelector:
+        {{ .Values.nodeSelectors.hss.label }}: {{ .Values.nodeSelectors.hss.value }}
+    {{- end }}
+      restartPolicy: OnFailure
+      serviceAccountName: hss
+      initContainers:
+      - name: job-bootstrap-dep-check
+        image: {{ .Values.images.tags.depCheck | quote }}
+        imagePullPolicy: {{ .Values.images.pullPolicy }}
+        securityContext:
+          allowPrivilegeEscalation: false
+          readOnlyRootFilesystem: false
+          runAsUser: 0
+        env:
+          - name: NAMESPACE
+            valueFrom:
+              fieldRef:
+                apiVersion: v1
+                fieldPath: metadata.namespace
+          - name: PATH
+            value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/
+          - name: COMMAND
+            value: "echo done"
+          - name: DEPENDENCY_JOBS
+            value: job-hss-db-sync
+        command:
+          - kubernetes-entrypoint
+        volumeMounts:
+          []
+      containers:
+      - name: hss-bootstrap
+        image: {{ .Values.images.tags.hssdb }}
+        imagePullPolicy: {{ .Values.images.pullPolicy }}
+        command: ["/opt/c3po/hss/hss-bootstrap.sh"]
+        volumeMounts:
+        - name: hss-script
+          mountPath: /opt/c3po/hss/hss-bootstrap.sh
+          subPath: hss-bootstrap.sh
+      volumes:
+      - name: hss-script
+        configMap:
+          name: hss
+          defaultMode: 493
+{{- end }}
diff --git a/omec/omec-control-plane/templates/job-hss-db-sync.yaml b/omec/omec-control-plane/templates/job-hss-db-sync.yaml
new file mode 100644
index 0000000..17f3213
--- /dev/null
+++ b/omec/omec-control-plane/templates/job-hss-db-sync.yaml
@@ -0,0 +1,67 @@
+{{/*
+Copyright 2019-present Open Networking Foundation
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/}}
+
+---
+apiVersion: batch/v1
+kind: Job
+metadata:
+  name: job-hss-db-sync
+  labels:
+{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+spec:
+  template:
+    metadata:
+{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 8 }}
+    spec:
+    {{- if .Values.nodeSelectors.enabled }}
+      nodeSelector:
+        {{ .Values.nodeSelectors.hss.label }}: {{ .Values.nodeSelectors.hss.value }}
+    {{- end }}
+      restartPolicy: OnFailure
+      serviceAccountName: hss
+      initContainers:
+    {{- if .Values.cassandra.deploy }}
+      - name: job-db-sync-dep-check
+        image: {{ .Values.images.tags.depCheck | quote }}
+        imagePullPolicy: {{ .Values.images.pullPolicy }}
+        securityContext:
+          allowPrivilegeEscalation: false
+          readOnlyRootFilesystem: false
+          runAsUser: 0
+        env:
+          - name: NAMESPACE
+            valueFrom:
+              fieldRef:
+                apiVersion: v1
+                fieldPath: metadata.namespace
+          - name: PATH
+            value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/
+          - name: COMMAND
+            value: "echo done"
+          - name: DEPENDENCY_SERVICE
+            value: {{ .Values.config.hss.hssdb }}
+        command:
+          - kubernetes-entrypoint
+        volumeMounts:
+          []
+    {{- end }}
+      containers:
+        - name: hss-db-sync
+          image: {{ .Values.images.tags.hssdb }}
+          imagePullPolicy: {{ .Values.images.pullPolicy }}
+          command: ["bash", "-xc"]
+          args:
+            - until cqlsh --file /opt/c3po/hssdb/oai_db.cql {{ .Values.config.hss.hssdb }}; do echo "Provisioning HSSDB"; sleep 2;done
diff --git a/omec/omec-control-plane/templates/service-hss.yaml b/omec/omec-control-plane/templates/service-hss.yaml
new file mode 100644
index 0000000..849e713
--- /dev/null
+++ b/omec/omec-control-plane/templates/service-hss.yaml
@@ -0,0 +1,51 @@
+{{/*
+Copyright 2019-present Open Networking Foundation
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/}}
+
+---
+# Additional service for identity
+apiVersion: v1
+kind: Service
+metadata:
+  name: hss
+  labels:
+{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+spec:
+  selector:
+{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+  ports:
+  - name: s6a
+    port: 3868
+    protocol: TCP
+---
+apiVersion: v1
+kind: Service
+metadata:
+  name: hss-s6a
+  labels:
+{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+spec:
+  selector:
+{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+{{- if .Values.config.hss.s6a.nodePort.enabled }}
+  type: NodePort
+{{- end }}
+  ports:
+  - name: s6a
+    port: 3868
+    protocol: TCP
+  {{- if .Values.config.hss.s6a.nodePort.enabled }}
+    nodePort: {{ .Values.config.hss.s6a.nodePort.port }}
+  {{- end }}
diff --git a/omec/omec-control-plane/templates/service-mme.yaml b/omec/omec-control-plane/templates/service-mme.yaml
index 0747919..24ddc0f 100644
--- a/omec/omec-control-plane/templates/service-mme.yaml
+++ b/omec/omec-control-plane/templates/service-mme.yaml
@@ -14,6 +14,24 @@
 limitations under the License.
 */}}
 
+{{- $configJson := index .Values.config.mme.cfgFiles "config.json" }}
+{{- $configJsonS11 := index $configJson "s11" }}
+{{- $configJsonS1ap := index $configJson "s1ap" }}
+---
+# Additional service for identity
+apiVersion: v1
+kind: Service
+metadata:
+  name: mme
+  labels:
+{{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+spec:
+  selector:
+{{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+  ports:
+  - name: s6a
+    port: 3868
+    protocol: TCP
 ---
 apiVersion: v1
 kind: Service
@@ -29,7 +47,7 @@
 {{- end }}
   ports:
   - name: s11
-    port: {{ .Values.config.mme.appConfig.s11.egtp_default_port }}
+    port: {{ index $configJsonS11 "egtp_default_port" }}
     protocol: UDP
   {{- if .Values.config.mme.s11.nodePort.enabled }}
     nodePort: {{ .Values.config.mme.s11.nodePort.port }}
@@ -41,6 +59,9 @@
   name: mme-s6a
   labels:
 {{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+{{- if .Values.config.mme.s6a.nodePort.enabled }}
+  type: NodePort
+{{- end }}
 spec:
   selector:
 {{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 4 }}
@@ -48,6 +69,9 @@
   - name: s6a
     port: 3868
     protocol: TCP
+  {{- if .Values.config.mme.s6a.nodePort.enabled }}
+    nodePort: {{ .Values.config.mme.s6a.nodePort.port }}
+  {{- end }}
 ---
 apiVersion: v1
 kind: Service
@@ -61,6 +85,6 @@
   type: NodePort
   ports:
     - name: s1ap
-      port: {{ .Values.config.mme.appConfig.s1ap.sctp_port }}
-      nodePort: {{ .Values.config.mme.appConfig.s1ap.sctp_port_external }}
+      port: {{ index $configJsonS1ap "sctp_port" }}
+      nodePort: {{ index $configJsonS1ap "sctp_port_external" }}
       protocol: SCTP
diff --git a/omec/omec-control-plane/templates/statefulset-hss.yaml b/omec/omec-control-plane/templates/statefulset-hss.yaml
new file mode 100644
index 0000000..53cb687
--- /dev/null
+++ b/omec/omec-control-plane/templates/statefulset-hss.yaml
@@ -0,0 +1,98 @@
+{{/*
+Copyright 2019-present Open Networking Foundation
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+Default values for mcord-vepc-helm.
+This is a YAML-formatted file.
+Declare variables to be passed into your templates.
+*/}}
+
+{{ tuple "hss" . | include "omec-control-plane.service_account" }}
+---
+apiVersion: apps/v1
+kind: StatefulSet
+metadata:
+  name: hss
+  labels:
+{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+spec:
+  replicas: 1
+  selector:
+    matchLabels:
+{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 6 }}
+  serviceName: hss
+  template:
+    metadata:
+      labels:
+{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 8 }}
+    spec:
+    {{- if .Values.nodeSelectors.enabled }}
+      nodeSelector:
+        {{ .Values.nodeSelectors.hss.label }}: {{ .Values.nodeSelectors.hss.value }}
+    {{- end }}
+      serviceAccountName: hss
+      initContainers:
+      - name: hss-dep-check
+        image: {{ .Values.images.tags.depCheck | quote }}
+        imagePullPolicy: {{ .Values.images.pullPolicy }}
+        securityContext:
+          allowPrivilegeEscalation: false
+          readOnlyRootFilesystem: false
+          runAsUser: 0
+        env:
+          - name: NAMESPACE
+            valueFrom:
+              fieldRef:
+                apiVersion: v1
+                fieldPath: metadata.namespace
+          - name: PATH
+            value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/
+          - name: COMMAND
+            value: "echo done"
+          - name: DEPENDENCY_JOBS
+          {{- if .Values.config.hss.bootstrap }}
+            value: job-hss-db-sync,job-hss-bootstrap
+          {{- else }}
+            value: job-hss-db-sync
+          {{- end }}
+        command:
+          - kubernetes-entrypoint
+        volumeMounts:
+          []
+      containers:
+      - name: hss
+        image: {{ .Values.images.tags.hss }}
+        imagePullPolicy: {{ .Values.images.pullPolicy }}
+        stdin: true
+        tty: true
+        command: ["bash", "-c", "/opt/c3po/hss/hss-run.sh; sleep 3600"]
+      {{- if .Values.resources.enabled }}
+        resources:
+{{ toYaml .Values.resources.hss | indent 10 }}
+      {{- end }}
+        volumeMounts:
+        - name: hss-script
+          mountPath: /opt/c3po/hss/hss-run.sh
+          subPath: hss-run.sh
+        - name: hss-config
+          mountPath: /etc/hss/conf
+      volumes:
+      - name: hss-script
+        configMap:
+          name: hss
+          defaultMode: 493
+      - name: hss-config
+        configMap:
+          name: hss
+          defaultMode: 420
diff --git a/omec/omec-control-plane/templates/statefulset-mme.yaml b/omec/omec-control-plane/templates/statefulset-mme.yaml
index 745388b..f478cb8 100644
--- a/omec/omec-control-plane/templates/statefulset-mme.yaml
+++ b/omec/omec-control-plane/templates/statefulset-mme.yaml
@@ -27,6 +27,7 @@
   selector:
     matchLabels:
 {{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 6 }}
+  serviceName: mme
   template:
     metadata:
       labels:
diff --git a/omec/omec-control-plane/values.yaml b/omec/omec-control-plane/values.yaml
index 42deb61..945e669 100644
--- a/omec/omec-control-plane/values.yaml
+++ b/omec/omec-control-plane/values.yaml
@@ -86,43 +86,131 @@
     #  cpu: 2
 
 config:
-  hss: {}
-    # hssdb will be set to cassandra if unset
-    #hssdb:
+  hss:
+    hssdb: cassandra
+    s6a:
+      nodePort:
+        enabled: false
+        port: 33868
+    # Provide the peer whitelist extension
+    # The peer name must be a fqdn. We allow also a special "*" character as the
+    # first label of the fqdn, to allow all fqdn with the same domain name.
+    # Example: *.example.net will allow host1.example.net and host2.example.net
+    acl:
+      oldTls: "*.cluster.local"
+      #ipSec:
+    bootstrap:
+      enabled: true
+      users:
+        imsi: "208014567891200"
+        msisdn: "1122334455"
+        apn: apn1
+        key: "465b5ce8b199b49faa5f0a2ee238a6bc"
+        opc: "d4416644f6154936193433dd20a0ace0"
+        numbers: 2
+      mme:
+        id: 1
+        isdn: "19136246000"
+        unreachability: 1
+    # See https://github.com/omec-project/c3po for details of config options
+    cfgFiles:
+      hss.json:
+        common:
+          fdcfg: conf/hss.conf
+          # Origin host and realm will be set automatically if unset
+          #originhost: ""
+          #originrealm: ""
+        hss:
+          gtwhost: "*"
+          gtwport: 9080
+          restport: 9081
+          ossport: 9082
+          # casssrv will be set to cassandra in the same cluster if unset
+          #casssrv: ""
+          cassusr: root
+          casspwd: root
+          cassdb: vhss
+          casscoreconnections: 2
+          cassmaxconnections: 8
+          cassioqueuesize: 32768
+          cassiothreads: 2
+          randv: true
+          optkey: "63bfa50ee6523365ff14c1f45f88737d"
+          reloadkey: false
+          logsize: 20
+          lognumber: 5
+          logname: logs/hss.log
+          logqsize: 8192
+          statlogsize: 20
+          statlognumber: 5
+          statlogname: logs/hss_stat.log
+          auditlogsize: 20
+          auditlognumber: 5
+          auditlogname: logs/hss_audit.log
+          statfreq: 2000
+          numworkers: 4
+          concurrent: 10
+          ossfile: conf/oss.json
+      oss.json:
+        option:
+          id: url
+          type: string
+        services:
+          - id: logger
+            commands:
+              - id: describe_loggers
+              - id: set_logger_level
+                options:
+                  - id: name
+                    type: string
+                  - id: level
+                    type: integer
+          - id: stats
+            commands:
+              - id: describe_stats_frequency
+              - id: describe_stats_live
+              - id: set_stats_frequency
+                options:
+                  - id: frequency
+                    type: integer
   mme:
     spgwAddr: spgwc-s11
     s11:
       nodePort:
         enabled: false
         port: 32124
-    # appConfig is directly converted to config.json
+    s6a:
+      nodePort:
+        enabled: false
+        port: 33869
     # See https://github.com/omec-project/openmme/blob/master/README.txt for more config options
-    appConfig:
-      mme:
-        name: vmmestandalone
-        group_id: 1
-        code: 1
-        mcc:
-          dig1: 2
-          dig2: 0
-          dig3: 8
-        mnc:
-          dig1: 0
-          dig2: 1
-          dig3: -1
-      s1ap:
-        sctp_port: 36412
-        sctp_port_external: 36412
-      s11:
-        egtp_default_port: 2123
-        # sgw_addr and pgw_addr will be set dynamically if unset
-        #sgw_addr:
-        #pgw_addr:
-      s6a:
-        host_type: freediameter
-        # host and realm will be set dynamically if unset
-        #host:
-        #realm:
+    cfgFiles:
+      config.json:
+        mme:
+          name: vmmestandalone
+          group_id: 1
+          code: 1
+          mcc:
+            dig1: 2
+            dig2: 0
+            dig3: 8
+          mnc:
+            dig1: 0
+            dig2: 1
+            dig3: -1
+        s1ap:
+          sctp_port: 36412
+          sctp_port_external: 36412
+        s11:
+          egtp_default_port: 2123
+          # sgw_addr and pgw_addr will be set dynamically if unset
+          #sgw_addr:
+          #pgw_addr:
+        s6a:
+          host_type: freediameter
+          # host and realm will be set dynamically if unset
+          #host:
+          #realm:
   spgwc:
     apn: apn1
     ueIpPool: