diff options
Diffstat (limited to 'kubernetes')
52 files changed, 1583 insertions, 197 deletions
diff --git a/kubernetes/aai/charts/champ/Chart.yaml b/kubernetes/aai/charts/champ/Chart.yaml new file mode 100644 index 0000000000..a4ee888fce --- /dev/null +++ b/kubernetes/aai/charts/champ/Chart.yaml @@ -0,0 +1,18 @@ +# Copyright © 2018 Amdocs, AT&T +# +# 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 +description: Champ microservice +name: champ +version: 2.0.0 diff --git a/kubernetes/aai/charts/champ/requirements.yaml b/kubernetes/aai/charts/champ/requirements.yaml new file mode 100644 index 0000000000..9552dfd9e0 --- /dev/null +++ b/kubernetes/aai/charts/champ/requirements.yaml @@ -0,0 +1,21 @@ +# Copyright © 2018 Amdocs, AT&T +# +# 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. + +dependencies: + - name: common + version: ~2.0.0 + # local reference to common chart, as it is + # a part of this chart's package and will not + # be published independently to a repo (at this point) + repository: '@local' diff --git a/kubernetes/aai/charts/champ/resources/config/appconfig/auth/champ_policy.json b/kubernetes/aai/charts/champ/resources/config/appconfig/auth/champ_policy.json new file mode 100644 index 0000000000..ee04a714be --- /dev/null +++ b/kubernetes/aai/charts/champ/resources/config/appconfig/auth/champ_policy.json @@ -0,0 +1,19 @@ +{ + "roles": [ + { + "name": "admin", + "functions": [ + { + "name": "search", "methods": [ { "name": "GET" },{ "name": "DELETE" }, { "name": "PUT" }, { "name": "POST" } ] + } + ], + + "users": [ + { + "username": "CN=ONAP, OU=ONAP, O=ONAP, L=Ottawa, ST=Ontario, C=CA" + } + ] + } + ] +} + diff --git a/kubernetes/aai/charts/champ/resources/config/appconfig/auth/tomcat_keystore b/kubernetes/aai/charts/champ/resources/config/appconfig/auth/tomcat_keystore Binary files differnew file mode 100644 index 0000000000..9eec841aa2 --- /dev/null +++ b/kubernetes/aai/charts/champ/resources/config/appconfig/auth/tomcat_keystore diff --git a/kubernetes/aai/charts/champ/resources/config/appconfig/champ-api.properties b/kubernetes/aai/charts/champ/resources/config/appconfig/champ-api.properties new file mode 100644 index 0000000000..3b90c5522f --- /dev/null +++ b/kubernetes/aai/charts/champ/resources/config/appconfig/champ-api.properties @@ -0,0 +1,6 @@ +keyName=aai-uuid +sourceOfTruthName=source-of-truth +createdTsName=aai-created-ts +lastModTsName=aai-last-mod-ts +collectionPropertiesKey=properties + diff --git a/kubernetes/aai/charts/champ/resources/config/dynamic/conf/champ-beans.xml b/kubernetes/aai/charts/champ/resources/config/dynamic/conf/champ-beans.xml new file mode 100644 index 0000000000..cdf3aada40 --- /dev/null +++ b/kubernetes/aai/charts/champ/resources/config/dynamic/conf/champ-beans.xml @@ -0,0 +1,62 @@ +<beans xmlns="http://www.springframework.org/schema/beans" +xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +xmlns:util="http://www.springframework.org/schema/util" +xsi:schemaLocation=" + http://www.springframework.org/schema/beans + http://www.springframework.org/schema/beans/spring-beans.xsd + http://www.springframework.org/schema/util + http://www.springframework.org/schema/util/spring-util.xsd + "> + + <!-- Event publisher to pass to the Champ library for logging raw graph + events (Kafka implementation). --> + <bean id="champEventPublisher" class="org.onap.aai.event.client.KafkaEventPublisher" > + <constructor-arg name="hosts" value="global-kafka.{{.Release.Namespace}}:9092" /> + <constructor-arg name="topic" value="champRawEvents" /> + </bean> + + <!-- Graph Implementation Configuration--> + <util:map id="props" map-class="java.util.HashMap" key-type="java.lang.String" value-type="java.lang.Object"> + <entry key="champcore.event.stream.buffer.capacity" value="50" value-type="java.lang.Integer"/> + <entry key="champcore.event.stream.publisher-pool-size" value="10" value-type="java.lang.Integer"/> + <entry key="champcore.event.stream.publisher" value-ref="champEventPublisher"/> + + <entry key="graph.name" value="aaigraph.dev"/> + <entry key="storage.backend" value="hbase"/> + <entry key="storage.hostname" value="hbase.{{.Release.Namespace}}"/> + + <!-- Hbase Config --> + <entry key="storage.hbase.ext.hbase.zookeeper.property.clientPort" value="2181"/> + <entry key="storage.hbase.ext.zookeeper.znode.parent" value="/hbase"/> + </util:map> + + <!-- Janus Implementation --> + <bean id="graphBuilder" class="org.onap.aai.champjanus.graph.impl.JanusChampGraphImpl$Builder"> + <constructor-arg value="aaigraph.dev"/> + <constructor-arg ref="props" /> + </bean> + + <bean id="graphImpl" class="org.onap.aai.champjanus.graph.impl.JanusChampGraphImpl"> + <constructor-arg ref="graphBuilder" /> + </bean> + + <bean id="champUUIDService" class="org.onap.champ.service.ChampUUIDService" > + <constructor-arg name="graphImpl" ref="graphImpl" /> + </bean> + + <bean id="cache" class="org.onap.champ.service.ChampTransactionCache" > + <constructor-arg name="txTimeOutInSec" value="600" /> + <constructor-arg name="graphImpl" ref="graphImpl" /> + </bean> + + <bean id="champDataService" class="org.onap.champ.service.ChampDataService" > + <constructor-arg name="champUUIDService" ref="champUUIDService" /> + <constructor-arg name="graphImpl" ref="graphImpl" /> + <constructor-arg name="cache" ref="cache" /> + </bean> + + <bean id="champRestService" class="org.onap.champ.ChampRESTAPI" > + <constructor-arg name="champDataService" ref="champDataService" /> + <constructor-arg name="champAsyncRequestProcessor"><null/></constructor-arg> + </bean> +</beans> diff --git a/kubernetes/aai/charts/champ/templates/configmap.yaml b/kubernetes/aai/charts/champ/templates/configmap.yaml new file mode 100644 index 0000000000..8f48f199f8 --- /dev/null +++ b/kubernetes/aai/charts/champ/templates/configmap.yaml @@ -0,0 +1,29 @@ +# Copyright © 2018 Amdocs, AT&T +# +# 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" . }}-configmap + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/appconfig/*").AsConfig . | indent 2 }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }}-dynamic-configmap + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/dynamic/conf/*").AsConfig . | indent 2 }} diff --git a/kubernetes/aai/charts/champ/templates/deployment.yaml b/kubernetes/aai/charts/champ/templates/deployment.yaml new file mode 100644 index 0000000000..a1a1d0ad06 --- /dev/null +++ b/kubernetes/aai/charts/champ/templates/deployment.yaml @@ -0,0 +1,108 @@ +# Copyright © 2018 Amdocs, AT&T +# +# 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: "{{ .Values.global.repository | default .Values.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 eq .Values.liveness.enabled true }} + 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: + - name: CONFIG_HOME + value: "/opt/app/champ-service/appconfig" + - name: GRAPHIMPL + value: "janus-deps" + - name: SERVICE_BEANS + value: "/opt/app/champ-service/dynamic/conf" + volumeMounts: + - mountPath: /etc/localtime + name: localtime + readOnly: true + - mountPath: /opt/app/champ-service/appconfig/champ-api.properties + name: {{ include "common.fullname" . }}-config + subPath: champ-api.properties + - mountPath: /opt/app/champ-service/appconfig/auth + name: {{ include "common.fullname" . }}-secrets + - mountPath: /opt/app/champ-service/dynamic/conf/champ-beans.xml + name: {{ include "common.fullname" . }}-dynamic-config + subPath: champ-beans.xml + - mountPath: /logs + name: {{ include "common.fullname" . }}-logs + 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 }} + + volumes: + - name: localtime + hostPath: + path: /etc/localtime + readOnly: true + - name: {{ include "common.fullname" . }}-config + configMap: + name: {{ include "common.fullname" . }}-configmap + items: + - key: champ-api.properties + path: champ-api.properties + - name: {{ include "common.fullname" . }}-secrets + secret: + secretName: {{ include "common.fullname" . }}-champ-secrets + - name: {{ include "common.fullname" . }}-dynamic-config + configMap: + name: {{ include "common.fullname" . }}-dynamic-configmap + items: + - key: champ-beans.xml + path: champ-beans.xml + - name: {{ include "common.fullname" . }}-logs + emptyDir: {} + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/kubernetes/aai/charts/champ/templates/secrets.yaml b/kubernetes/aai/charts/champ/templates/secrets.yaml new file mode 100644 index 0000000000..e939eb904b --- /dev/null +++ b/kubernetes/aai/charts/champ/templates/secrets.yaml @@ -0,0 +1,22 @@ +# Copyright © 2018 Amdocs, AT&T +# +# 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: Secret +metadata: + name: {{ include "common.fullname" . }}-champ-secrets + namespace: {{ include "common.namespace" . }} +type: Opaque +data: +{{ tpl (.Files.Glob "resources/config/appconfig/auth/*").AsSecrets . | indent 2 }} diff --git a/kubernetes/aai/charts/champ/templates/service.yaml b/kubernetes/aai/charts/champ/templates/service.yaml new file mode 100644 index 0000000000..93b0fd1254 --- /dev/null +++ b/kubernetes/aai/charts/champ/templates/service.yaml @@ -0,0 +1,39 @@ +# Copyright © 2018 Amdocs, AT&T +# +# 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.fullname" . }} + 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 }} + {{- else -}} + - port: {{ .Values.service.externalPort }} + targetPort: {{ .Values.service.internalPort }} + name: {{ .Values.service.name }} + {{- end}} + selector: + app: {{ include "common.name" . }} + release: {{ .Release.Name }} diff --git a/kubernetes/aai/charts/champ/values.yaml b/kubernetes/aai/charts/champ/values.yaml new file mode 100644 index 0000000000..91a1e52091 --- /dev/null +++ b/kubernetes/aai/charts/champ/values.yaml @@ -0,0 +1,58 @@ +# Copyright © 2018 Amdocs, AT&T +# +# 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. + +################################################################# +# Global configuration defaults. +################################################################# +global: + readinessImage: readiness-check:1.0.0 + loggingImage: beats/filebeat:5.5.0 + +################################################################# +# Application configuration defaults. +################################################################# + +# application image +image: onap/champ:1.2.0 + +# 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: false + +readiness: + initialDelaySeconds: 10 + periodSeconds: 10 + +service: + type: NodePort + name: champ + externalPort: 78 + internalPort: 9522 + nodePort: 78 + +ingress: + enabled: false + +resources: {} diff --git a/kubernetes/aai/charts/gizmo/.helmignore b/kubernetes/aai/charts/gizmo/.helmignore new file mode 100644 index 0000000000..f0c1319444 --- /dev/null +++ b/kubernetes/aai/charts/gizmo/.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/gizmo/Chart.yaml b/kubernetes/aai/charts/gizmo/Chart.yaml new file mode 100644 index 0000000000..4633b06dff --- /dev/null +++ b/kubernetes/aai/charts/gizmo/Chart.yaml @@ -0,0 +1,18 @@ +# Copyright © 2018 Amdocs, AT&T +# +# 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 +description: Gizmo service +name: gizmo +version: 2.0.0
\ No newline at end of file diff --git a/kubernetes/aai/charts/gizmo/resources/config/README.txt b/kubernetes/aai/charts/gizmo/resources/config/README.txt new file mode 100644 index 0000000000..5cc01497f5 --- /dev/null +++ b/kubernetes/aai/charts/gizmo/resources/config/README.txt @@ -0,0 +1,10 @@ +This directory contains all external configuration files that +need to be mounted into an application container. + +See the configmap.yaml in the templates directory for an example +of how to load (ie map) config files from this directory, into +Kubernetes, for distribution within the k8s cluster. + +See deployment.yaml in the templates directory for an example +of how the 'config mapped' files are then mounted into the +containers. diff --git a/kubernetes/aai/charts/gizmo/resources/config/auth/champ-cert.p12 b/kubernetes/aai/charts/gizmo/resources/config/auth/champ-cert.p12 Binary files differnew file mode 100644 index 0000000000..dbf4fcacec --- /dev/null +++ b/kubernetes/aai/charts/gizmo/resources/config/auth/champ-cert.p12 diff --git a/kubernetes/aai/charts/gizmo/resources/config/auth/crud_policy.json b/kubernetes/aai/charts/gizmo/resources/config/auth/crud_policy.json new file mode 100644 index 0000000000..d8b065e7f6 --- /dev/null +++ b/kubernetes/aai/charts/gizmo/resources/config/auth/crud_policy.json @@ -0,0 +1,18 @@ +{ + "roles": [ + { + "name": "admin", + "functions": [ + { + "name": "crud", "methods": [ { "name": "GET" },{ "name": "DELETE" }, { "name": "PUT" }, { "name": "POST" }, { "name": "PATCH"} ] + } + ], + + "users": [ + { + "username": "CN=ONAP, OU=ONAP, O=ONAP, L=Ottawa, ST=Ontario, C=CA" + } + ] + } + ] +}
\ No newline at end of file diff --git a/kubernetes/aai/charts/gizmo/resources/config/auth/datarouter-cert.p12 b/kubernetes/aai/charts/gizmo/resources/config/auth/datarouter-cert.p12 Binary files differnew file mode 100644 index 0000000000..dbf4fcacec --- /dev/null +++ b/kubernetes/aai/charts/gizmo/resources/config/auth/datarouter-cert.p12 diff --git a/kubernetes/aai/charts/gizmo/resources/config/auth/tomcat_keystore b/kubernetes/aai/charts/gizmo/resources/config/auth/tomcat_keystore Binary files differnew file mode 100644 index 0000000000..9eec841aa2 --- /dev/null +++ b/kubernetes/aai/charts/gizmo/resources/config/auth/tomcat_keystore diff --git a/kubernetes/aai/charts/gizmo/resources/config/crud-api.properties b/kubernetes/aai/charts/gizmo/resources/config/crud-api.properties new file mode 100644 index 0000000000..a86d47203a --- /dev/null +++ b/kubernetes/aai/charts/gizmo/resources/config/crud-api.properties @@ -0,0 +1,5 @@ +# CRUD-API configuration + +crud.async.request.timeout=60000 +crud.async.response.process.poll.interval=1000 +crud.collection.properties.key=properties diff --git a/kubernetes/aai/charts/gizmo/resources/config/crud-beans.xml b/kubernetes/aai/charts/gizmo/resources/config/crud-beans.xml new file mode 100644 index 0000000000..04f1210433 --- /dev/null +++ b/kubernetes/aai/charts/gizmo/resources/config/crud-beans.xml @@ -0,0 +1,35 @@ +<beans xmlns="http://www.springframework.org/schema/beans" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:util="http://www.springframework.org/schema/util" + xsi:schemaLocation=" + http://www.springframework.org/schema/beans + http://www.springframework.org/schema/beans/spring-beans.xsd + http://www.springframework.org/schema/util + http://www.springframework.org/schema/util/spring-util.xsd + "> + + <bean id="champDao" class="org.onap.crud.dao.champ.ChampDao"> + <constructor-arg name="champUrl" value="https://{{.Release.Name}}-champ.{{.Release.Namespace}}:9522/services/champ-service/v1/"/> + <constructor-arg name="certPassword" value="OBF:1y0q1uvc1uum1uvg1pil1pjl1uuq1uvk1uuu1y10"/> + </bean> + + <bean id="dataRouterDAO" class="org.onap.crud.dao.DataRouterDAO"> + <constructor-arg name="url" value="https://data-router.{{.Release.Namespace}}:9502/services/champ-service/v1/"/> + <constructor-arg name="certPassword" value="OBF:1y0q1uvc1uum1uvg1pil1pjl1uuq1uvk1uuu1y10"/> + </bean> + + <!-- Synchronous Mode --> + <bean id="graphDataService" class="org.onap.crud.service.CrudGraphDataService" > + <constructor-arg name="dao" ref="champDao" /> + <constructor-arg name="daoForGet" ref="champDao" /> <!-- Using champ for both types of API for now --> + </bean> + + <bean id="crudRestService" class="org.onap.crud.service.CrudRestService" init-method="startup" > + <constructor-arg name="graphDataService" ref="graphDataService" /> + </bean> + + <bean id="aaiResourceService" class="org.onap.crud.service.AaiResourceService" init-method="startup" > + <constructor-arg name="graphDataService" ref="graphDataService" /> + </bean> + +</beans>
\ No newline at end of file diff --git a/kubernetes/aai/charts/gizmo/resources/config/log/filebeat/filebeat.yml b/kubernetes/aai/charts/gizmo/resources/config/log/filebeat/filebeat.yml new file mode 100644 index 0000000000..9ad559c027 --- /dev/null +++ b/kubernetes/aai/charts/gizmo/resources/config/log/filebeat/filebeat.yml @@ -0,0 +1,41 @@ +filebeat.prospectors: +#it is mandatory, in our case it's log +- input_type: log + #This is the canolical path as mentioned in logback.xml, *.* means it will monitor all files in the directory. + paths: + - /var/log/onap/*/*/*/*.log + - /var/log/onap/*/*/*.log + - /var/log/onap/*/*.log + #Files older than this should be ignored.In our case it will be 48 hours i.e. 2 days. It is a helping flag for clean_inactive + ignore_older: 48h + # Remove the registry entry for a file that is more than the specified time. In our case it will be 96 hours, i.e. 4 days. It will help to keep registry records with in limit + clean_inactive: 96h + + +# Name of the registry file. If a relative path is used, it is considered relative to the +# data path. Else full qualified file name. +#filebeat.registry_file: ${path.data}/registry + + +output.logstash: + #List of logstash server ip addresses with port number. + #But, in our case, this will be the loadbalancer IP address. + #For the below property to work the loadbalancer or logstash should expose 5044 port to listen the filebeat events or port in the property should be changed appropriately. + hosts: ["logstash.{{ .Release.Name }}-log:5044"] + #If enable will do load balancing among availabe Logstash, automatically. + loadbalance: true + + #The list of root certificates for server verifications. + #If certificate_authorities is empty or not set, the trusted + #certificate authorities of the host system are used. + #ssl.certificate_authorities: $ssl.certificate_authorities + + #The path to the certificate for SSL client authentication. If the certificate is not specified, + #client authentication is not available. + #ssl.certificate: $ssl.certificate + + #The client certificate key used for client authentication. + #ssl.key: $ssl.key + + #The passphrase used to decrypt an encrypted key stored in the configured key file + #ssl.key_passphrase: $ssl.key_passphrase diff --git a/kubernetes/aai/charts/gizmo/resources/config/log/logback.xml b/kubernetes/aai/charts/gizmo/resources/config/log/logback.xml new file mode 100644 index 0000000000..f63afd3c6b --- /dev/null +++ b/kubernetes/aai/charts/gizmo/resources/config/log/logback.xml @@ -0,0 +1,213 @@ +<?xml version="1.0" encoding="UTF-8"?> +<configuration scan="true" scanPeriod="3 seconds" debug="true"> + <!--<jmxConfigurator /> --> + <!-- directory path for all other type logs --> + <property name="logDir" value="/var/log/onap" /> + <property name="componentName" value="aai" /> + <property name="subComponentName" value="aai-CRUD" /> + <property name="logDirectory" value="${logDir}/${componentName}/${subComponentName}" /> + <!-- default eelf log file names --> + <property name="generalLogName" value="application" /> + <property name="errorLogName" value="error" /> + <property name="metricsLogName" value="metrics" /> + <property name="auditLogName" value="audit" /> + <property name="debugLogName" value="debug" /> + <property name="queueSize" value="256" /> + <property name="maxFileSize" value="50MB" /> + <property name="maxHistory" value="30" /> + <property name="totalSizeCap" value="10GB" /> + <property name="pattern" value="%d{"yyyy-MM-dd'T'HH:mm:ss.SSSXXX", UTC}\t[%thread]\t%-5level\t%logger\t%replace(%replace(%replace(%mdc){'\t','\\\\t'}){', ','\t'}){'\n', '\\\\n'}\t%replace(%replace(%msg){'\n', '\\\\n'}){'\t','\\\\t'}%n" /> + <!-- Example evaluator filter applied against console appender --> + <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> + <encoder> + <pattern>${pattern}</pattern> + </encoder> + </appender> + <!-- ============================================================================ --> + <!-- EELF Appenders --> + <!-- ============================================================================ --> + <!-- The EELFAppender is used to record events to the general application + log --> + <appender name="EELF" class="ch.qos.logback.core.rolling.RollingFileAppender"> + <file>${logDirectory}/${generalLogName}.log</file> + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> + <fileNamePattern>${logDirectory}/${generalLogName}.%d{yyyy-MM-dd}.%i.log</fileNamePattern> + <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> + <maxFileSize>${maxFileSize}</maxFileSize> + </timeBasedFileNamingAndTriggeringPolicy> + <maxHistory>${maxHistory}</maxHistory> + <totalSizeCap>${totalSizeCap}</totalSizeCap> + </rollingPolicy> + <encoder> + <pattern>${pattern}</pattern> + </encoder> + </appender> + <appender name="asyncEELF" class="ch.qos.logback.classic.AsyncAppender"> + <!-- deny all events with a level below INFO, that is TRACE and DEBUG --> + <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> + <level>INFO</level> + </filter> + <queueSize>${queueSize}</queueSize> + <appender-ref ref="EELF" /> + </appender> + <!-- EELF Audit Appender. This appender is used to record audit engine + related logging events. The audit logger and appender are specializations + of the EELF application root logger and appender. This can be used to segregate + Policy engine events from other components, or it can be eliminated to record + these events as part of the application root log. --> + <appender name="EELFAudit" class="ch.qos.logback.core.rolling.RollingFileAppender"> + <file>${logDirectory}/${auditLogName}.log</file> + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> + <fileNamePattern>${logDirectory}/${auditLogName}.%d{yyyy-MM-dd}.%i.log</fileNamePattern> + <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> + <maxFileSize>${maxFileSize}</maxFileSize> + </timeBasedFileNamingAndTriggeringPolicy> + <maxHistory>${maxHistory}</maxHistory> + <totalSizeCap>${totalSizeCap}</totalSizeCap> + </rollingPolicy> + <encoder> + <pattern>${pattern}</pattern> + </encoder> + </appender> + <appender name="asyncEELFAudit" class="ch.qos.logback.classic.AsyncAppender"> + <queueSize>${queueSize}</queueSize> + <appender-ref ref="EELFAudit" /> + </appender> + <appender name="EELFMetrics" class="ch.qos.logback.core.rolling.RollingFileAppender"> + <file>${logDirectory}/${metricsLogName}.log</file> + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> + <fileNamePattern>${logDirectory}/${metricsLogName}.%d{yyyy-MM-dd}.%i.log</fileNamePattern> + <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> + <maxFileSize>${maxFileSize}</maxFileSize> + </timeBasedFileNamingAndTriggeringPolicy> + <maxHistory>${maxHistory}</maxHistory> + <totalSizeCap>${totalSizeCap}</totalSizeCap> + </rollingPolicy> + <encoder> + <pattern>${pattern}</pattern> + </encoder> + </appender> + <appender name="asyncEELFMetrics" class="ch.qos.logback.classic.AsyncAppender"> + <queueSize>${queueSize}</queueSize> + <appender-ref ref="EELFMetrics" /> + </appender> + <appender name="EELFError" class="ch.qos.logback.core.rolling.RollingFileAppender"> + <file>${logDirectory}/${errorLogName}.log</file> + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> + <fileNamePattern>${logDirectory}/${errorLogName}.%d{yyyy-MM-dd}.%i.log</fileNamePattern> + <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> + <maxFileSize>${maxFileSize}</maxFileSize> + </timeBasedFileNamingAndTriggeringPolicy> + <maxHistory>${maxHistory}</maxHistory> + <totalSizeCap>${totalSizeCap}</totalSizeCap> + </rollingPolicy> + <encoder> + <pattern>${pattern}</pattern> + </encoder> + <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> + <level>INFO</level> + </filter> + </appender> + <appender name="asyncEELFError" class="ch.qos.logback.classic.AsyncAppender"> + <queueSize>${queueSize}</queueSize> + <appender-ref ref="EELFError" /> + </appender> + <appender name="EELFDebug" class="ch.qos.logback.core.rolling.RollingFileAppender"> + <file>${logDirectory}/${debugLogName}.log</file> + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> + <fileNamePattern>${logDirectory}/${debugLogName}.%d{yyyy-MM-dd}.%i.log</fileNamePattern> + <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> + <maxFileSize>${maxFileSize}</maxFileSize> + </timeBasedFileNamingAndTriggeringPolicy> + <maxHistory>${maxHistory}</maxHistory> + <totalSizeCap>${totalSizeCap}</totalSizeCap> + </rollingPolicy> + <encoder> + <pattern>${pattern}</pattern> + </encoder> + </appender> + <appender name="asyncEELFDebug" class="ch.qos.logback.classic.AsyncAppender"> + <queueSize>${queueSize}</queueSize> + <appender-ref ref="EELFDebug" /> + <includeCallerData>true</includeCallerData> + </appender> + <!-- ============================================================================ --> + <!-- EELF loggers --> + <!-- ============================================================================ --> + <logger name="com.att.eelf" level="info" additivity="false"> + <appender-ref ref="asyncEELF" /> + </logger> + <logger name="com.att.eelf.security" level="info" additivity="false"> + <appender-ref ref="asyncEELFSecurity" /> + </logger> + <logger name="com.att.eelf.perf" level="info" additivity="false"> + <appender-ref ref="asyncEELFPerformance" /> + </logger> + <logger name="com.att.eelf.server" level="info" additivity="false"> + <appender-ref ref="asyncEELFServer" /> + </logger> + <logger name="com.att.eelf.policy" level="info" additivity="false"> + <appender-ref ref="asyncEELFPolicy" /> + </logger> + <logger name="com.att.eelf.debug" level="debug" additivity="false"> + <appender-ref ref="asyncEELFDebug" /> + </logger> + <logger name="com.att.eelf.audit" level="info" additivity="false"> + <appender-ref ref="asyncEELFAudit" /> + </logger> + <logger name="com.att.eelf.metrics" level="info" additivity="false"> + <appender-ref ref="asyncEELFMetrics" /> + </logger> + <logger name="com.att.eelf.error" level="info" additivity="false"> + <appender-ref ref="asyncEELFError" /> + </logger> + <!-- Spring related loggers --> + <logger name="org.springframework" level="WARN" /> + <logger name="org.springframework.beans" level="WARN" /> + <logger name="org.springframework.web" level="WARN" /> + <logger name="com.blog.spring.jms" level="WARN" /> + <!-- AJSC Services (bootstrap services) --> + <logger name="ajsc" level="WARN" /> + <logger name="ajsc.RouteMgmtService" level="WARN" /> + <logger name="ajsc.ComputeService" level="WARN" /> + <logger name="ajsc.VandelayService" level="WARN" /> + <logger name="ajsc.FilePersistenceService" level="WARN" /> + <logger name="ajsc.UserDefinedJarService" level="WARN" /> + <logger name="ajsc.UserDefinedBeansDefService" level="WARN" /> + <logger name="ajsc.LoggingConfigurationService" level="WARN" /> + <!-- AJSC related loggers (DME2 Registration, csi logging, restlet, servlet + logging) --> + <logger name="ajsc.utils" level="WARN" /> + <logger name="ajsc.utils.DME2Helper" level="WARN" /> + <logger name="ajsc.filters" level="WARN" /> + <logger name="ajsc.beans.interceptors" level="WARN" /> + <logger name="ajsc.restlet" level="WARN" /> + <logger name="ajsc.servlet" level="WARN" /> + <logger name="com.att" level="INFO" /> + <logger name="com.att.ajsc.csi.logging" level="WARN" /> + <logger name="com.att.ajsc.filemonitor" level="WARN" /> + <!-- CRUD Service loggers --> + <logger name="org.openecomp.crud" level="INFO" /> + <!-- Other Loggers that may help troubleshoot --> + <logger name="net.sf" level="WARN" /> + <logger name="org.apache" level="WARN" /> + <logger name="org.apache.commons.httpclient" level="WARN" /> + <logger name="org.apache.commons" level="WARN" /> + <logger name="org.apache.coyote" level="WARN" /> + <logger name="org.apache.jasper" level="WARN" /> + <!-- Camel Related Loggers (including restlet/servlet/jaxrs/cxf logging. + May aid in troubleshooting) --> + <logger name="org.apache.camel" level="WARN" /> + <logger name="org.apache.cxf" level="WARN" /> + <logger name="org.apache.camel.processor.interceptor" level="WARN" /> + <logger name="org.apache.cxf.jaxrs.interceptor" level="WARN" /> + <logger name="org.apache.cxf.service" level="WARN" /> + <logger name="org.restlet" level="WARN" /> + <logger name="org.apache.camel.component.restlet" level="WARN" /> + <!-- logback internals logging --> + <logger name="ch.qos.logback.classic" level="WARN" /> + <logger name="ch.qos.logback.core" level="WARN" /> + <root level="INFO"> + <appender-ref ref="asyncEELFDebug" /> + </root> +</configuration> diff --git a/kubernetes/aai/charts/gizmo/resources/config/model/edge_properties_v11.json b/kubernetes/aai/charts/gizmo/resources/config/model/edge_properties_v11.json new file mode 100644 index 0000000000..8d00636d27 --- /dev/null +++ b/kubernetes/aai/charts/gizmo/resources/config/model/edge_properties_v11.json @@ -0,0 +1,6 @@ +{ + "contains-other-v": "java.lang.String", + "delete-other-v": "java.lang.String", + "SVC-INFRA": "java.lang.String", + "prevent-delete": "java.lang.String" +}
\ No newline at end of file diff --git a/kubernetes/aai/charts/gizmo/resources/config/model/edge_properties_v12.json b/kubernetes/aai/charts/gizmo/resources/config/model/edge_properties_v12.json new file mode 100644 index 0000000000..8d00636d27 --- /dev/null +++ b/kubernetes/aai/charts/gizmo/resources/config/model/edge_properties_v12.json @@ -0,0 +1,6 @@ +{ + "contains-other-v": "java.lang.String", + "delete-other-v": "java.lang.String", + "SVC-INFRA": "java.lang.String", + "prevent-delete": "java.lang.String" +}
\ No newline at end of file diff --git a/kubernetes/aai/charts/gizmo/resources/config/model/edge_properties_v13.json b/kubernetes/aai/charts/gizmo/resources/config/model/edge_properties_v13.json new file mode 100644 index 0000000000..8d00636d27 --- /dev/null +++ b/kubernetes/aai/charts/gizmo/resources/config/model/edge_properties_v13.json @@ -0,0 +1,6 @@ +{ + "contains-other-v": "java.lang.String", + "delete-other-v": "java.lang.String", + "SVC-INFRA": "java.lang.String", + "prevent-delete": "java.lang.String" +}
\ No newline at end of file diff --git a/kubernetes/aai/charts/gizmo/templates/NOTES.txt b/kubernetes/aai/charts/gizmo/templates/NOTES.txt new file mode 100644 index 0000000000..24371d08ab --- /dev/null +++ b/kubernetes/aai/charts/gizmo/templates/NOTES.txt @@ -0,0 +1,19 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range .Values.ingress.hosts }} + http://{{ . }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "common.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get svc -w {{ include "common.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "common.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') + echo http://$SERVICE_IP:{{ .Values.service.externalPort }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "so.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl port-forward $POD_NAME 8080:{{ .Values.service.internalPort }} +{{- end }} diff --git a/kubernetes/aai/charts/gizmo/templates/configmap.yaml b/kubernetes/aai/charts/gizmo/templates/configmap.yaml new file mode 100644 index 0000000000..b988d31fd9 --- /dev/null +++ b/kubernetes/aai/charts/gizmo/templates/configmap.yaml @@ -0,0 +1,45 @@ +# Copyright © 2018 Amdocs, AT&T +# +# 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" . }}-configmap + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/*").AsConfig . | indent 2 }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }}-model-configmap + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/model/*").AsConfig . | indent 2 }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }}-log-configmap + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/log/*").AsConfig . | indent 2 }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }}-filebeat-configmap + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/log/filebeat/*").AsConfig . | indent 2 }}
\ No newline at end of file diff --git a/kubernetes/aai/charts/gizmo/templates/deployment.yaml b/kubernetes/aai/charts/gizmo/templates/deployment.yaml new file mode 100644 index 0000000000..768c28b161 --- /dev/null +++ b/kubernetes/aai/charts/gizmo/templates/deployment.yaml @@ -0,0 +1,143 @@ +# Copyright © 2018 Amdocs, AT&T +# +# 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: {{ .Chart.Name }} + image: "{{ .Values.global.repository | default .Values.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 eq .Values.liveness.enabled true }} + 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: + - name: CONFIG_HOME + value: /opt/app/crud-service/config/ + - name: KEY_STORE_PASSWORD + valueFrom: + secretKeyRef: + name: {{ template "common.fullname" . }}-pass + key: KEY_STORE_PASSWORD + - name: KEY_MANAGER_PASSWORD + valueFrom: + secretKeyRef: + name: {{ template "common.fullname" . }}-pass + key: KEY_MANAGER_PASSWORD + - name: SERVICE_BEANS + value: /opt/app/crud-service/dynamic/conf + volumeMounts: + - mountPath: /etc/localtime + name: localtime + readOnly: true + - mountPath: /opt/app/crud-service/config/crud-api.properties + subPath: crud-api.properties + name: {{ include "common.fullname" . }}-config + - mountPath: /opt/app/crud-service/config/model/ + name: {{ include "common.fullname" . }}-model-config + - mountPath: /opt/app/crud-service/config/auth + name: {{ include "common.fullname" . }}-auth-secret + - mountPath: /opt/app/crud-service/dynamic/conf/crud-beans.xml + name: {{ include "common.fullname" . }}-config + subPath: crud-beans.xml + - mountPath: /var/log/onap + name: {{ include "common.fullname" . }}-logs + - mountPath: /opt/app/crud-api/bundleconfig/etc/logback.xml + name: {{ include "common.fullname" . }}-logback-config + subPath: logback.xml + 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 }} + + - name: filebeat-onap + image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + volumeMounts: + - mountPath: /usr/share/filebeat/filebeat.yml + name: filebeat-conf + subPath: filebeat.yml + - mountPath: /var/log/onap + name: {{ include "common.fullname" . }}-logs + - mountPath: /usr/share/filebeat/data + name: {{ include "common.fullname" . }}-data-filebeat + + volumes: + - name: localtime + hostPath: + path: /etc/localtime + readOnly: true + - name: {{ include "common.fullname" . }}-data-filebeat + emptyDir: {} + - name: filebeat-conf + configMap: + name: {{ include "common.fullname" . }}-filebeat-configmap + - name: {{ include "common.fullname" . }}-logs + emptyDir: {} + - name: {{ include "common.fullname" . }}-auth-secret + secret: + secretName: {{ include "common.fullname" . }}-auth + - name: {{ include "common.fullname" . }}-config + configMap: + name: {{ include "common.fullname" . }}-configmap + items: + - key: crud-api.properties + path: crud-api.properties + - key: crud-beans.xml + path: crud-beans.xml + - name: {{ include "common.fullname" . }}-logback-config + configMap: + name: {{ include "common.fullname" . }}-log-configmap + items: + - key: logback.xml + path: logback.xml + - name: {{ include "common.fullname" . }}-model-config + configMap: + name: {{ include "common.fullname" . }}-model-configmap + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-docker-registry-key"
\ No newline at end of file diff --git a/kubernetes/aai/charts/gizmo/templates/secrets.yaml b/kubernetes/aai/charts/gizmo/templates/secrets.yaml new file mode 100644 index 0000000000..f5d8ec8ba5 --- /dev/null +++ b/kubernetes/aai/charts/gizmo/templates/secrets.yaml @@ -0,0 +1,41 @@ +# Copyright © 2018 Amdocs, AT&T +# +# 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: Secret +metadata: + name: {{ include "common.fullname" . }}-auth + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +data: +{{ (.Files.Glob "resources/config/auth/*").AsSecrets | indent 2 }} +--- +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "common.fullname" . }}-pass + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +type: Opaque +data: + KEY_STORE_PASSWORD: {{ .Values.config.keyStorePassword | b64enc | quote }} + KEY_MANAGER_PASSWORD: {{ .Values.config.keyManagerPassword | b64enc | quote }}
\ No newline at end of file diff --git a/kubernetes/aai/charts/gizmo/templates/service.yaml b/kubernetes/aai/charts/gizmo/templates/service.yaml new file mode 100644 index 0000000000..f88a4e9533 --- /dev/null +++ b/kubernetes/aai/charts/gizmo/templates/service.yaml @@ -0,0 +1,40 @@ +# Copyright © 2018 Amdocs, AT&T +# +# 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.fullname" . }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + annotations: +spec: + type: {{ .Values.service.type }} + ports: + {{if eq .Values.service.type "NodePort" -}} + - port: {{ .Values.service.internalPort }} + nodePort: {{ .Values.global.nodePortPrefix | default "302" }}{{ .Values.service.nodePort }} + name: {{ .Values.service.name }} + {{- else -}} + - port: {{ .Values.service.externalPort }} + targetPort: {{ .Values.service.internalPort }} + name: {{ .Values.service.name }} + {{- end}} + selector: + app: {{ include "common.name" . }} + release: {{ .Release.Name }}
\ No newline at end of file diff --git a/kubernetes/aai/charts/gizmo/values.yaml b/kubernetes/aai/charts/gizmo/values.yaml new file mode 100644 index 0000000000..de842859fe --- /dev/null +++ b/kubernetes/aai/charts/gizmo/values.yaml @@ -0,0 +1,60 @@ +# Copyright © 2018 Amdocs, AT&T +# +# 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. + +################################################################# +global: + nodePortPrefix: 302 + loggingImage: beats/filebeat:5.5.0 + +################################################################# +# Application configuration defaults. +################################################################# + +# application image +image: "onap/gizmo:1.1-STAGING-latest" + +# application configuration +config: + keyStorePassword: OBF:1y0q1uvc1uum1uvg1pil1pjl1uuq1uvk1uuu1y10 + keyManagerPassword: OBF:1y0q1uvc1uum1uvg1pil1pjl1uuq1uvk1uuu1y10 + +# 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: crud-service + internalPort: 9520 + nodePort: 66 + +ingress: + enabled: false + +resources: {}
\ No newline at end of file diff --git a/kubernetes/esr/.helmignore b/kubernetes/esr/.helmignore new file mode 100644 index 0000000000..f0c1319444 --- /dev/null +++ b/kubernetes/esr/.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/esr/Chart.yaml b/kubernetes/esr/Chart.yaml index a80e6995b3..b47761d605 100644 --- a/kubernetes/esr/Chart.yaml +++ b/kubernetes/esr/Chart.yaml @@ -13,6 +13,6 @@ # limitations under the License. apiVersion: v1 -description: A Helm chart for Kubernetes +description: ONAP External System Register name: esr -version: 1.0.0 +version: 2.0.0 diff --git a/kubernetes/esr/charts/esr-gui/.helmignore b/kubernetes/esr/charts/esr-gui/.helmignore new file mode 100644 index 0000000000..f0c1319444 --- /dev/null +++ b/kubernetes/esr/charts/esr-gui/.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/esr/templates/esr-filebeat-configmap.yaml b/kubernetes/esr/charts/esr-gui/Chart.yaml index 5f9ee9c217..ae53f85857 100644 --- a/kubernetes/esr/templates/esr-filebeat-configmap.yaml +++ b/kubernetes/esr/charts/esr-gui/Chart.yaml @@ -12,12 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -#{{ if not .Values.disableAaiAaiResources }} apiVersion: v1 -kind: ConfigMap -metadata: - name: esr-filebeat-configmap - namespace: {{ .Values.nsPrefix }} -data: -{{ tpl (.Files.Glob "resources/config/log/filebeat/*").AsConfig . | indent 2 }} -#{{ end }} +description: ONAP External System Register GUI +name: esr-gui +version: 2.0.0 diff --git a/kubernetes/esr/charts/esr-gui/templates/NOTES.txt b/kubernetes/esr/charts/esr-gui/templates/NOTES.txt new file mode 100644 index 0000000000..dde49c1439 --- /dev/null +++ b/kubernetes/esr/charts/esr-gui/templates/NOTES.txt @@ -0,0 +1,16 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range .Values.ingress.hosts }} + http://{{ . }} +{{- end }} + export NODE_PORT=$(kubectl get --namespace {{ include "common.namespace" . }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "common.name" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ include "common.namespace" . }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get svc -w {{ include "common.name" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ include "common.namespace" . }} {{ include "common.name" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') + echo http://$SERVICE_IP:{{ .Values.service.externalPort }} + export POD_NAME=$(kubectl get pods --namespace {{ include "common.namespace" . }} -l "app={{ .Chart.Name }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl port-forward $POD_NAME 8080:{{ .Values.service.internalPort }} +{{- end }} diff --git a/kubernetes/esr/charts/esr-gui/templates/deployment.yaml b/kubernetes/esr/charts/esr-gui/templates/deployment.yaml new file mode 100644 index 0000000000..747df228c3 --- /dev/null +++ b/kubernetes/esr/charts/esr-gui/templates/deployment.yaml @@ -0,0 +1,67 @@ +# 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 }} + template: + metadata: + labels: + app: {{ include "common.name" . }} + release: {{ .Release.Name }} + spec: + containers: + - name: {{ include "common.name" . }} + image: {{ .Values.global.repository | default .Values.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 eq .Values.liveness.enabled true }} + 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: + - name: MSB_ADDR + value: {{ tpl .Values.msbaddr . }} + 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 }} + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/kubernetes/esr/charts/esr-gui/templates/service.yaml b/kubernetes/esr/charts/esr-gui/templates/service.yaml new file mode 100644 index 0000000000..6a274b50d4 --- /dev/null +++ b/kubernetes/esr/charts/esr-gui/templates/service.yaml @@ -0,0 +1,42 @@ +# 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: v1 +kind: Service +metadata: + name: {{ .Values.service.name }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + annotations: + msb.onap.org/service-info: '[ + { + "serviceName": "aai-esr-gui", + "version": "v1", + "url": "/esr-gui", + "protocol": "UI", + "port": "{{ .Values.service.internalPort }}", + "visualRange":"1" + } + ]' +spec: + ports: + - port: {{ .Values.service.internalPort }} + name: {{ .Values.service.name }} + selector: + app: {{ include "common.name" . }} + release: {{ .Release.Name }} diff --git a/kubernetes/esr/charts/esr-gui/values.yaml b/kubernetes/esr/charts/esr-gui/values.yaml new file mode 100644 index 0000000000..f5013995c2 --- /dev/null +++ b/kubernetes/esr/charts/esr-gui/values.yaml @@ -0,0 +1,74 @@ +# 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. + +################################################################# +# Global configuration defaults. +################################################################# +global: + nodePortPrefix: 302 + repositorySecret: eyJuZXh1czMub25hcC5vcmc6MTAwMDEiOnsidXNlcm5hbWUiOiJkb2NrZXIiLCJwYXNzd29yZCI6ImRvY2tlciIsImVtYWlsIjoiQCIsImF1dGgiOiJaRzlqYTJWeU9tUnZZMnRsY2c9PSJ9fQ== + persistence: {} +################################################################# +# Application configuration defaults. +################################################################# +# application image +repository: nexus3.onap.org:10001 +image: onap/aai/esr-gui:v1.0.0 +pullPolicy: Always +msbaddr: msb-iag.{{ include "common.namespace" . }}:80 + +# 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: + name: esr-gui + internalPort: 8080 + +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 diff --git a/kubernetes/esr/templates/esr-server-log-configmap.yaml b/kubernetes/esr/requirements.yaml index 5a3ddf2c2a..f639633537 100644 --- a/kubernetes/esr/templates/esr-server-log-configmap.yaml +++ b/kubernetes/esr/requirements.yaml @@ -12,12 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -#{{ if not .Values.disableAaiAaiResources }} -apiVersion: v1 -kind: ConfigMap -metadata: - name: esr-esrserver-log-configmap - namespace: {{ .Values.nsPrefix }} -data: -{{ tpl (.Files.Glob "resources/config/log/esrserver/logback.xml").AsConfig . | indent 2 }} -#{{ end }} +dependencies: + - name: common + version: ~2.0.0 + # local reference to common chart, as it is + # a part of this chart's package and will not + # be published independently to a repo (at this point) + repository: '@local' diff --git a/kubernetes/esr/templates/NOTES.txt b/kubernetes/esr/templates/NOTES.txt new file mode 100644 index 0000000000..c1c46b126c --- /dev/null +++ b/kubernetes/esr/templates/NOTES.txt @@ -0,0 +1,13 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range .Values.ingress.hosts }} + http://{{ . }} +{{- end }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get svc -w {{ include "common.name" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ include "common.namespace" . }} {{ include "common.name" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') + echo http://$SERVICE_IP:{{ .Values.service.externalPort }} + export POD_NAME=$(kubectl get pods --namespace {{ include "common.namespace" . }} -l "app={{ .Chart.Name }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl port-forward $POD_NAME 8080:{{ .Values.service.internalPort }} +{{- end }} diff --git a/kubernetes/esr/templates/configmap.yaml b/kubernetes/esr/templates/configmap.yaml new file mode 100644 index 0000000000..a0c82bee55 --- /dev/null +++ b/kubernetes/esr/templates/configmap.yaml @@ -0,0 +1,30 @@ +# 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: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }}-esr-filebeat + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/log/filebeat/*").AsConfig . | indent 2 }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }}-esr-esrserver-log + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/log/esrserver/logback.xml").AsConfig . | indent 2 }} + diff --git a/kubernetes/esr/templates/deployment.yaml b/kubernetes/esr/templates/deployment.yaml new file mode 100644 index 0000000000..c2322d31ee --- /dev/null +++ b/kubernetes/esr/templates/deployment.yaml @@ -0,0 +1,99 @@ +# 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 }} + template: + metadata: + labels: + app: {{ include "common.name" . }} + release: {{ .Release.Name }} + spec: + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.global.repository | default .Values.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 eq .Values.liveness.enabled true }} + 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: + - name: MSB_ADDR + value: {{ tpl .Values.msbaddr . }} + volumeMounts: + - mountPath: /etc/localtime + name: localtime + readOnly: true + - mountPath: /home/esr/works/logs + name: esr-server-logs + 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 }} + # 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 + name: filebeat-conf + subPath: filebeat.yml + - mountPath: /home/esr/works/logs + name: esr-server-logs + - mountPath: /usr/share/filebeat/data + name: esr-server-filebeat + volumes: + - name: localtime + hostPath: + path: /etc/localtime + - name: filebeat-conf + configMap: + name: {{ include "common.fullname" . }}-esr-filebeat + - name: esr-server-logs + emptyDir: {} + - name: esr-server-filebeat + emptyDir: {} + - name: esrserver-log + configMap: + name: {{ include "common.fullname" . }}-esr-esrserver-log + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/kubernetes/esr/templates/esr-esrgui-deployment.yaml b/kubernetes/esr/templates/esr-esrgui-deployment.yaml deleted file mode 100644 index 92e26dceb0..0000000000 --- a/kubernetes/esr/templates/esr-esrgui-deployment.yaml +++ /dev/null @@ -1,49 +0,0 @@ -# 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. - -#{{ if not .Values.disableesrgui }} -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - labels: - app: esr-esrgui - name: esr-esrgui - namespace: "{{ .Values.nsPrefix }}" -spec: - selector: - matchLabels: - app: esr-esrgui - template: - metadata: - labels: - app: esr-esrgui - name: esr-esrgui - spec: - containers: - - image: {{ .Values.esrgui.image }} - imagePullPolicy: {{ .Values.pullPolicy }} - name: esr-esrgui - env: - - name: MSB_ADDR - value: {{ tpl .Values.msbaddr . }} - ports: - - containerPort: {{ .Values.esrgui.port }} - readinessProbe: - tcpSocket: - port: 8080 - initialDelaySeconds: 5 - periodSeconds: 10 - imagePullSecrets: - - name: "{{ .Values.nsPrefix }}-docker-registry-key" -#{{ end }} diff --git a/kubernetes/esr/templates/esr-esrserver-deployment.yaml b/kubernetes/esr/templates/esr-esrserver-deployment.yaml deleted file mode 100644 index 3f00edcc91..0000000000 --- a/kubernetes/esr/templates/esr-esrserver-deployment.yaml +++ /dev/null @@ -1,75 +0,0 @@ -# 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. - -#{{ if not .Values.disableUuiUui }} -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - labels: - app: esr-esrserver - name: esr-esrserver - namespace: "{{ .Values.nsPrefix }}" -spec: - selector: - matchLabels: - app: esr-esrserver - template: - metadata: - labels: - app: esr-esrserver - name: esr-esrserver - spec: - containers: - - name: esr-esrserver - image: {{ .Values.esrserver.image }} - imagePullPolicy: {{ .Values.pullPolicy }} - env: - - name: MSB_ADDR - value: {{ tpl .Values.msbaddr . }} - volumeMounts: - - name: localtime - mountPath: /etc/localtime - readOnly: true - - mountPath: /home/esr/works/logs - name: esr-server-logs - ports: - - containerPort: {{ .Values.esrserver.port }} - readinessProbe: - tcpSocket: - port: {{ .Values.esrserver.port }} - initialDelaySeconds: 5 - periodSeconds: 10 - - name: filebeat-onap-esr-server - image: {{ .Values.filebeat.image }} - imagePullPolicy: {{ .Values.pullPolicy }} - volumeMounts: - - mountPath: /usr/share/filebeat/filebeat.yml - subPath: filebeat.yml - name: filebeat-conf - - mountPath: /home/esr/works/logs - name: esr-server-logs - - mountPath: /usr/share/filebeat/data - name: esr-server-filebeat - volumes: - - name: localtime - hostPath: - path: /etc/localtime - - name: filebeat-conf - configMap: - name: esr-filebeat-configmap - - name: esr-server-logs - emptyDir: {} - - name: esr-server-filebeat - emptyDir: {} -#{{ end }} diff --git a/kubernetes/esr/templates/all-services.yaml b/kubernetes/esr/templates/service.yaml index ff6bd9554b..312a7bdcfb 100644 --- a/kubernetes/esr/templates/all-services.yaml +++ b/kubernetes/esr/templates/service.yaml @@ -12,14 +12,16 @@ # See the License for the specific language governing permissions and # limitations under the License. -#{{ if not .Values.disableEsrServer }} apiVersion: v1 kind: Service metadata: + name: {{ .Values.service.name }} + namespace: {{ include "common.namespace" . }} labels: - app: esr-esrserver - name: esr-esrserver - namespace: "{{ .Values.nsPrefix }}" + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} annotations: msb.onap.org/service-info: '[ { @@ -27,42 +29,15 @@ metadata: "version": "v1", "url": "/api/aai-esr-server/v1", "protocol": "REST", - "port": "{{.Values.esrserver.port}}", + "port": "{{.Values.service.internalPort}}", "enable_ssl": true, "visualRange":"1" } ]' spec: ports: - - name: esr-esrserver - port: {{.Values.esrserver.port}} + - port: {{ .Values.service.internalPort }} + name: {{ .Values.service.name }} selector: - app: esr-esrserver -#{{ end }} -#{{ if not .Values.disableEsrGui }} ---- -apiVersion: v1 -kind: Service -metadata: - labels: - app: esr-esrgui - name: esr-esrgui - namespace: "{{ .Values.nsPrefix }}" - annotations: - msb.onap.org/service-info: '[ - { - "serviceName": "aai-esr-gui", - "version": "v1", - "url": "/esr-gui", - "protocol": "UI", - "port": "{{.Values.esrgui.port}}", - "visualRange":"1" - } - ]' -spec: - ports: - - name: esr-esrgui - port: {{.Values.esrgui.port}} - selector: - app: esr-esrgui -#{{ end }}
\ No newline at end of file + app: {{ include "common.name" . }} + release: {{ .Release.Name }} diff --git a/kubernetes/esr/values.yaml b/kubernetes/esr/values.yaml index 82aa3347bb..3af491745e 100644 --- a/kubernetes/esr/values.yaml +++ b/kubernetes/esr/values.yaml @@ -12,22 +12,72 @@ # See the License for the specific language governing permissions and # limitations under the License. -nsPrefix: onap +################################################################# +# Global configuration defaults. +################################################################# +global: + nodePortPrefix: 302 + repositorySecret: eyJuZXh1czMub25hcC5vcmc6MTAwMDEiOnsidXNlcm5hbWUiOiJkb2NrZXIiLCJwYXNzd29yZCI6ImRvY2tlciIsImVtYWlsIjoiQCIsImF1dGgiOiJaRzlqYTJWeU9tUnZZMnRsY2c9PSJ9fQ== + readinessRepository: oomk8s + readinessImage: readiness-check:1.1.0 + loggingRepository: docker.elastic.co + loggingImage: beats/filebeat:5.5.0 + +subChartsOnly: + enabled: true + +# application image +repository: nexus3.onap.org:10001 +image: onap/aai/esr-server:v1.0.0 pullPolicy: Always -nodePortPrefix: 302 -msbaddr: msb-iag.{{ .Values.nsPrefix }}:80 -esrserver: - image: nexus3.onap.org:10001/onap/aai/esr-server:v1.0.0 - port: 9518 - replicas: 1 -esrgui: - image: nexus3.onap.org:10001/onap/aai/esr-gui:v1.0.0 - port: 8080 - replicas: 1 -filebeat: - image: docker.elastic.co/beats/filebeat:5.5.0 +msbaddr: msb-iag.{{ include "common.namespace" . }}:80 +# application configuration config: logstashServiceName: log-ls logstashPort: 5044 +# 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: + name: esr + internalPort: 9518 + +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 diff --git a/kubernetes/msb/charts/msb-consul/templates/service.yaml b/kubernetes/msb/charts/msb-consul/templates/service.yaml index 841d3497c4..86442a2740 100644 --- a/kubernetes/msb/charts/msb-consul/templates/service.yaml +++ b/kubernetes/msb/charts/msb-consul/templates/service.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "common.fullname" . }} + name: {{ .Values.service.name }} namespace: {{ include "common.namespace" . }} labels: app: {{ include "common.name" . }} diff --git a/kubernetes/msb/charts/msb-discovery/templates/service.yaml b/kubernetes/msb/charts/msb-discovery/templates/service.yaml index 841d3497c4..86442a2740 100644 --- a/kubernetes/msb/charts/msb-discovery/templates/service.yaml +++ b/kubernetes/msb/charts/msb-discovery/templates/service.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "common.fullname" . }} + name: {{ .Values.service.name }} namespace: {{ include "common.namespace" . }} labels: app: {{ include "common.name" . }} diff --git a/kubernetes/msb/charts/msb-eag/templates/service.yaml b/kubernetes/msb/charts/msb-eag/templates/service.yaml index e438f10d01..3e4a786cb8 100644 --- a/kubernetes/msb/charts/msb-eag/templates/service.yaml +++ b/kubernetes/msb/charts/msb-eag/templates/service.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "common.fullname" . }} + name: {{ .Values.service.name }} namespace: {{ include "common.namespace" . }} labels: app: {{ include "common.name" . }} diff --git a/kubernetes/msb/charts/msb-iag/templates/service.yaml b/kubernetes/msb/charts/msb-iag/templates/service.yaml index e438f10d01..3e4a786cb8 100644 --- a/kubernetes/msb/charts/msb-iag/templates/service.yaml +++ b/kubernetes/msb/charts/msb-iag/templates/service.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "common.fullname" . }} + name: {{ .Values.service.name }} namespace: {{ include "common.namespace" . }} labels: app: {{ include "common.name" . }} diff --git a/kubernetes/onap/requirements.yaml b/kubernetes/onap/requirements.yaml index 4b2d46ae34..d440b68b58 100644 --- a/kubernetes/onap/requirements.yaml +++ b/kubernetes/onap/requirements.yaml @@ -49,7 +49,7 @@ dependencies: repository: '@local' condition: dcaegen2.enabled - name: esr - version: ~1.0.0 + version: ~2.0.0 repository: '@local' condition: esr.enabled - name: log |