[SO] Cleanup of SO charts

Remove AAF and TLS related chart entries
Use OOM templates for deployment and service definitions
Remove so-appc-orchestrator, as it is not supported anymore

Issue-ID: OOM-3106

Signed-off-by: Andreas Geissler <andreas-geissler@telekom.de>
Change-Id: I6256aa0fbbe172752cc3d8f83edde0880de7f629
diff --git a/kubernetes/so/components/so-etsi-sol003-adapter/resources/config/overrides/override.yaml b/kubernetes/so/components/so-etsi-sol003-adapter/resources/config/overrides/override.yaml
index e6a3d7c..04d973a 100755
--- a/kubernetes/so/components/so-etsi-sol003-adapter/resources/config/overrides/override.yaml
+++ b/kubernetes/so/components/so-etsi-sol003-adapter/resources/config/overrides/override.yaml
@@ -14,13 +14,9 @@
 # limitations under the License.
 */}}
 aai:
-  auth: {{ include "so.helpers.profileProperty" (dict "condition" .Values.global.security.aaf.enabled "value1" .Values.global.aaf.auth.header "value2" .Values.aai.auth )}}
+  auth: {{ .Values.aai.auth }}
   version: v15
-  {{ if (include "common.needTLS" .) }}
-  endpoint: https://aai.{{ include "common.namespace" . }}:8443
-  {{ else }}
   endpoint: http://aai.{{ include "common.namespace" . }}:80
-  {{ end }}
 spring:
   security:
     usercredentials:
@@ -41,34 +37,19 @@
   key: {{ .Values.mso.key }}
   site-name: localSite
   logPath: ./logs/etsi-sol003-adapter
-  config:
-    cadi: {{ include "so.cadi.keys" . | nindent 8}}
   msb-ip: msb-iag
   msb-port: 80
 sdc:
-  username: {{ include "so.helpers.profileProperty" (dict "condition" .Values.global.security.aaf.enabled "value1" .Values.aaf.auth.username "value2" .Values.sdc.username )}}
-  password: {{ include "so.helpers.profileProperty" (dict "condition" .Values.global.security.aaf.enabled "value1" .Values.aaf.auth.password "value2" .Values.sdc.password )}}
+  username: {{ .Values.sdc.username }}
+  password: {{ .Values.sdc.password }}
   key: {{ .Values.sdc.key }}
-  {{ if (include "common.needTLS" .) }}
-  endpoint: https://sdc-be.{{ include "common.namespace" . }}:8443
-  {{ else }}
   endpoint: http://sdc-be.{{ include "common.namespace" . }}:8080
-  {{ end }}
 vnfmadapter:
   endpoint: http://so-etsi-sol003-adapter.{{ include "common.namespace" . }}:9092
 etsi-catalog-manager:
   vnfpkgm:
   {{- if .Values.global.msbEnabled }}
-    {{ if (include "common.needTLS" .) }}
-    endpoint: https://msb-iag:443/api/vnfpkgm/v1
-  http:
-    client:
-      ssl:
-        trust-store: file:${TRUSTSTORE}
-        trust-store-password: ${TRUSTSTORE_PASSWORD}
-    {{ else }}
     endpoint: http://msb-iag:80/api
-    {{ end }}
   {{- else }}
     endpoint: http://modeling-etsicatalog.{{ include "common.namespace" . }}:8806/api/vnfpkgm/v1
   {{- end }}
diff --git a/kubernetes/so/components/so-etsi-sol003-adapter/templates/configmap.yaml b/kubernetes/so/components/so-etsi-sol003-adapter/templates/configmap.yaml
index 6331656..c334fd7 100755
--- a/kubernetes/so/components/so-etsi-sol003-adapter/templates/configmap.yaml
+++ b/kubernetes/so/components/so-etsi-sol003-adapter/templates/configmap.yaml
@@ -17,7 +17,7 @@
 data:
   LOG_PATH: {{ index .Values.logPath }}
   APP: {{ index .Values.app }}
-  ACTIVE_PROFILE: {{ include "so.helpers.profileProperty" (dict "condition" .Values.global.security.aaf.enabled "value1" "aaf" "value2" "basic")}}
+  ACTIVE_PROFILE: "basic"
 kind: ConfigMap
 metadata:
   name: {{ include "common.fullname" . }}-configmap
