Merge "Add Network Discovery Charts to OOM"
authorMandeep Khinda <Mandeep.Khinda@amdocs.com>
Tue, 28 Aug 2018 22:53:00 +0000 (22:53 +0000)
committerGerrit Code Review <gerrit@onap.org>
Tue, 28 Aug 2018 22:53:00 +0000 (22:53 +0000)
18 files changed:
kubernetes/pomba/charts/pomba-networkdiscovery/Chart.yaml [new file with mode: 0644]
kubernetes/pomba/charts/pomba-networkdiscovery/requirements.yaml [new file with mode: 0644]
kubernetes/pomba/charts/pomba-networkdiscovery/resources/config/application.properties [new file with mode: 0644]
kubernetes/pomba/charts/pomba-networkdiscovery/resources/config/auth/enricher-client-cert.p12 [new file with mode: 0644]
kubernetes/pomba/charts/pomba-networkdiscovery/resources/config/log/logback.xml [new file with mode: 0644]
kubernetes/pomba/charts/pomba-networkdiscovery/templates/configmap.yaml [new file with mode: 0644]
kubernetes/pomba/charts/pomba-networkdiscovery/templates/deployment.yaml [new file with mode: 0644]
kubernetes/pomba/charts/pomba-networkdiscovery/templates/secrets.yaml [new file with mode: 0644]
kubernetes/pomba/charts/pomba-networkdiscovery/templates/service.yaml [new file with mode: 0644]
kubernetes/pomba/charts/pomba-networkdiscovery/values.yaml [new file with mode: 0644]
kubernetes/pomba/charts/pomba-servicedecomposition/Chart.yaml [new file with mode: 0644]
kubernetes/pomba/charts/pomba-servicedecomposition/requirements.yaml [new file with mode: 0644]
kubernetes/pomba/charts/pomba-servicedecomposition/resources/config/application.properties [new file with mode: 0644]
kubernetes/pomba/charts/pomba-servicedecomposition/resources/config/log/logback.xml [new file with mode: 0644]
kubernetes/pomba/charts/pomba-servicedecomposition/templates/configmap.yaml [new file with mode: 0644]
kubernetes/pomba/charts/pomba-servicedecomposition/templates/deployment.yaml [new file with mode: 0644]
kubernetes/pomba/charts/pomba-servicedecomposition/templates/service.yaml [new file with mode: 0644]
kubernetes/pomba/charts/pomba-servicedecomposition/values.yaml [new file with mode: 0644]

