[SDNC] Chart cleanup from TLS/AAF options

Remove checks and add the usage of common templates
Add information about external access to SDNC-callhome
and add ingress setup for it

Issue-ID: OOM-3122

Signed-off-by: Andreas Geissler <andreas-geissler@telekom.de>
Change-Id: I7b32832ee31d811c23b4eaa5d43f7aa9d767c353
diff --git a/kubernetes/sdnc/components/sdnc-web/Chart.yaml b/kubernetes/sdnc/components/sdnc-web/Chart.yaml
index 43c53c6..7b4ac04 100644
--- a/kubernetes/sdnc/components/sdnc-web/Chart.yaml
+++ b/kubernetes/sdnc/components/sdnc-web/Chart.yaml
@@ -22,9 +22,6 @@
   - name: common
     version: ~12.x-0
     repository: '@local'
-  - name: certInitializer
-    version: ~12.x-0
-    repository: '@local'
   - name: repositoryGenerator
     version: ~12.x-0
     repository: '@local'
diff --git a/kubernetes/sdnc/components/sdnc-web/templates/deployment.yaml b/kubernetes/sdnc/components/sdnc-web/templates/deployment.yaml
index 03432d3..803e3ea 100644
--- a/kubernetes/sdnc/components/sdnc-web/templates/deployment.yaml
+++ b/kubernetes/sdnc/components/sdnc-web/templates/deployment.yaml
@@ -23,7 +23,7 @@
   template:
     metadata: {{- include "common.templateMetadata" . | nindent 6 }}
     spec:
-      initContainers: {{ include "common.certInitializer.initContainer" . | indent 6 }}
+      initContainers:
       - name: {{ include "common.name" . }}-readiness
         image: {{ include "repositoryGenerator.image.readiness" . }}
         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
@@ -49,34 +49,26 @@
           {{ if .Values.liveness.enabled }}
           livenessProbe:
             tcpSocket:
-              port: {{ (eq "true" (include "common.needTLS" .)) | ternary .Values.service.internalPort .Values.service.internalPlainPort }}
+              port: {{ .Values.service.internalPort }}
             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
             periodSeconds: {{ .Values.liveness.periodSeconds }}
           {{ end }}
           readinessProbe:
             tcpSocket:
-              port: {{ (eq "true" (include "common.needTLS" .)) | ternary .Values.service.internalPort .Values.service.internalPlainPort }}
+              port: {{ .Values.service.internalPort }}
             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
             periodSeconds: {{ .Values.readiness.periodSeconds }}
           env:
           - name: WEBPROTOCOL
-            value: {{ (eq "true" (include "common.needTLS" .)) | ternary .Values.config.webProtocol .Values.config.webPlainProtocol }}
+            value: {{ .Values.config.webProtocol }}
           - name: WEBPORT
-            value : {{ (eq "true" (include "common.needTLS" .)) | ternary .Values.config.webPort .Values.config.webPlainPort | quote }}
+            value : {{ .Values.config.webPort | quote }}
           - name: SDNRPROTOCOL
-            value : {{ (eq "true" (include "common.needTLS" .)) | ternary .Values.config.sdnrProtocol .Values.config.sdnrPlainProtocol }}
+            value : {{ .Values.config.sdnrProtocol }}
           - name: SDNRHOST
-            value : {{ (eq "true" (include "common.needTLS" .)) | ternary .Values.config.sdnrHost .Values.config.sdnrPlainHost }}.{{ include "common.namespace" . }}
+            value : {{ .Values.config.sdnrHost }}.{{ include "common.namespace" . }}
           - name: SDNRPORT
-            value : {{ (eq "true" (include "common.needTLS" .)) | ternary .Values.config.sdnrPort .Values.config.sdnrPlainPort | quote }}
-          {{ if (include "common.needTLS" .) }}
-          - name: SSL_CERT_DIR
-            value: {{ .Values.config.sslCertDir }}
-          - name: SSL_CERTIFICATE
-            value: {{ .Values.config.sslCertiticate }}
-          - name: SSL_CERTIFICATE_KEY
-            value: {{ .Values.config.sslCertKey }}
-          {{ end }}
+            value : {{ .Values.config.sdnrPort | quote }}
           {{ if .Values.config.transportpce.enabled }}
           - name: TRPCEURL
             value: {{ .Values.config.transportpce.transportpceUrl }}
@@ -91,7 +83,7 @@
             value: "{{ .Values.config.oauth.enabled | default "false" }}"
           - name: ENABLE_ODLUX_RBAC
             value: "{{ .Values.config.oauth.odluxRbac.enabled | default "false" }}"
-          volumeMounts:  {{ include "common.certInitializer.volumeMount" . | nindent 10 }}
+          volumeMounts:
           - mountPath: /etc/localtime
             name: localtime
             readOnly: true
@@ -104,7 +96,7 @@
       affinity: {{ toYaml .Values.affinity | nindent 8 }}
       {{- end }}
       serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