diff --git a/kubernetes/so/components/so-etsi-sol003-adapter/templates/deployment.yaml b/kubernetes/so/components/so-etsi-sol003-adapter/templates/deployment.yaml
index 5d61004..7854165 100755
--- a/kubernetes/so/components/so-etsi-sol003-adapter/templates/deployment.yaml
+++ b/kubernetes/so/components/so-etsi-sol003-adapter/templates/deployment.yaml
@@ -15,18 +15,10 @@
 */}}
 apiVersion: apps/v1
 kind: Deployment
-metadata:
-  name: {{ include "common.fullname" . }}
-  namespace: {{ include "common.namespace" . }}
-  labels:
-    app: {{ include "common.fullname" . }}
-    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
-    release: {{ include "common.release" . }}
+metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
 spec:
-  selector:
-    matchLabels:
-      app: {{ include "common.name" . }}
-  replicas: {{ .Values.replicaCount }}
+  selector: {{- include "common.selectors" . | nindent 4 }}
+  replicas: {{ index .Values.replicaCount }}
   minReadySeconds: {{ .Values.minReadySeconds }}
   strategy:
     type: {{ .Values.updateStrategy.type }}
@@ -34,34 +26,17 @@
       maxUnavailable: {{ .Values.updateStrategy.maxUnavailable }}
       maxSurge: {{ .Values.updateStrategy.maxSurge }}
   template:
-    metadata:
-      labels:
-        app: {{ include "common.name" . }}
-        release: {{ include "common.release" . }}
+    metadata: {{- include "common.templateMetadata" . | nindent 6 }}
     spec:
-      initContainers: {{ include "so.certificate.container_importer" . | nindent 6 }}
       containers:
       - name: {{ include "common.name" . }}
         image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
         resources: {{ include "common.resources" . | nindent 10 }}
-        {{- if .Values.global.aafEnabled }}
-        command:
-        - sh
-        args:
-        - -c
-        - |
-          export $(cat {{ .Values.soHelpers.certInitializer.credsPath }}/mycreds.prop | xargs -0)
-          export KEYSTORE_PASSWORD="${cadi_keystore_password_p12}"
-          export KEYSTORE="{{ .Values.soHelpers.certInitializer.credsPath }}/org.onap.so.p12"
-          /app/start-app.sh
-        {{- end }}
-        env:
-        {{ include "so.certificates.env" . | indent 8 | trim }}
         envFrom:
         - configMapRef:
             name: {{ include "common.fullname" . }}-configmap
         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-        volumeMounts: {{ include "so.certificate.volumeMount" . | nindent 8 }}
+        volumeMounts:
         - name: logs
           mountPath: /app/logs
         - name: config
@@ -74,12 +49,9 @@
           periodSeconds: {{ .Values.livenessProbe.periodSeconds}}
           successThreshold: {{ .Values.livenessProbe.successThreshold}}
           failureThreshold: {{ .Values.livenessProbe.failureThreshold}}
-        ports:
-        - containerPort: {{ .Values.containerPort }}
-          name: {{ .Values.service.portName }}{{ if (include "common.needTLS" .) }}s{{ end }}
-          protocol: TCP
+        ports: {{ include "common.containerPorts" . | nindent 10  }}
       serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
-      volumes: {{ include "so.certificate.volumes" . | nindent 6 }}
+      volumes:
       - name: logs
         emptyDir: {}
       - name: config
diff --git a/kubernetes/so/components/so-etsi-sol003-adapter/templates/ingress.yaml b/kubernetes/so/components/so-etsi-sol003-adapter/templates/ingress.yaml
index 8f87c68..f298193 100644
--- a/kubernetes/so/components/so-etsi-sol003-adapter/templates/ingress.yaml
+++ b/kubernetes/so/components/so-etsi-sol003-adapter/templates/ingress.yaml
@@ -1 +1,17 @@
+{{/*
+# Copyright © 2019 Nordix 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.
+*/}}
+
 {{ include "common.ingress" . }}