diff --git a/kubernetes/pomba/charts/pomba-networkdiscovery/Chart.yaml b/kubernetes/pomba/charts/pomba-networkdiscovery/Chart.yaml
new file mode 100644 (file)
index 0000000..13c1a6b
--- /dev/null
@@ -0,0 +1,18 @@
+# Copyright © 2018 Amdocs\r
+#\r
+# Licensed under the Apache License, Version 2.0 (the "License");\r
+# you may not use this file except in compliance with the License.\r
+# You may obtain a copy of the License at\r
+#\r
+#       http://www.apache.org/licenses/LICENSE-2.0\r
+#\r
+# Unless required by applicable law or agreed to in writing, software\r
+# distributed under the License is distributed on an "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+# See the License for the specific language governing permissions and\r
+# limitations under the License.\r
+\r
+apiVersion: v1\r
+description: ONAP POMBA Network Discovery\r
+name: pomba-networkdiscovery\r
+version: 2.0.0\r
diff --git a/kubernetes/pomba/charts/pomba-networkdiscovery/requirements.yaml b/kubernetes/pomba/charts/pomba-networkdiscovery/requirements.yaml
new file mode 100644 (file)
index 0000000..9bae031
--- /dev/null
@@ -0,0 +1,18 @@
+# Copyright © 2018 Amdocs\r
+#\r
+# Licensed under the Apache License, Version 2.0 (the "License");\r
+# you may not use this file except in compliance with the License.\r
+# You may obtain a copy of the License at\r
+#\r
+#       http://www.apache.org/licenses/LICENSE-2.0\r
+#\r
+# Unless required by applicable law or agreed to in writing, software\r
+# distributed under the License is distributed on an "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+# See the License for the specific language governing permissions and\r
+# limitations under the License.\r
+\r
+dependencies:\r
+  - name: common\r
+    version: ~2.0.0\r
+    repository: '@local'\r
diff --git a/kubernetes/pomba/charts/pomba-networkdiscovery/resources/config/application.properties b/kubernetes/pomba/charts/pomba-networkdiscovery/resources/config/application.properties
new file mode 100644 (file)
index 0000000..9246aca
--- /dev/null
@@ -0,0 +1,48 @@
+# Copyright © 2018 Amdocs
+#
+# 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
+
+spring.jersey.type=filter
+spring.mvc.urls=swagger,docs,prometheus,auditevents,info,heapdump,autoconfig,beans,loggers,dump,env,trace,health,configprops,mappings,metrics,webjars
+
+
+server.contextPath=/network-discovery
+spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
+
+#This property is used to set the Tomcat connector attributes.developers can define multiple attributes separated by comma
+#tomcat.connector.attributes=allowTrace-true
+#The max number of active threads in this pool
+server.tomcat.max-threads=200
+#The minimum number of threads always kept alive
+server.tomcat.min-Spare-Threads=25
+#The number of milliseconds before an idle thread shutsdown, unless the number of active threads are less or equal to minSpareThreads
+server.tomcat.max-idle-time=60000
+
+#Servlet context parameters
+server.context_parameters.p-name=value #context parameter with p-name as key and value as value.
+
+# Basic Authentication
+basicAuth.username={{ .Values.config.networkDiscoveryUserId }}
+basicAuth.password={{ .Values.config.networkDiscoveryPassword }}
+
+# A&AI Enircher REST Client Configuration
+enricher.url=https://<enricher_host_or_IP>:<port>
+enricher.connectionTimeout=5000
+enricher.readTimeout=60000
+enricher.keyStorePath=config/auth/enricher-client-cert.p12
+enricher.keyStorePassword=OBF:1i9a1u2a1unz1lr61wn51wn11lss1unz1u301i6o
+
+enricher.types = vserver, l3-network
+enricher.type.vserver.url    = /enricher/v11/cloud-infrastructure/vservers/vserver/{0}?sot=!aai
+enricher.type.l3-network.url = /enricher/v11/network/l3-networks/l3-network/{0}?sot=!aai
+
diff --git a/kubernetes/pomba/charts/pomba-networkdiscovery/resources/config/auth/enricher-client-cert.p12 b/kubernetes/pomba/charts/pomba-networkdiscovery/resources/config/auth/enricher-client-cert.p12
new file mode 100644 (file)
index 0000000..12e0ae9
Binary files /dev/null and b/kubernetes/pomba/charts/pomba-networkdiscovery/resources/config/auth/enricher-client-cert.p12 differ
diff --git a/kubernetes/pomba/charts/pomba-networkdiscovery/resources/config/log/logback.xml b/kubernetes/pomba/charts/pomba-networkdiscovery/resources/config/log/logback.xml
new file mode 100644 (file)
index 0000000..1f00cbd
--- /dev/null
@@ -0,0 +1,30 @@
+<configuration>\r
+    <property name="p_tim" value="%d{&quot;yyyy-MM-dd'T'HH:mm:ss.SSSXXX&quot;, UTC}"/>\r
+    <property name="p_lvl" value="%level"/>\r
+    <property name="p_log" value="%logger"/>\r
+    <property name="p_mdc" value="%replace(%replace(%mdc){'\t','\\\\t'}){'\n', '\\\\n'}"/>\r
+    <property name="p_msg" value="%replace(%replace(%msg){'\t', '\\\\t'}){'\n','\\\\n'}"/>\r
+    <property name="p_exc" value="%replace(%replace(%rootException){'\t', '\\\\t'}){'\n','\\\\n'}"/>\r
+    <!-- tabs -->\r
+    <property name="p_mak" value="%replace(%replace(%marker){'\t', '\\\\t'}){'\n','\\\\n'}"/>\r
+    <property name="p_thr" value="%thread"/>\r
+    <property name="pattern" value="%nopexception${p_tim}\t${p_thr}\t${p_lvl}\t${p_log}\t${p_mdc}\t${p_msg}\t${p_exc}\t${p_mak}\t%n"/>\r
+    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">\r
+        <encoder>\r
+            <pattern>${pattern}</pattern>\r
+        </encoder>\r
+    </appender>\r
+    <appender name="FILE" class="ch.qos.logback.core.FileAppender">\r
+        <file>output.log</file>\r
+        <encoder>\r
+            <pattern>${pattern}</pattern>\r
+        </encoder>\r
+    </appender>\r
+    <logger level="INFO" name="org.onap.logging.ref.slf4j" additivity="false">\r
+        <appender-ref ref="STDOUT" />\r
+        <appender-ref ref="FILE" />\r
+    </logger>\r
+    <root level="INFO">\r
+        <appender-ref ref="STDOUT" />\r
+    </root>\r
+</configuration>\r
diff --git a/kubernetes/pomba/charts/pomba-networkdiscovery/templates/configmap.yaml b/kubernetes/pomba/charts/pomba-networkdiscovery/templates/configmap.yaml
new file mode 100644 (file)
index 0000000..1e377b9
--- /dev/null
@@ -0,0 +1,30 @@
+# Copyright © 2018 Amdocs\r
+#\r
+# Licensed under the Apache License, Version 2.0 (the "License");\r
+# you may not use this file except in compliance with the License.\r
+# You may obtain a copy of the License at\r
+#\r
+#       http://www.apache.org/licenses/LICENSE-2.0\r
+#\r
+# Unless required by applicable law or agreed to in writing, software\r
+# distributed under the License is distributed on an "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+# See the License for the specific language governing permissions and\r
+# limitations under the License.\r
+#\r
+\r
+apiVersion: v1\r
+kind: ConfigMap\r
+metadata:\r
+  name: {{ include "common.fullname" . }}-log\r
+  namespace: {{ include "common.namespace" . }}\r
+data:\r
+{{ tpl (.Files.Glob "resources/config/log/logback.xml").AsConfig . | indent 2 }}\r
+---\r
+apiVersion: v1\r
+kind: ConfigMap\r
+metadata:\r
+  name: {{ include "common.fullname" . }}-configmap\r
+  namespace: {{ include "common.namespace" . }}\r
+data:\r
+{{ tpl (.Files.Glob "resources/config/application.properties").AsConfig . | indent 2 }}\r
diff --git a/kubernetes/pomba/charts/pomba-networkdiscovery/templates/deployment.yaml b/kubernetes/pomba/charts/pomba-networkdiscovery/templates/deployment.yaml
new file mode 100644 (file)
index 0000000..1bd0309
--- /dev/null
@@ -0,0 +1,118 @@
+# Copyright © 2018 Amdocs\r
+#\r
+# Licensed under the Apache License, Version 2.0 (the "License");\r
+# you may not use this file except in compliance with the License.\r
+# You may obtain a copy of the License at\r
+#\r
+#       http://www.apache.org/licenses/LICENSE-2.0\r
+#\r
+# Unless required by applicable law or agreed to in writing, software\r
+# distributed under the License is distributed on an "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+# See the License for the specific language governing permissions and\r
+# limitations under the License.\r
+\r
+apiVersion: extensions/v1beta1\r
+kind: Deployment\r
+metadata:\r
+  name: {{ include "common.fullname" . }}\r
+  namespace: {{ include "common.namespace" . }}\r
+  labels:\r
+    app: {{ include "common.name" . }}\r
+    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}\r
+    release: {{ .Release.Name }}\r
+    heritage: {{ .Release.Service }}\r
+spec:\r
+  replicas: {{ .Values.replicaCount }}\r
+  template:\r
+    metadata:\r
+      labels:\r
+        app: {{ include "common.name" . }}\r
+        release: {{ .Release.Name }}\r
+    spec:\r
+      containers:\r
+        - name: {{ include "common.name" . }}\r
+          image: "{{ include "common.repository" . }}/{{ .Values.image }}"\r
+          imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}\r
+          ports:\r
+          - containerPort: {{ .Values.service.internalPort }}\r
+          # disable liveness probe when breakpoints set in debugger\r
+          # so K8s doesn't restart unresponsive container\r
+          {{ if .Values.liveness.enabled }}\r
+          livenessProbe:\r
+            tcpSocket:\r
+              port: {{ .Values.service.internalPort }}\r
+            initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}\r
+            periodSeconds: {{ .Values.liveness.periodSeconds }}\r
+          {{ end }}\r
+          readinessProbe:\r
+            tcpSocket:\r
+              port: {{ .Values.service.internalPort }}\r
+            initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}\r
+            periodSeconds: {{ .Values.readiness.periodSeconds }}\r
+          env:\r
+          volumeMounts:\r
+          - mountPath: /etc/localtime\r
+            name: localtime\r
+            readOnly: true\r
+          - name: {{ include "common.fullname" . }}-logs\r
+            mountPath: /var/log/onap\r
+          - mountPath: /opt/app/config/logback.xml\r
+            name: {{ include "common.fullname" . }}-log-conf\r
+            subPath: logback.xml\r
+          - mountPath: /opt/app/config/application.properties\r
+            name: {{ include "common.fullname" . }}-config\r
+            subPath: application.properties\r
+            readOnly: true\r
+          - mountPath: /opt/app/config/auth/enricher-client-cert.p12\r
+            name: {{ include "common.fullname" . }}-auth-secret\r
+            subPath: enricher-client-cert.p12\r
+            readOnly: true\r
+\r
+          resources:\r
+{{ toYaml .Values.resources | indent 12 }}\r
+        {{- if .Values.nodeSelector }}\r
+        nodeSelector:\r
+{{ toYaml .Values.nodeSelector | indent 10 }}\r
+        {{- end -}}\r
+        {{- if .Values.affinity }}\r
+        affinity:\r
+{{ toYaml .Values.affinity | indent 10 }}\r
+        {{- end }}\r
+\r
+        # Filebeat sidecar container\r
+        - name: {{ include "common.name" . }}-filebeat-onap\r
+          image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"\r
+          imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}\r
+          volumeMounts:\r
+          - name: {{ include "common.fullname" . }}-filebeat-conf\r
+            mountPath: /usr/share/filebeat/filebeat.yml\r
+            subPath: filebeat.yml\r
+          - name: {{ include "common.fullname" . }}-data-filebeat\r
+            mountPath: /usr/share/filebeat/data\r
+          - name: {{ include "common.fullname" . }}-logs\r
+            mountPath: /var/log/onap\r
+\r
+      volumes:\r
+        - name: localtime\r
+          hostPath:\r
+            path: /etc/localtime\r
+        - name:  {{ include "common.fullname" . }}-logs\r
+          emptyDir: {}\r
+        - name: {{ include "common.fullname" . }}-log-conf\r
+          configMap:\r
+            name: {{ include "common.fullname" . }}-log\r
+        - name: {{ include "common.fullname" . }}-config\r
+          configMap:\r
+            name: {{ include "common.fullname" . }}-configmap\r
+        - name: {{ include "common.fullname" . }}-auth-secret\r
+          secret:\r
+            secretName: {{ include "common.fullname" . }}-auth\r
+        - name: {{ include "common.fullname" . }}-filebeat-conf\r
+          configMap:\r
+            name: {{ .Release.Name }}-pomba-filebeat-configmap\r
+        - name: {{ include "common.fullname" . }}-data-filebeat\r
+          emptyDir: {}\r
+\r
+      imagePullSecrets:\r
+      - name: "{{ include "common.namespace" . }}-docker-registry-key"\r
diff --git a/kubernetes/pomba/charts/pomba-networkdiscovery/templates/secrets.yaml b/kubernetes/pomba/charts/pomba-networkdiscovery/templates/secrets.yaml
new file mode 100644 (file)
index 0000000..3015811
--- /dev/null
@@ -0,0 +1,26 @@
+# Copyright © 2018 Amdocs, AT&T\r
+#\r
+# Licensed under the Apache License, Version 2.0 (the "License");\r
+# you may not use this file except in compliance with the License.\r
+# You may obtain a copy of the License at\r
+#\r
+#       http://www.apache.org/licenses/LICENSE-2.0\r
+#\r
+# Unless required by applicable law or agreed to in writing, software\r
+# distributed under the License is distributed on an "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+# See the License for the specific language governing permissions and\r
+# limitations under the License.\r
+\r
+apiVersion: v1\r
+kind: Secret\r
+metadata:\r
+  name: {{ include "common.fullname" . }}-auth\r
+  namespace: {{ include "common.namespace" . }}\r
+  labels:\r
+    app: {{ include "common.name" . }}\r
+    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}\r
+    release: {{ .Release.Name }}\r
+    heritage: {{ .Release.Service }}\r
+data:\r
+{{ (.Files.Glob "resources/config/auth/*").AsSecrets | indent 2 }}\r
diff --git a/kubernetes/pomba/charts/pomba-networkdiscovery/templates/service.yaml b/kubernetes/pomba/charts/pomba-networkdiscovery/templates/service.yaml
new file mode 100644 (file)
index 0000000..2b54def
--- /dev/null
@@ -0,0 +1,41 @@
+# Copyright © 2018 Amdocs\r
+#\r
+# Licensed under the Apache License, Version 2.0 (the "License");\r
+# you may not use this file except in compliance with the License.\r
+# You may obtain a copy of the License at\r
+#\r
+#       http://www.apache.org/licenses/LICENSE-2.0\r
+#\r
+# Unless required by applicable law or agreed to in writing, software\r
+# distributed under the License is distributed on an "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+# See the License for the specific language governing permissions and\r
+# limitations under the License.\r
+\r
+apiVersion: v1\r
+kind: Service\r
+metadata:\r
+  name: {{ include "common.servicename" . }}\r
+  namespace: {{ include "common.namespace" . }}\r
+  labels:\r
+    app: {{ include "common.name" . }}\r
+    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}\r
+    release: {{ .Release.Name }}\r
+    heritage: {{ .Release.Service }}\r
+spec:\r
+  type: {{ .Values.service.type }}\r
+  ports:\r
+    {{if eq .Values.service.type "NodePort" -}}\r
+    - port: {{ .Values.service.externalPort }}\r
+      #Example internal target port if required\r
+      #targetPort: {{ .Values.service.internalPort }}\r
+      nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort }}\r
+      name: {{ .Values.service.portName | default "http" }}\r
+    {{- else -}}\r
+    - port: {{ .Values.service.externalPort }}\r
+      targetPort: {{ .Values.service.internalPort }}\r
+      name: {{ .Values.service.portName | default "http" }}\r
+    {{- end}}\r
+  selector:\r
+    app: {{ include "common.name" . }}\r
+    release: {{ .Release.Name }}\r
diff --git a/kubernetes/pomba/charts/pomba-networkdiscovery/values.yaml b/kubernetes/pomba/charts/pomba-networkdiscovery/values.yaml
new file mode 100644 (file)
index 0000000..b65f3be
--- /dev/null
@@ -0,0 +1,96 @@
+# Copyright © 2018 Amdocs\r
+#\r
+# Licensed under the Apache License, Version 2.0 (the "License");\r
+# you may not use this file except in compliance with the License.\r
+# You may obtain a copy of the License at\r
+#\r
+#       http://www.apache.org/licenses/LICENSE-2.0\r
+#\r
+# Unless required by applicable law or agreed to in writing, software\r
+# distributed under the License is distributed on an "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+# See the License for the specific language governing permissions and\r
+# limitations under the License.\r
+\r
+#################################################################\r
+# Global configuration defaults.\r
+#################################################################\r
+global:\r
+  nodePortPrefix: 302\r
+  repository: nexus3.onap.org:10001\r
+\r
+#################################################################\r
+# Application configuration defaults.\r
+#################################################################\r
+# application image\r
+repository: nexus3.onap.org:10001\r
+image:  onap/network-discovery:latest\r
+pullPolicy: Always\r
+\r
+# flag to enable debugging - application support required\r
+debugEnabled: false\r
+\r
+# application configuration\r
+# Example:\r
+config:\r
+  # Network Discovery Micro Service REST Client Configuration\r
+  # Basic Authorization credentials for Network Discovery Micro Service Rest Service\r
+  networkDiscoveryUserId: admin\r
+  networkDiscoveryPassword: OBF:1u2a1toa1w8v1tok1u30\r
+\r
+# default number of instances\r
+replicaCount: 1\r
+\r
+nodeSelector: {}\r
+\r
+affinity: {}\r
+\r
+# probe configuration parameters\r
+liveness:\r
+  initialDelaySeconds: 10\r
+  periodSeconds: 10\r
+  # necessary to disable liveness probe when setting breakpoints\r
+  # in debugger so K8s doesn't restart unresponsive container\r
+  enabled: true\r
+\r
+readiness:\r
+  initialDelaySeconds: 10\r
+  periodSeconds: 10\r
+\r
+#Example service definition with external, internal and node ports.\r
+service:\r
+  # The default service name (exposed in the service.yaml) will be the same\r
+  # name as the chart. If the service name needs to be overriden (such as\r
+  # when a subchart is shared), uncomment the value below.\r
+  #name: <service-name-override>\r
+\r
+  #Services may use any combination of ports depending on the 'type' of\r
+  #service being defined.\r
+  type: ClusterIP\r
+  externalPort: 9531\r
+  internalPort: 8080\r
+#  nodePort: <replace with unused node port suffix eg. 23>\r
+  # optional port name override - default can be defined in service.yaml\r
+  #portName: http\r
+\r
+ingress:\r
+  enabled: false\r
+\r
+resources: {}\r
+  # We usually recommend not to specify default resources and to leave this as a conscious\r
+  # choice for the user. This also increases chances charts run on environments with little\r
+  # resources, such as Minikube. If you do want to specify resources, uncomment the following\r
+  # lines, adjust them as necessary, and remove the curly braces after 'resources:'.\r
+  #\r
+  # Example:\r
+  # Configure resource requests and limits\r
+  # ref: http://kubernetes.io/docs/user-guide/compute-resources/\r
+  # Minimum memory for development is 2 CPU cores and 4GB memory\r
+  # Minimum memory for production is 4 CPU cores and 8GB memory\r
+#resources:\r
+#  limits:\r
+#    cpu: 2\r
+#    memory: 4Gi\r
+#  requests:\r
+#    cpu: 2\r
+#    memory: 4Gi\r
diff --git a/kubernetes/pomba/charts/pomba-servicedecomposition/Chart.yaml b/kubernetes/pomba/charts/pomba-servicedecomposition/Chart.yaml
new file mode 100644 (file)
index 0000000..4b89acf
--- /dev/null
@@ -0,0 +1,18 @@
+# Copyright © 2018 Amdocs\r
+#\r
+# Licensed under the Apache License, Version 2.0 (the "License");\r
+# you may not use this file except in compliance with the License.\r
+# You may obtain a copy of the License at\r
+#\r
+#       http://www.apache.org/licenses/LICENSE-2.0\r
+#\r
+# Unless required by applicable law or agreed to in writing, software\r
+# distributed under the License is distributed on an "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+# See the License for the specific language governing permissions and\r
+# limitations under the License.\r
+\r
+apiVersion: v1\r
+description: ONAP POMBA Network Discovery Service Decomposition\r
+name: pomba-servicedecomposition\r
+version: 2.0.0\r
diff --git a/kubernetes/pomba/charts/pomba-servicedecomposition/requirements.yaml b/kubernetes/pomba/charts/pomba-servicedecomposition/requirements.yaml
new file mode 100644 (file)
index 0000000..8ba6926
--- /dev/null
@@ -0,0 +1,18 @@
+# Copyright � 2018 Amdocs\r
+#\r
+# Licensed under the Apache License, Version 2.0 (the "License");\r
+# you may not use this file except in compliance with the License.\r
+# You may obtain a copy of the License at\r
+#\r
+#       http://www.apache.org/licenses/LICENSE-2.0\r
+#\r
+# Unless required by applicable law or agreed to in writing, software\r
+# distributed under the License is distributed on an "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+# See the License for the specific language governing permissions and\r
+# limitations under the License.\r
+\r
+dependencies:\r
+  - name: common\r
+    version: ~2.0.0\r
+    repository: '@local'\r
diff --git a/kubernetes/pomba/charts/pomba-servicedecomposition/resources/config/application.properties b/kubernetes/pomba/charts/pomba-servicedecomposition/resources/config/application.properties
new file mode 100644 (file)
index 0000000..26737f5
--- /dev/null
@@ -0,0 +1,51 @@
+# Copyright © 2018 Amdocs
+#
+# 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
+
+spring.jersey.type=filter
+spring.mvc.urls=swagger,docs,prometheus,auditevents,info,heapdump,autoconfig,beans,loggers,dump,env,trace,health,configprops,mappings,metrics,webjars
+
+
+server.contextPath=/service-decomposition
+spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
+
+#This property is used to set the Tomcat connector attributes.developers can define multiple attributes separated by comma
+#tomcat.connector.attributes=allowTrace-true
+#The max number of active threads in this pool
+server.tomcat.max-threads=200
+#The minimum number of threads always kept alive
+server.tomcat.min-Spare-Threads=25
+#The number of milliseconds before an idle thread shutsdown, unless the number of active threads are less or equal to minSpareThreads
+server.tomcat.max-idle-time=60000
+
+basicAuth.username={{ .Values.config.serviceDecompositionUserId }}
+basicAuth.password={{ .Values.config.serviceDecompositionPassword }}
+
+# AAI REST Client Configuration
+aai.host=127.0.0.1
+aai.port=8443
+aai.httpProtocol=http
+aai.trustStorePath=tomcat_keystore
+aai.keyStorePath=aai-client-cert.p12
+aai.keyStorePassword=OBF:1i9a1u2a1unz1lr61wn51wn11lss1unz1u301i6o
+aai.keyManagerFactoryAlgorithm=SunX509
+aai.keyStoreType=PKCS12
+aai.securityProtocol=TLS
+aai.connectionTimeout=5000
+aai.readTimeout=1000
+aai.resourceList=vnfc,vserver,l3-network
+aai.serviceInstancePath=/aai/v13/nodes/service-instance/{0}
+
+#Servlet context parameters
+server.context_parameters.p-name=value #context parameter with p-name as key and value as value.
+
diff --git a/kubernetes/pomba/charts/pomba-servicedecomposition/resources/config/log/logback.xml b/kubernetes/pomba/charts/pomba-servicedecomposition/resources/config/log/logback.xml
new file mode 100644 (file)
index 0000000..1f00cbd
--- /dev/null
@@ -0,0 +1,30 @@
+<configuration>\r
+    <property name="p_tim" value="%d{&quot;yyyy-MM-dd'T'HH:mm:ss.SSSXXX&quot;, UTC}"/>\r
+    <property name="p_lvl" value="%level"/>\r
+    <property name="p_log" value="%logger"/>\r
+    <property name="p_mdc" value="%replace(%replace(%mdc){'\t','\\\\t'}){'\n', '\\\\n'}"/>\r
+    <property name="p_msg" value="%replace(%replace(%msg){'\t', '\\\\t'}){'\n','\\\\n'}"/>\r
+    <property name="p_exc" value="%replace(%replace(%rootException){'\t', '\\\\t'}){'\n','\\\\n'}"/>\r
+    <!-- tabs -->\r
+    <property name="p_mak" value="%replace(%replace(%marker){'\t', '\\\\t'}){'\n','\\\\n'}"/>\r
+    <property name="p_thr" value="%thread"/>\r
+    <property name="pattern" value="%nopexception${p_tim}\t${p_thr}\t${p_lvl}\t${p_log}\t${p_mdc}\t${p_msg}\t${p_exc}\t${p_mak}\t%n"/>\r
+    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">\r
+        <encoder>\r
+            <pattern>${pattern}</pattern>\r
+        </encoder>\r
+    </appender>\r
+    <appender name="FILE" class="ch.qos.logback.core.FileAppender">\r
+        <file>output.log</file>\r
+        <encoder>\r
+            <pattern>${pattern}</pattern>\r
+        </encoder>\r
+    </appender>\r
+    <logger level="INFO" name="org.onap.logging.ref.slf4j" additivity="false">\r
+        <appender-ref ref="STDOUT" />\r
+        <appender-ref ref="FILE" />\r
+    </logger>\r
+    <root level="INFO">\r
+        <appender-ref ref="STDOUT" />\r
+    </root>\r
+</configuration>\r
diff --git a/kubernetes/pomba/charts/pomba-servicedecomposition/templates/configmap.yaml b/kubernetes/pomba/charts/pomba-servicedecomposition/templates/configmap.yaml
new file mode 100644 (file)
index 0000000..6982316
--- /dev/null
@@ -0,0 +1,30 @@
+# Copyright © 2018 Amdocs
+#
+# 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: v1
+kind: ConfigMap
+metadata:
+  name: {{ include "common.fullname" . }}-log
+  namespace: {{ include "common.namespace" . }}
+data:
+{{ tpl (.Files.Glob "resources/config/log/logback.xml").AsConfig . | indent 2 }}
+---
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: {{ include "common.fullname" . }}-configmap
+  namespace: {{ include "common.namespace" . }}
+data:
+{{ tpl (.Files.Glob "resources/config/application.properties").AsConfig . | indent 2 }}
diff --git a/kubernetes/pomba/charts/pomba-servicedecomposition/templates/deployment.yaml b/kubernetes/pomba/charts/pomba-servicedecomposition/templates/deployment.yaml
new file mode 100644 (file)
index 0000000..14513f3
--- /dev/null
@@ -0,0 +1,111 @@
+# Copyright © 2018 Amdocs
+#
+# 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: extensions/v1beta1
+kind: Deployment
+metadata:
+  name: {{ include "common.fullname" . }}
+  namespace: {{ include "common.namespace" . }}
+  labels:
+    app: {{ include "common.name" . }}
+    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
+    release: {{ .Release.Name }}
+    heritage: {{ .Release.Service }}
+spec:
+  replicas: {{ .Values.replicaCount }}
+  template:
+    metadata:
+      labels:
+        app: {{ include "common.name" . }}
+        release: {{ .Release.Name }}
+    spec:
+      containers:
+        - name: {{ include "common.name" . }}
+          image: "{{ include "common.repository" . }}/{{ .Values.image }}"
+          imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
+          ports:
+          - containerPort: {{ .Values.service.internalPort }}
+          # disable liveness probe when breakpoints set in debugger
+          # so K8s doesn't restart unresponsive container
+          {{ if .Values.liveness.enabled }}
+          livenessProbe:
+            tcpSocket:
+              port: {{ .Values.service.internalPort }}
+            initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
+            periodSeconds: {{ .Values.liveness.periodSeconds }}
+          {{ end }}
+          readinessProbe:
+            tcpSocket:
+              port: {{ .Values.service.internalPort }}
+            initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
+            periodSeconds: {{ .Values.readiness.periodSeconds }}
+          env:
+          volumeMounts:
+          - mountPath: /etc/localtime
+            name: localtime
+            readOnly: true
+          - name: {{ include "common.fullname" . }}-logs
+            mountPath: /var/log/onap
+          - mountPath: /opt/app/config/logback.xml
+            name: {{ include "common.fullname" . }}-log-conf
+            subPath: logback.xml
+          - mountPath: /opt/app/config/application.properties
+            name: {{ include "common.fullname" . }}-config
+            subPath: application.properties
+            readOnly: true
+
+          resources:
+{{ toYaml .Values.resources | indent 12 }}
+        {{- if .Values.nodeSelector }}
+        nodeSelector:
+{{ toYaml .Values.nodeSelector | indent 10 }}
+        {{- end -}}
+        {{- if .Values.affinity }}
+        affinity:
+{{ toYaml .Values.affinity | indent 10 }}
+        {{- end }}
+
+        # Filebeat sidecar container
+        - name: {{ include "common.name" . }}-filebeat-onap
+          image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
+          imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
+          volumeMounts:
+          - name: {{ include "common.fullname" . }}-filebeat-conf
+            mountPath: /usr/share/filebeat/filebeat.yml
+            subPath: filebeat.yml
+          - name: {{ include "common.fullname" . }}-data-filebeat
+            mountPath: /usr/share/filebeat/data
+          - name: {{ include "common.fullname" . }}-logs
+            mountPath: /var/log/onap
+
+      volumes:
+        - name: localtime
+          hostPath:
+            path: /etc/localtime
+        - name:  {{ include "common.fullname" . }}-logs
+          emptyDir: {}
+        - name: {{ include "common.fullname" . }}-log-conf
+          configMap:
+            name: {{ include "common.fullname" . }}-log
+        - name: {{ include "common.fullname" . }}-config
+          configMap:
+            name: {{ include "common.fullname" . }}-configmap
+        - name: {{ include "common.fullname" . }}-filebeat-conf
+          configMap:
+            name: {{ .Release.Name }}-pomba-filebeat-configmap
+        - name: {{ include "common.fullname" . }}-data-filebeat
+          emptyDir: {}
+
+      imagePullSecrets:
+      - name: "{{ include "common.namespace" . }}-docker-registry-key"
diff --git a/kubernetes/pomba/charts/pomba-servicedecomposition/templates/service.yaml b/kubernetes/pomba/charts/pomba-servicedecomposition/templates/service.yaml
new file mode 100644 (file)
index 0000000..defd063
--- /dev/null
@@ -0,0 +1,41 @@
+# Copyright © 2018 Amdocs
+#
+# 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: v1
+kind: Service
+metadata:
+  name: {{ include "common.servicename" . }}
+  namespace: {{ include "common.namespace" . }}
+  labels:
+    app: {{ include "common.name" . }}
+    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
+    release: {{ .Release.Name }}
+    heritage: {{ .Release.Service }}
+spec:
+  type: {{ .Values.service.type }}
+  ports:
+    {{if eq .Values.service.type "NodePort" -}}
+    - port: {{ .Values.service.externalPort }}
+      #Example internal target port if required
+      #targetPort: {{ .Values.service.internalPort }}
+      nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort }}
+      name: {{ .Values.service.portName | default "http" }}
+    {{- else -}}
+    - port: {{ .Values.service.externalPort }}
+      targetPort: {{ .Values.service.internalPort }}
+      name: {{ .Values.service.portName | default "http" }}
+    {{- end}}
+  selector:
+    app: {{ include "common.name" . }}
+    release: {{ .Release.Name }}
diff --git a/kubernetes/pomba/charts/pomba-servicedecomposition/values.yaml b/kubernetes/pomba/charts/pomba-servicedecomposition/values.yaml
new file mode 100644 (file)
index 0000000..3de087e
--- /dev/null
@@ -0,0 +1,96 @@
+# Copyright © 2018 Amdocs\r
+#\r
+# Licensed under the Apache License, Version 2.0 (the "License");\r
+# you may not use this file except in compliance with the License.\r
+# You may obtain a copy of the License at\r
+#\r
+#       http://www.apache.org/licenses/LICENSE-2.0\r
+#\r
+# Unless required by applicable law or agreed to in writing, software\r
+# distributed under the License is distributed on an "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+# See the License for the specific language governing permissions and\r
+# limitations under the License.\r
+\r
+#################################################################\r
+# Global configuration defaults.\r
+#################################################################\r
+global:\r
+  nodePortPrefix: 302\r
+  repository: nexus3.onap.org:10001\r
+\r
+#################################################################\r
+# Application configuration defaults.\r
+#################################################################\r
+# application image\r
+repository: nexus3.onap.org:10001\r
+image:  onap/service-decomposition:latest\r
+pullPolicy: Always\r
+\r
+# flag to enable debugging - application support required\r
+debugEnabled: false\r
+\r
+# application configuration\r
+# Example:\r
+config:\r
+  # Service Decomposition REST Client Configuration\r
+  # Basic Authorization Client credentials for Service Decomposition REST service\r
+  serviceDecompositionUserId: admin\r
+  serviceDecompositionPassword: OBF:1u2a1toa1w8v1tok1u30\r
+\r
+# default number of instances\r
+replicaCount: 1\r
+\r
+nodeSelector: {}\r
+\r
+affinity: {}\r
+\r
+# probe configuration parameters\r
+liveness:\r
+  initialDelaySeconds: 10\r
+  periodSeconds: 10\r
+  # necessary to disable liveness probe when setting breakpoints\r
+  # in debugger so K8s doesn't restart unresponsive container\r
+  enabled: true\r
+\r
+readiness:\r
+  initialDelaySeconds: 10\r
+  periodSeconds: 10\r
+\r
+#Example service definition with external, internal and node ports.\r
+service:\r
+  # The default service name (exposed in the service.yaml) will be the same\r
+  # name as the chart. If the service name needs to be overriden (such as\r
+  # when a subchart is shared), uncomment the value below.\r
+  #name: <service-name-override>\r
+\r
+  #Services may use any combination of ports depending on the 'type' of\r
+  #service being defined.\r
+  type: ClusterIP\r
+  externalPort: 9532\r
+  internalPort: 8080\r
+#  nodePort: <replace with unused node port suffix eg. 23>\r
+  # optional port name override - default can be defined in service.yaml\r
+  #portName: http\r
+\r
+ingress:\r
+  enabled: false\r
+\r
+resources: {}\r
+  # We usually recommend not to specify default resources and to leave this as a conscious\r
+  # choice for the user. This also increases chances charts run on environments with little\r
+  # resources, such as Minikube. If you do want to specify resources, uncomment the following\r
+  # lines, adjust them as necessary, and remove the curly braces after 'resources:'.\r
+  #\r
+  # Example:\r
+  # Configure resource requests and limits\r
+  # ref: http://kubernetes.io/docs/user-guide/compute-resources/\r
+  # Minimum memory for development is 2 CPU cores and 4GB memory\r
+  # Minimum memory for production is 4 CPU cores and 8GB memory\r
+#resources:\r
+#  limits:\r
+#    cpu: 2\r
+#    memory: 4Gi\r
+#  requests:\r
+#    cpu: 2\r
+#    memory: 4Gi\r