-      volumes: {{ include "common.certInitializer.volumes" . | nindent 6 }}
+      volumes:
       - name: localtime
         hostPath:
           path: /etc/localtime
diff --git a/kubernetes/sdnc/components/sdnc-web/templates/ingress.yaml b/kubernetes/sdnc/components/sdnc-web/templates/ingress.yaml
new file mode 100644
index 0000000..bcc60a0
--- /dev/null
+++ b/kubernetes/sdnc/components/sdnc-web/templates/ingress.yaml
@@ -0,0 +1,17 @@
+{{/*
+# Copyright © 2023 Deutsche Telekom
+#
+# 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.
+*/}}
+
+{{ include "common.ingress" . }}
diff --git a/kubernetes/sdnc/components/sdnc-web/templates/service.yaml b/kubernetes/sdnc/components/sdnc-web/templates/service.yaml
index 216073e..b4b437c 100644
--- a/kubernetes/sdnc/components/sdnc-web/templates/service.yaml
+++ b/kubernetes/sdnc/components/sdnc-web/templates/service.yaml
@@ -13,5 +13,5 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 */}}
-{{- include "common.service" . -}}
+{{ include "common.service" . }}
 
diff --git a/kubernetes/sdnc/components/sdnc-web/values.yaml b/kubernetes/sdnc/components/sdnc-web/values.yaml
index 82c7cce..3563eb7 100644
--- a/kubernetes/sdnc/components/sdnc-web/values.yaml
+++ b/kubernetes/sdnc/components/sdnc-web/values.yaml
@@ -16,9 +16,8 @@
 # Global configuration defaults.
 #################################################################
 global:
-  aafEnabled: true
   nodePortPrefix: 322
-  k8scluster: svc.cluster.local
+
 #################################################################
 # Application configuration defaults.
 #################################################################
@@ -28,19 +27,11 @@
 
 config:
   sdncChartName: sdnc
-  webProtocol: HTTPS
-  webPlainProtocol: HTTP
-  webPort: 8443
-  webPlainPort: 8080
-  sdnrProtocol: https
-  sdnrPlainProtocol: http
+  webProtocol: HTTP
+  webPort: 8080
+  sdnrProtocol: http
   sdnrHost: "sdnc"
-  sdnrPlainHost: "sdnc"
-  sdnrPort: "8443"
-  sdnrPlainPort : "8080"
-  sslCertDir: "/opt/app/osaaf/local/certs"
-  sslCertiticate: "cert.pem"
-  sslCertKey: "key.pem"
+  sdnrPort: "8080"
   oauth:
     enabled: false
     odluxRbac:
@@ -53,30 +44,6 @@
     topologyserverUrl: http://toplogy-api-service.topology:3001
     tileserverUrl: https://tile.openstreetmap.org
 
-
-#################################################################
-# aaf configuration defaults.
-#################################################################
-certInitializer:
-  nameOverride: sdnc-web-cert-initializer
-  fqdn: "sdnc"
-  app_ns: "org.osaaf.aaf"
-  fqi: "sdnc@sdnc.onap.org"
-  fqi_namespace: "org.onap.sdnc"
-  public_fqdn: "sdnc.onap.org"
-  aafDeployFqi: "deployer@people.osaaf.org"
-  aafDeployPass: demo123456!
-  cadi_latitude: "38.0"
-  cadi_longitude: "-72.0"
-  credsPath: /opt/app/osaaf/local
-  aaf_add_config: |
-    cd /opt/app/osaaf/local
-    mkdir -p certs
-    keytool -exportcert -rfc -file certs/cacert.pem -keystore {{ .Values.fqi_namespace }}.trust.jks -alias ca_local_0 -storepass $cadi_truststore_password
-    openssl pkcs12 -in {{ .Values.fqi_namespace }}.p12 -out certs/cert.pem -passin pass:$cadi_keystore_password_p12 -passout pass:$cadi_keystore_password_p12
-    cp {{ .Values.fqi_namespace }}.key certs/key.pem
-    chmod -R 755 certs
-
 # default number of instances
 replicaCount: 1
 
@@ -98,22 +65,21 @@
 
 service:
   name: sdnc-web
-  suffix: service
   type: NodePort
-  sessionAffinity: ClientIP
   # for liveness and readiness probe only
   # internalPort:
-  internalPort: 8443
-  internalPlainPort: 8080
+  internalPort: 8080
   ports:
-  - name: http-sdnc-web
-    port: "8443"
-    plain_port: "8080"
-    port_protocol: http
+  - name: http
+    port: "8080"
     nodePort: "05"
 
-#ingress:
-#  enabled: false
+ingress:
+  enabled: false
+  service:
+  - baseaddr: "sdnc-web-ui"
+    name: "sdnc-web"
+    port: 8080
 
 #Resource limit flavor -By default using small
 flavor: small