diff --git a/kubernetes/so/components/so-etsi-sol003-adapter/templates/service.yaml b/kubernetes/so/components/so-etsi-sol003-adapter/templates/service.yaml
index 96a2acd..3da3875 100755
--- a/kubernetes/so/components/so-etsi-sol003-adapter/templates/service.yaml
+++ b/kubernetes/so/components/so-etsi-sol003-adapter/templates/service.yaml
@@ -13,39 +13,5 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 */}}
-apiVersion: v1
-kind: Service
-metadata:
-  name: {{ include "common.servicename" . }}
-  namespace: {{ include "common.namespace" . }}
-  labels:
-    app: {{ include "common.name" . }}
-    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
-    release: {{ include "common.release" . }}
-    heritage: {{ .Release.Service }}
-  annotations:
-    msb.onap.org/service-info: '[
-      {
-          "serviceName": "{{ include "common.servicename" . }}",
-          "version": "v1",
-          "url": "/so/vnfm-adapter/v1",
-          "protocol": "REST",
-          "port": "{{.Values.service.externalPort}}",
-          "visualRange":"1"
-      }
-      ]'
-spec:
-  type: {{ .Values.service.type }}
-  ports:
-    {{if eq .Values.service.type "NodePort" -}}
-    - port: {{ .Values.service.internalPort }}
-      nodePort: {{ .Values.global.nodePortPrefixExt | default .Values.nodePortPrefixExt }}{{ .Values.service.nodePort }}
-      name: {{ .Values.service.portName }}{{ if (include "common.needTLS" .) }}s{{ end }}
-    {{- else -}}
-    - port: {{ .Values.service.externalPort }}
-      targetPort: {{ .Values.service.internalPort }}
-      name: {{ .Values.service.portName }}{{ if (include "common.needTLS" .) }}s{{ end }}
-    {{- end}}
-  selector:
-    app: {{ include "common.name" . }}
-    release: {{ include "common.release" . }}
+
+{{ include "common.service" . }}
\ No newline at end of file
diff --git a/kubernetes/so/components/so-etsi-sol003-adapter/values.yaml b/kubernetes/so/components/so-etsi-sol003-adapter/values.yaml
index 170cfdd..98edceb 100755
--- a/kubernetes/so/components/so-etsi-sol003-adapter/values.yaml
+++ b/kubernetes/so/components/so-etsi-sol003-adapter/values.yaml
@@ -50,26 +50,34 @@
 logPath: ./logs/etsi-sol003-adapter/
 app: etsi-sol003-adapter
 service:
-    type: NodePort
-    internalPort: *containerPort
-    externalPort: *containerPort
-    nodePort: "06"
-    portName: http
+  type: NodePort
+  annotations:
+    service.alpha.kubernetes.io/tolerate-unready-endpoints: 'true'
+    msb.onap.org/service-info: |
+      {{ if .Values.global.msbEnabled -}}[
+        {
+          "serviceName": "{{ include "common.servicename" . }}",
+          "version": "v1",
+          "url": "/so/vnfm-adapter/v1",
+          "protocol": "REST",
+          "port": "{{.Values.containerPort}}",
+          "visualRange":"1"
+        }
+      ]{{ end }}
+  ports:
+    - name: http
+      port: *containerPort
+      nodePort: "06"
+
 updateStrategy:
-    type: RollingUpdate
-    maxUnavailable: 1
-    maxSurge: 1
+  type: RollingUpdate
+  maxUnavailable: 1
+  maxSurge: 1
 
 #################################################################
 # soHelpers part
 #################################################################
 soHelpers:
-  nameOverride: so-etsi-sol003-cert-init
-  certInitializer:
-    nameOverride: so-etsi-sol003-cert-init
-    credsPath: /opt/app/osaaf/local
-  cadi:
-    apiEnforcement: org.onap.so.vnfmAdapterPerm
   containerPort: *containerPort
 
 # Resource Limit flavor -By Default using small
@@ -92,18 +100,18 @@
       cpu: 1000m
   unlimited: {}
 livenessProbe:
-    port: 9092
-    initialDelaySeconds: 600
-    periodSeconds: 60
-    timeoutSeconds: 10
-    successThreshold: 1
-    failureThreshold: 3
+  port: 9092
+  initialDelaySeconds: 600
+  periodSeconds: 60
+  timeoutSeconds: 10
+  successThreshold: 1
+  failureThreshold: 3
 ingress:
   enabled: false
   service:
-      - baseaddr: "so-etsi-sol003-adapter-api"
-        name: "so-etsi-sol003-adapter"
-        port: 9092
+  - baseaddr: "so-etsi-sol003-adapter-api"
+    name: "so-etsi-sol003-adapter"
+    port: 9092
   config:
     ssl: "redirect"
 nodeSelector: {}