QOS change and passing config to pcrf pod

Change-Id: I62b67d9ba7f0b741a3a14f10315bb17757a95257
diff --git a/omec/omec-control-plane/Chart.yaml b/omec/omec-control-plane/Chart.yaml
index be57891..b2aaac8 100644
--- a/omec/omec-control-plane/Chart.yaml
+++ b/omec/omec-control-plane/Chart.yaml
@@ -10,4 +10,4 @@
 name: omec-control-plane
 icon: https://guide.opencord.org/logos/cord.svg
 
-version: 0.6.9
+version: 0.6.10
diff --git a/omec/omec-control-plane/templates/bin/_pcrf-run.sh.tpl b/omec/omec-control-plane/templates/bin/_pcrf-run.sh.tpl
index 72050cd..7be50a6 100644
--- a/omec/omec-control-plane/templates/bin/_pcrf-run.sh.tpl
+++ b/omec/omec-control-plane/templates/bin/_pcrf-run.sh.tpl
@@ -15,7 +15,7 @@
 #TODO - Need to remove logs directory
 mkdir -p $CONF_DIR $LOGS_DIR
 
-cp /etc/pcrf/conf/{acl.conf,pcrf.json,pcrf.conf,oss.json} $CONF_DIR
+cp /etc/pcrf/conf/{acl.conf,pcrf.json,pcrf.conf,oss.json,subscriber_mapping.json} $CONF_DIR
 cat $CONF_DIR/{pcrf.json,pcrf.conf}
 
 cd $CONF_DIR
diff --git a/omec/omec-control-plane/templates/configmap-pcrf.yaml b/omec/omec-control-plane/templates/configmap-pcrf.yaml
index dff2095..d5ad7cc 100644
--- a/omec/omec-control-plane/templates/configmap-pcrf.yaml
+++ b/omec/omec-control-plane/templates/configmap-pcrf.yaml
@@ -24,6 +24,9 @@
 {{- if not (hasKey $pcrfJsonHss "casssrv") -}}
 {{- $_ := .Values.cassandra.fullnameOverride | set $pcrfJsonHss "casssrv" -}}
 {{- end }}
+{{- if not (hasKey $pcrfJsonHss "restport") -}}
+{{- $_ := .Values.config.pcrf.configPort.port | set $pcrfJsonHss "restport" -}}
+{{- end }}
 ---
 apiVersion: v1
 kind: ConfigMap
diff --git a/omec/omec-control-plane/templates/service-hss.yaml b/omec/omec-control-plane/templates/service-hss.yaml
index 0339d1a..371b363 100644
--- a/omec/omec-control-plane/templates/service-hss.yaml
+++ b/omec/omec-control-plane/templates/service-hss.yaml
@@ -72,6 +72,5 @@
       protocol: TCP
       nodePort: {{ .Values.config.hss.configPort.nodePort.port }}
   {{- end }}
-
 {{- end }}
 {{- end }}
diff --git a/omec/omec-control-plane/templates/service-pcrf.yaml b/omec/omec-control-plane/templates/service-pcrf.yaml
index 2c9b897..116f930 100644
--- a/omec/omec-control-plane/templates/service-pcrf.yaml
+++ b/omec/omec-control-plane/templates/service-pcrf.yaml
@@ -22,6 +22,9 @@
   - name: prometheus-exporter
     port: {{ .Values.config.pcrf.prometheus.port }}
     protocol: TCP
+  - name: config-port
+    port: {{ .Values.config.pcrf.configPort.port }}
+    protocol: TCP
 ---
 apiVersion: v1
 kind: Service
@@ -40,9 +43,11 @@
   - name: prometheus-exporter
     port: {{ .Values.config.pcrf.prometheus.port }}
     protocol: TCP
-
----
+  - name: config-port
+    port: {{ .Values.config.pcrf.configPort.port }}
+    protocol: TCP
 {{- if or (.Values.config.pcrf.prometheus.nodePort.enabled) (.Values.config.pcrf.gx.nodePort.enabled) }}
+---
 apiVersion: v1
 kind: Service
 metadata:
@@ -66,5 +71,11 @@
     protocol: TCP
     nodePort: {{ .Values.config.pcrf.gx.nodePort.port }}
   {{- end }}
+  {{- if .Values.config.pcrf.configPort.nodePort.enabled }}
+    - name: config-port
+      port: {{ .Values.config.pcrf.configPort.port }}
+      protocol: TCP
+      nodePort: {{ .Values.config.pcrf.configPort.nodePort.port }}
+  {{- end }}
 {{- end }}
 {{- end }}
diff --git a/omec/omec-control-plane/values.yaml b/omec/omec-control-plane/values.yaml
index 2d6a6b8..8096571 100644
--- a/omec/omec-control-plane/values.yaml
+++ b/omec/omec-control-plane/values.yaml
@@ -104,6 +104,11 @@
       fluentbit.io/parser: pcrf
       field.cattle.io/workloadMetrics: '[{"path":"/metrics","port":9089,"schema":"HTTP"}]'
     pcrfdb: cassandra
+    configPort:
+      port: 8080
+      nodePort:
+        enabled: false
+        port: 30081
     gx:
       nodePort:
         enabled: false
@@ -124,6 +129,38 @@
       enabled: false
     # See https://github.com/omec-project/c3po for details of config options
     cfgFiles:
+      subscriber_mapping.json:
+        Policies:
+          service-groups:
+            internet:
+              default-activate-service:
+              - be-internet-access
+          services:
+            be-internet-access:
+              qci: 9
+              arp: 1
+              AMBR_UL: 100000
+              AMBR_DL: 20000000
+              service-activation-rules:
+              - best-effort-internet-access
+          rules:
+            best-effort-internet-access:
+              definition:
+                Charging-Rule-Name: "best-effort-internet-access"
+                QoS-Information:
+                  QoS-Class-Identifier: 9
+                  Max-Requested-Bandwidth-UL: 512000
+                  Max-Requested-Bandwidth-DL: 5120000
+                  Guaranteed-Bitrate-UL: 0
+                  Guaranteed-Bitrate-DL: 0
+                  Allocation-Retention-Priority:
+                    Priority-Level: 1
+                    Pre-emption-Capability: 1
+                    Pre-emption-Vulnerability: 1
+                  APN-Aggregate-Max-Bitrate-UL: 1024000
+                  APN-Aggregate-Max-Bitrate-DL: 10240000
+                Flow-Information:
+                  Flow-Description: "permit out ip 0.0.0.0/0 to assigned"
       pcrf.json:
         common:
           fdcfg: conf/pcrf.conf
@@ -133,7 +170,8 @@
         pcrf:
           gtwhost: "*"
           gtwport: 9080
-          restport: 9081
+          #restport will be set by configmap
+          #restport: ""
           ossport: 9082
           # casssrv will be set to cassandra in the same cluster if unset
           #casssrv: ""
@@ -504,6 +542,8 @@
               tag1: ACC
         qos-profiles:
           mobile:
+            qci: 9
+            arp: 1
             apn-ambr:
               - 12345678
               - 12345678