From 9bf2731ab42d49b3ac89d07e0e1282f685151c57 Mon Sep 17 00:00:00 2001 From: kj Date: Mon, 19 Mar 2018 15:07:44 +0200 Subject: Add standardized helm chart for aai Issue-ID: OOM-734 Change-Id: I6b1a85017d79b92afcae44cf823ab000a10ce4be Signed-off-by: kj --- kubernetes/aai/charts/aai-modelloader/.helmignore | 21 +++ kubernetes/aai/charts/aai-modelloader/Chart.yaml | 4 + .../resources/config/auth/aai-os-cert.p12 | Bin 0 -> 4357 bytes .../resources/config/log/logback.xml | 161 +++++++++++++++++++++ .../resources/config/model-loader.properties | 23 +++ .../aai-modelloader/templates/configmap.yaml | 15 ++ .../aai-modelloader/templates/deployment.yaml | 97 +++++++++++++ .../charts/aai-modelloader/templates/secret.yaml | 8 + .../charts/aai-modelloader/templates/service.yaml | 29 ++++ kubernetes/aai/charts/aai-modelloader/values.yaml | 67 +++++++++ 10 files changed, 425 insertions(+) create mode 100644 kubernetes/aai/charts/aai-modelloader/.helmignore create mode 100644 kubernetes/aai/charts/aai-modelloader/Chart.yaml create mode 100644 kubernetes/aai/charts/aai-modelloader/resources/config/auth/aai-os-cert.p12 create mode 100644 kubernetes/aai/charts/aai-modelloader/resources/config/log/logback.xml create mode 100644 kubernetes/aai/charts/aai-modelloader/resources/config/model-loader.properties create mode 100644 kubernetes/aai/charts/aai-modelloader/templates/configmap.yaml create mode 100644 kubernetes/aai/charts/aai-modelloader/templates/deployment.yaml create mode 100644 kubernetes/aai/charts/aai-modelloader/templates/secret.yaml create mode 100644 kubernetes/aai/charts/aai-modelloader/templates/service.yaml create mode 100644 kubernetes/aai/charts/aai-modelloader/values.yaml (limited to 'kubernetes/aai/charts/aai-modelloader') diff --git a/kubernetes/aai/charts/aai-modelloader/.helmignore b/kubernetes/aai/charts/aai-modelloader/.helmignore new file mode 100644 index 0000000000..f0c1319444 --- /dev/null +++ b/kubernetes/aai/charts/aai-modelloader/.helmignore @@ -0,0 +1,21 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj diff --git a/kubernetes/aai/charts/aai-modelloader/Chart.yaml b/kubernetes/aai/charts/aai-modelloader/Chart.yaml new file mode 100644 index 0000000000..33558f24b3 --- /dev/null +++ b/kubernetes/aai/charts/aai-modelloader/Chart.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +description: ONAP AAI modelloader +name: aai-modelloader +version: 2.0.0 diff --git a/kubernetes/aai/charts/aai-modelloader/resources/config/auth/aai-os-cert.p12 b/kubernetes/aai/charts/aai-modelloader/resources/config/auth/aai-os-cert.p12 new file mode 100644 index 0000000000..ee57120fa0 Binary files /dev/null and b/kubernetes/aai/charts/aai-modelloader/resources/config/auth/aai-os-cert.p12 differ diff --git a/kubernetes/aai/charts/aai-modelloader/resources/config/log/logback.xml b/kubernetes/aai/charts/aai-modelloader/resources/config/log/logback.xml new file mode 100644 index 0000000000..d512d3b91c --- /dev/null +++ b/kubernetes/aai/charts/aai-modelloader/resources/config/log/logback.xml @@ -0,0 +1,161 @@ + + + + + + + + + + + + + + + + + + + + + ${pattern} + + + + + + + + ${logDirectory}/${generalLogName}.log + + ${logDirectory}/${generalLogName}.%d{yyyy-MM-dd}.%i.log + + ${maxFileSize} + + ${maxHistory} + ${totalSizeCap} + + + ${pattern} + + + + + + INFO + + ${queueSize} + + + + ${logDirectory}/${auditLogName}.log + + ${logDirectory}/${auditLogName}.%d{yyyy-MM-dd}.%i.log + + ${maxFileSize} + + ${maxHistory} + ${totalSizeCap} + + + ${pattern} + + + + ${queueSize} + + + + ${logDirectory}/${metricsLogName}.log + + ${logDirectory}/${metricsLogName}.%d{yyyy-MM-dd}.%i.log + + ${maxFileSize} + + ${maxHistory} + ${totalSizeCap} + + + ${pattern} + + + + ${queueSize} + + + + ${logDirectory}/${debugLogName}.log + + ${logDirectory}/${debugLogName}.%d{yyyy-MM-dd}.%i.log + + ${maxFileSize} + + ${maxHistory} + ${totalSizeCap} + + + ${pattern} + + + + ${queueSize} + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kubernetes/aai/charts/aai-modelloader/resources/config/model-loader.properties b/kubernetes/aai/charts/aai-modelloader/resources/config/model-loader.properties new file mode 100644 index 0000000000..5604c1f877 --- /dev/null +++ b/kubernetes/aai/charts/aai-modelloader/resources/config/model-loader.properties @@ -0,0 +1,23 @@ +# Model Loader Distribution Client Configuration +ml.distribution.ACTIVE_SERVER_TLS_AUTH=false +ml.distribution.ASDC_ADDRESS=sdc-be.{{.Release.Namespace}}:8443 +ml.distribution.CONSUMER_GROUP=aai-ml-group +ml.distribution.CONSUMER_ID=aai-ml +ml.distribution.ENVIRONMENT_NAME=AUTO +ml.distribution.KEYSTORE_PASSWORD= +ml.distribution.KEYSTORE_FILE=asdc-client.jks +ml.distribution.PASSWORD=OBF:1ks51l8d1o3i1pcc1r2r1e211r391kls1pyj1z7u1njf1lx51go21hnj1y0k1mli1sop1k8o1j651vu91mxw1vun1mze1vv11j8x1k5i1sp11mjc1y161hlr1gm41m111nkj1z781pw31kku1r4p1e391r571pbm1o741l4x1ksp +ml.distribution.POLLING_INTERVAL=30 +ml.distribution.POLLING_TIMEOUT=20 +ml.distribution.USER=aai +ml.distribution.ARTIFACT_TYPES=MODEL_INVENTORY_PROFILE,MODEL_QUERY_SPEC,VNF_CATALOG + +# Model Loader AAI REST Client Configuration +ml.aai.BASE_URL=https://aai.{{.Release.Namespace}}:8443 +ml.aai.MODEL_URL=/aai/v10/service-design-and-creation/models/model/ +ml.aai.NAMED_QUERY_URL=/aai/v10/service-design-and-creation/named-queries/named-query/ +ml.aai.VNF_IMAGE_URL=/aai/v8/service-design-and-creation/vnf-images +ml.aai.KEYSTORE_FILE=aai-os-cert.p12 +ml.aai.KEYSTORE_PASSWORD=OBF:1i9a1u2a1unz1lr61wn51wn11lss1unz1u301i6o +ml.aai.AUTH_USER=ModelLoader +ml.aai.AUTH_PASSWORD=OBF:1qvu1v2h1sov1sar1wfw1j7j1wg21saj1sov1v1x1qxw diff --git a/kubernetes/aai/charts/aai-modelloader/templates/configmap.yaml b/kubernetes/aai/charts/aai-modelloader/templates/configmap.yaml new file mode 100644 index 0000000000..8b63cfa048 --- /dev/null +++ b/kubernetes/aai/charts/aai-modelloader/templates/configmap.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }}-prop + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/model-loader.properties").AsConfig . | indent 2 }} +--- +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 }} diff --git a/kubernetes/aai/charts/aai-modelloader/templates/deployment.yaml b/kubernetes/aai/charts/aai-modelloader/templates/deployment.yaml new file mode 100644 index 0000000000..38ebe7689f --- /dev/null +++ b/kubernetes/aai/charts/aai-modelloader/templates/deployment.yaml @@ -0,0 +1,97 @@ +# Copyright © 2017 Amdocs, Bell Canada +# +# 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 }} + selector: + matchLabels: + app: {{ include "common.name" . }} + template: + metadata: + labels: + app: {{ include "common.name" . }} + release: {{ .Release.Name }} + name: {{ include "common.name" . }} + spec: + containers: + - name: {{ include "common.name" . }} + image: {{ .Values.global.repository | default .Values.repository }}/{{ .Values.image }} + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + env: + - name: CONFIG_HOME + value: /opt/app/model-loader/config/ + volumeMounts: + - mountPath: /etc/localtime + name: localtime + readOnly: true + - mountPath: /opt/app/model-loader/config/model-loader.properties + subPath: model-loader.properties + name: {{ include "common.fullname" . }}-prop-config + - mountPath: /opt/app/model-loader/config/auth/ + name: {{ include "common.fullname" . }}-auth-config + - mountPath: /var/log/onap + name: {{ include "common.fullname" . }}-logs + - mountPath: /opt/app/model-loader/bundleconfig/etc/logback.xml + name: {{ include "common.fullname" . }}-log-conf + subPath: logback.xml + ports: + - containerPort: {{ .Values.service.internalPort }} + - containerPort: {{ .Values.service.internalPort2 }} + + # side car containers + - name: filebeat-onap + image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + volumeMounts: + - mountPath: /usr/share/filebeat/filebeat.yml + subPath: filebeat.yml + name: filebeat-conf + - mountPath: /var/log/onap + name: {{ include "common.fullname" . }}-logs + - mountPath: /usr/share/filebeat/data + name: aai-filebeat + + volumes: + - name: localtime + hostPath: + path: /etc/localtime + - name: {{ include "common.fullname" . }}-prop-config + configMap: + name: {{ include "common.fullname" . }}-prop + - name: {{ include "common.fullname" . }}-auth-config + secret: + secretName: {{ include "common.fullname" . }} + - name: filebeat-conf + configMap: + name: aai-filebeat + - name: {{ include "common.fullname" . }}-logs + emptyDir: {} + - name: aai-filebeat + emptyDir: {} + - name: {{ include "common.fullname" . }}-log-conf + configMap: + name: {{ include "common.fullname" . }}-log + restartPolicy: {{ .Values.global.restartPolicy | default .Values.restartPolicy }} + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/kubernetes/aai/charts/aai-modelloader/templates/secret.yaml b/kubernetes/aai/charts/aai-modelloader/templates/secret.yaml new file mode 100644 index 0000000000..69bd3f86de --- /dev/null +++ b/kubernetes/aai/charts/aai-modelloader/templates/secret.yaml @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "common.fullname" . }} + namespace: {{ include "common.namespace" . }} +type: Opaque +data: +{{ tpl (.Files.Glob "resources/config/auth/*").AsSecrets . | indent 2 }} diff --git a/kubernetes/aai/charts/aai-modelloader/templates/service.yaml b/kubernetes/aai/charts/aai-modelloader/templates/service.yaml new file mode 100644 index 0000000000..bd59edb94f --- /dev/null +++ b/kubernetes/aai/charts/aai-modelloader/templates/service.yaml @@ -0,0 +1,29 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "common.name" . }} + 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.internalPort }} + nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort }} + name: {{ .Values.service.name }} + - port: {{ .Values.service.internalPort2 }} + nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort2 }} + name: {{ .Values.service.name }}2 + {{- else -}} + - port: {{ .Values.service.internalPort }} + name: {{ .Values.service.name }} + - port: {{ .Values.service.internalPort2 }} + name: {{ .Values.service.name }}2 + {{- end}} + selector: + app: {{ include "common.name" . }} + release: {{ .Release.Name }} diff --git a/kubernetes/aai/charts/aai-modelloader/values.yaml b/kubernetes/aai/charts/aai-modelloader/values.yaml new file mode 100644 index 0000000000..f44d5247ab --- /dev/null +++ b/kubernetes/aai/charts/aai-modelloader/values.yaml @@ -0,0 +1,67 @@ +# Default values for modelloader. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. +global: # global defaults + nodePortPrefix: 302 + repositorySecret: eyJuZXh1czMub25hcC5vcmc6MTAwMDEiOnsidXNlcm5hbWUiOiJkb2NrZXIiLCJwYXNzd29yZCI6ImRvY2tlciIsImVtYWlsIjoiQCIsImF1dGgiOiJaRzlqYTJWeU9tUnZZMnRsY2c9PSJ9fQ== + + +# application image +repository: nexus3.onap.org:10001 +image: onap/model-loader:v1.1.0 +pullPolicy: Always +restartPolicy: Always + +# application configuration +config: {} + +# default number of instances +replicaCount: 1 + +nodeSelector: {} + +affinity: {} + +# probe configuration parameters +liveness: + initialDelaySeconds: 10 + periodSeconds: 10 + # necessary to disable liveness probe when setting breakpoints + # in debugger so K8s doesn't restart unresponsive container + enabled: true + +readiness: + initialDelaySeconds: 10 + periodSeconds: 10 + +service: + type: NodePort + name: aai-modelloader + externalPort: 8080 + internalPort: 8080 + nodePort: 10 + externalPort2: 8443 + internalPort2: 8443 + nodePort2: 29 + +ingress: + enabled: false + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # + # Example: + # Configure resource requests and limits + # ref: http://kubernetes.io/docs/user-guide/compute-resources/ + # Minimum memory for development is 2 CPU cores and 4GB memory + # Minimum memory for production is 4 CPU cores and 8GB memory +#resources: +# limits: +# cpu: 2 +# memory: 4Gi +# requests: +# cpu: 2 +# memory: 4Gi -- cgit 1.2.3-korg