AETHER-487 Add support of k8s 1.18

Change-Id: I759b71546e6ba2fc1a52ab135ea26c403fecc417
diff --git a/omec/omec-control-plane/Chart.yaml b/omec/omec-control-plane/Chart.yaml
index 2af4f10..b303f3f 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.3.1
+version: 0.3.2
diff --git a/omec/omec-control-plane/templates/_helpers.tpl b/omec/omec-control-plane/templates/_helpers.tpl
index 0833603..7982cf6 100644
--- a/omec/omec-control-plane/templates/_helpers.tpl
+++ b/omec/omec-control-plane/templates/_helpers.tpl
@@ -61,7 +61,11 @@
   labels:
 {{ tuple $saName $context | include "omec-control-plane.metadata_labels" | indent 4 }}
 ---
+{{- if semverCompare ">=1.16-0" $context.Capabilities.KubeVersion.GitVersion }}
+apiVersion: rbac.authorization.k8s.io/v1
+{{- else }}
 apiVersion: rbac.authorization.k8s.io/v1beta1
+{{- end }}
 kind: RoleBinding
 metadata:
   name: {{ $saName }}
@@ -77,7 +81,11 @@
     name: {{ $saName }}
     namespace: {{ $saNamespace }}
 ---
+{{- if semverCompare ">=1.16-0" $context.Capabilities.KubeVersion.GitVersion }}
+apiVersion: rbac.authorization.k8s.io/v1
+{{- else }}
 apiVersion: rbac.authorization.k8s.io/v1beta1
+{{- end }}
 kind: Role
 metadata:
   name: {{ $saName }}
diff --git a/omec/omec-user-plane/Chart.yaml b/omec/omec-user-plane/Chart.yaml
index be42863..3d8f183 100644
--- a/omec/omec-user-plane/Chart.yaml
+++ b/omec/omec-user-plane/Chart.yaml
@@ -7,4 +7,4 @@
 name: omec-user-plane
 icon: https://guide.opencord.org/logos/cord.svg
 
-version: 0.3.1
+version: 0.3.2
diff --git a/omec/omec-user-plane/templates/networks.yaml b/omec/omec-user-plane/templates/networks.yaml
index b749ea8..37f54e7 100644
--- a/omec/omec-user-plane/templates/networks.yaml
+++ b/omec/omec-user-plane/templates/networks.yaml
@@ -15,6 +15,9 @@
 {{- end }}
 spec:
   config: '{
+{{- if semverCompare ">=1.16-0" .Capabilities.KubeVersion.GitVersion }}
+    "cniVersion": "0.3.1",
+{{- end }}
     "type": {{ .Values.config.upf.cniPlugin | quote }},
     "ipam": {
         "type": {{ .Values.config.upf.ipam | quote }}
@@ -31,6 +34,9 @@
 {{- end }}
 spec:
   config: '{
+{{- if semverCompare ">=1.16-0" .Capabilities.KubeVersion.GitVersion }}
+    "cniVersion": "0.3.1",
+{{- end }}
     "type": {{ .Values.config.upf.cniPlugin | quote }},
     "ipam": {
         "type": {{ .Values.config.upf.ipam | quote }}
diff --git a/omec/omec-user-plane/templates/statefulset-upf.yaml b/omec/omec-user-plane/templates/statefulset-upf.yaml
index f17b60d..e570093 100644
--- a/omec/omec-user-plane/templates/statefulset-upf.yaml
+++ b/omec/omec-user-plane/templates/statefulset-upf.yaml
@@ -29,12 +29,20 @@
           {
             "name": "access-net",
             "interface": {{ index $accessConfig "ifname" | quote }},
+{{- if semverCompare ">=1.16-0" .Capabilities.KubeVersion.GitVersion }}
+            "ips": [{{ .Values.config.upf.access.ip | quote }}]
+{{- else }}
             "ips": {{ .Values.config.upf.access.ip | quote }}
+{{- end }}
           },
           {
             "name": "core-net",
             "interface": {{ index $coreConfig "ifname" | quote }},
+{{- if semverCompare ">=1.16-0" .Capabilities.KubeVersion.GitVersion }}
+            "ips": [{{ .Values.config.upf.core.ip | quote }}]
+{{- else }}
             "ips": {{ .Values.config.upf.core.ip | quote }}
+{{- end }}
           }
         ]'
     spec:
diff --git a/omec/omec-user-plane/values.yaml b/omec/omec-user-plane/values.yaml
index 99b573f..088b2a8 100644
--- a/omec/omec-user-plane/values.yaml
+++ b/omec/omec-user-plane/values.yaml
@@ -72,9 +72,6 @@
         mode: dpdk
         workers: 1
         max_sessions: 50000
-        cpiface:
-          nb_dst_ip: spgwc-headless
-          hostname: upf-bess
         access:
           ifname: access
         core: