diff options
355 files changed, 7463 insertions, 5470 deletions
diff --git a/kubernetes/Makefile b/kubernetes/Makefile index 9cbf90fba7..4962c825d8 100644 --- a/kubernetes/Makefile +++ b/kubernetes/Makefile @@ -1,26 +1,33 @@ +# 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. + PARENT_CHART := onap COMMON_CHARTS_DIR := common -SETUP_CHARTS_DIR := setup -#Order is important -SHARED_CHARTS := common setup mysql dgbuilder # FIXME OOM-765 ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) OUTPUT_DIR := $(ROOT_DIR)/dist PACKAGE_DIR := $(OUTPUT_DIR)/packages SECRET_DIR := $(OUTPUT_DIR)/secrets -EXCLUDES := $(COMMON_CHARTS_DIR) config oneclick readiness test dist helm $(PARENT_CHART) dcae -EXCLUDES := $(SHARED_CHARTS) config oneclick readiness test dist $(PARENT_CHART) dcae +EXCLUDES := config oneclick readiness test dist helm $(PARENT_CHART) dcae HELM_CHARTS := $(filter-out $(EXCLUDES), $(patsubst %/.,%,$(wildcard */.))) $(PARENT_CHART) .PHONY: $(EXCLUDES) $(HELM_CHARTS) all: $(COMMON_CHARTS_DIR) $(HELM_CHARTS) -common: -all: $(SHARED_CHARTS) $(HELM_CHARTS) - -$(SHARED_CHARTS): +$(COMMON_CHARTS): @echo "\n[$@]" @make package-$@ @@ -40,10 +47,23 @@ lint-%: dep-% package-%: lint-% @mkdir -p $(PACKAGE_DIR) @if [ -f $*/Chart.yaml ]; then helm package -d $(PACKAGE_DIR) $*; fi + @helm repo index $(PACKAGE_DIR) clean: @rm -f */requirements.lock @rm -f *tgz */charts/*tgz - @rm -rf $(PACKAGE_DIR) + @rm -rf $(PACKAGE_DIR)/* + +# start up a local helm repo to serve up helm chart packages +repo: + @mkdir -p $(PACKAGE_DIR) + @helm serve --repo-path $(PACKAGE_DIR) & + @helm repo index $(PACKAGE_DIR) + @helm repo add local http://127.0.0.1:8879 + +# stop local helm repo +repo-stop: + @pkill helm + @helm repo remove local %: @: diff --git a/kubernetes/README.md b/kubernetes/README.md index dc49e5445b..9c315cbafe 100644 --- a/kubernetes/README.md +++ b/kubernetes/README.md @@ -1,78 +1,87 @@ -## **Quick Start Guide - ONAP on Kubernetes** +## **Quick Start Guide** -This is a quick start guide to help you get started on ONAP installation. Creating an ONAP deployment instance requires creating base configuration on the host node and then deploying the runtime containers. +This is a quick start guide describing how to deploy ONAP on Kubernetes using Helm. Pre-requisites: - Your Kubernetes environment must be available. For more information see, [ONAP on Kubernetes](https://wiki.onap.org/display/DW/ONAP+on+Kubernetes). - Deployment artifacts are customized for your location. -Step 1 -Review and optionally change configuration parameters: - -Setup the [/oom/kubernetes/config/onap-parameters.yaml](https://gerrit.onap.org/r/gitweb?p=oom.git;a=blob;f=kubernetes/config/onap-parameters.yaml;h=7ddaf4d4c3dccf2fad515265f0da9c31ec0e64b1;hb=refs/heads/master) file with key-value pairs specific to your OpenStack environment. - -OR - -There is a [sample](https://gerrit.onap.org/r/gitweb?p=oom.git;a=blob;f=kubernetes/config/onap-parameters-sample.yaml;h=3a74beddbbf7f9f9ec8e5a6abaecb7cb238bd519;hb=refs/heads/master) that may help you out or even be usable directly if you don't intend to actually use OpenStack resources. - - -Step 2 - -In-order to be able to support multiple ONAP instances within a single kubernetes environment, a configuration set is required. To do this, execute the [createConfig.sh](https://gerrit.onap.org/r/gitweb?p=oom.git;a=blob;f=kubernetes/config/createConfig.sh;h=f226ccae47ca6de15c1da49be4b8b6de974895ed;hb=refs/heads/master) script: - -> oom/kubernetes/config/createConfig.sh -n onap - -Where: -'onap' refers to the name of the instance. This serves as the Namespace prefix for each deployed ONAP component (for example, onap-mso). - -Step 3 - -The bash script [createAll.bash](https://gerrit.onap.org/r/gitweb?p=oom.git;a=blob;f=kubernetes/oneclick/createAll.bash;h=5e5f2dc76ea7739452e757282e750638b4e3e1de;hb=refs/heads/master) is used to create an ONAP deployment with kubernetes. It has two primary functions: - -- Creating the namespaces used to encapsulate the ONAP components, and -- Creating the services, pods and containers within each of these namespaces that provide the core functionality of ONAP. - -Before you execute the createAll.bash. script, pod config-init ([pod-config-init.yaml](https://gerrit.onap.org/r/gitweb?p=oom.git;a=blob;f=kubernetes/config/pod-config-init.yaml;h=b1285ce21d61815c082f6d6aa3c43d00561811c7;hb=refs/heads/master)) may need editing to match your environment and deployment into the default namespace. - -To deploy the containers and create your ONAP system, execute the following command: - -> oom/kubernetes/oneclick/createAll.bash -n onap - -#### **Additional information on usage of createAll.bash** - -Namespaces provide isolation between ONAP components as ONAP release 1.0 contains duplicate application (for example, mariadb) and port usage. - -As such createAll.bash requires the user to enter a namespace prefix string that can be used to separate multiple deployments of onap. The result will be set of 10 namespaces (for example, onap-sdc, onap-aai, onap-mso, onap-message-router, onap-robot, onap-vid, onap-sdnc, onap-portal, onap-policy, onap-appc) being created within the kubernetes environment. - - -#### **Deploying multiple ONAP instances within the same Kubernetes cluster** - -To deploy multiple ONAP instances, you must specify the number of Instances you would like to create in a Kubernetes cluster using createAllbash. - -This is currently required due to the use of NodePort ranges. NodePorts allow external IP:Port access to containers that are running inside a Kubernetes cluster. - -To create multiple instances of an ONAP deployment in the cluster, use the following commands: - -> oom/kubernetes/config/createConfig.sh -n onap - -> oom/kubernetes/oneclick/createAll.bash -n onap -i 2 - -Where: - -- 'onap' refers to the name of the instance. - -- ‘i 2’ refers to the number of instances of an ONAP deployment in the cluster. - -#### **To delete a deployed instance** +### **Deploy ONAP Instance** + +Step 1. Clone the OOM repository from ONAP gerrit: + +``` +> git clone http://gerrit.onap.org/r/oom +> cd oom/kubernetes +``` + +Step 2. Customize the oom/kubernetes/onap parent chart, like the values.yaml file, to suit your deployment. You may want to selectively enable or disable ONAP components by changing the subchart **enabled** flags to *true* or *false*. +``` +Example: +... +robot: # Robot Health Check + enabled: true +sdc: + enabled: false +sdnc: + enabled: false +so: # Service Orchestrator + enabled: true +... +``` + +Step 3. To setup a local Helm repository to serve up the local ONAP charts: +``` +> helm serve & +``` +Note the port number that is listed and use it in the Helm repo add as follows: +``` +> helm repo add local http://127.0.0.1:8879 +``` + +Step 4. Build a local Helm repository (from the kubernetes directory): +``` +> make all +``` + +Step 5. Display the charts that are available to be deployed: +``` +> helm search -l +NAME VERSION DESCRIPTION +local/appc 2.0.0 Application Controller +local/clamp 2.0.0 ONAP Clamp +local/onap 2.0.0 Open Network Automation Platform (ONAP) +local/robot 2.0.0 A helm Chart for kubernetes-ONAP Robot +local/so 2.0.0 ONAP Service Orchestrator +... +``` + +**Note:** +Setup of this Helm repository is a one time activity. If you make changes to your deployment charts or values be sure to use **make** to update your local Helm repository. + +Step 6. Once the repo is setup, installation of ONAP can be done with a single command: +``` +> helm install local/onap -name dev --namespace onap +``` +**Note:** the **--namespace onap** is currently required while all onap helm charts are migrated to version 2.0. After this activity is complete, namespaces will be optional. + +Use the following to monitor your deployment and determine when ONAP is ready for use: +``` +> kubectl get pods --all-namespaces -o=wide +``` + + +#### **Cleanup deployed ONAP instance** To delete a deployed instance, use the following command: +``` +> helm del dev --purge +``` -> oom/kubernetes/oneclick/deleteAll.bash -n onap -**Note:** Deleting the runtime containers does not remove the configuration created in step 2. For more information on OOM project documentation, refer to: diff --git a/kubernetes/README_HELM b/kubernetes/README_HELM deleted file mode 100644 index 0f65120397..0000000000 --- a/kubernetes/README_HELM +++ /dev/null @@ -1,20 +0,0 @@ -Prerequisites: -- K8s -- Helm - -In order to use Helm with Rancher, check the tiller version installed -by running "helm version" on the rancher CLI -and install the appropriate Helm. -Notice both tiller and helm are installed, -but you will need to install on your VM. - -charts were tested with the following setup: - Rancher Release v1.6.7 - k8s version 1.7.2 - Helm/Tiller version v2.3.0 -also tested on: - k8s version v1.5.2 - Helm/Tiller v2.6.0 - -Download Helm: -https://github.com/kubernetes/helm diff --git a/kubernetes/aaf/Chart.yaml b/kubernetes/aaf/Chart.yaml index 24cb7fddf3..438835de40 100644 --- a/kubernetes/aaf/Chart.yaml +++ b/kubernetes/aaf/Chart.yaml @@ -13,6 +13,6 @@ # limitations under the License. apiVersion: v1 -description: A Helm chart for Kubernetes +description: ONAP Application Authorization Framework name: aaf -version: 1.1.0 +version: 2.0.0 diff --git a/kubernetes/dgbuilder/.helmignore b/kubernetes/aaf/charts/aaf-cs/.helmignore index f0c1319444..f0c1319444 100644 --- a/kubernetes/dgbuilder/.helmignore +++ b/kubernetes/aaf/charts/aaf-cs/.helmignore diff --git a/kubernetes/aaf/charts/aaf-cs/Chart.yaml b/kubernetes/aaf/charts/aaf-cs/Chart.yaml new file mode 100644 index 0000000000..a0f05c4cf3 --- /dev/null +++ b/kubernetes/aaf/charts/aaf-cs/Chart.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +description: ONAP AAF cassandra +name: aaf-cs +version: 2.0.0 diff --git a/kubernetes/aaf/resources/config/aaf-data/identities.dat b/kubernetes/aaf/charts/aaf-cs/resources/config/aaf-data/identities.dat index 95eb51d1be..95eb51d1be 100644 --- a/kubernetes/aaf/resources/config/aaf-data/identities.dat +++ b/kubernetes/aaf/charts/aaf-cs/resources/config/aaf-data/identities.dat diff --git a/kubernetes/aaf/charts/aaf-cs/templates/deployment.yaml b/kubernetes/aaf/charts/aaf-cs/templates/deployment.yaml new file mode 100644 index 0000000000..80b99b20b6 --- /dev/null +++ b/kubernetes/aaf/charts/aaf-cs/templates/deployment.yaml @@ -0,0 +1,75 @@ +# 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" . }} + name: {{ .Release.Name }} + spec: + hostname: {{ include "common.name" . }} + containers: + - args: + image: "{{ .Values.repository | default .Values.global.repository }}/{{ .Values.image }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + name: {{ include "common.name" . }} + volumeMounts: + - mountPath: /data + name: aaf-cs-data + # 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 }} + 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: aaf-cs-data + secret: + secretName: {{ include "common.fullname" . }} + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/kubernetes/aaf/templates/aaf-secret.yaml b/kubernetes/aaf/charts/aaf-cs/templates/secret.yaml index 842d0c431e..4ae60f17c9 100644 --- a/kubernetes/aaf/templates/aaf-secret.yaml +++ b/kubernetes/aaf/charts/aaf-cs/templates/secret.yaml @@ -12,13 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -#{{ if not .Values.disableAafAafCs }} apiVersion: v1 kind: Secret metadata: - name: aaf-cs-data-secret - namespace: {{ .Values.nsPrefix }} + name: {{ include "common.fullname" . }} + namespace: {{ include "common.namespace" . }} type: Opaque data: {{ (.Files.Glob "resources/config/aaf-cs-data/*").AsSecrets | indent 2 }} -#{{ end }} diff --git a/kubernetes/aaf/charts/aaf-cs/templates/service.yaml b/kubernetes/aaf/charts/aaf-cs/templates/service.yaml new file mode 100644 index 0000000000..facf3ce2f0 --- /dev/null +++ b/kubernetes/aaf/charts/aaf-cs/templates/service.yaml @@ -0,0 +1,60 @@ +# 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: {{ 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.externalPort }} + #Example internal target port if required + #targetPort: {{ .Values.service.internalPort }} + nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort }} + name: {{ .Values.service.name }} + - port: {{ .Values.service.externalPort2 }} + nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort2 }} + name: {{ .Values.service.name }}2 + - port: {{ .Values.service.externalPort3 }} + nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort3 }} + name: {{ .Values.service.name }}3 + - port: {{ .Values.service.externalPort4 }} + nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort4 }} + name: {{ .Values.service.name }}4 + {{- else -}} + - port: {{ .Values.service.externalPort }} + targetPort: {{ .Values.service.internalPort }} + name: {{ .Values.service.name }} + - port: {{ .Values.service.externalPort2 }} + targetPort: {{ .Values.service.internalPort2 }} + name: {{ .Values.service.name }}2 + - port: {{ .Values.service.externalPort3 }} + targetPort: {{ .Values.service.internalPort3 }} + name: {{ .Values.service.name }}3 + - port: {{ .Values.service.externalPort4 }} + targetPort: {{ .Values.service.internalPort4 }} + name: {{ .Values.service.name }}4 + {{- end}} + selector: + app: {{ include "common.name" . }} + release: {{ .Release.Name }} + clusterIP: None diff --git a/kubernetes/aaf/charts/aaf-cs/values.yaml b/kubernetes/aaf/charts/aaf-cs/values.yaml new file mode 100644 index 0000000000..ea5445fa2e --- /dev/null +++ b/kubernetes/aaf/charts/aaf-cs/values.yaml @@ -0,0 +1,94 @@ +# 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== + +# If mountPath is over NFS (e.g. /dockerdata-nfs is NFS mounted between the nodes), uncomment following lines. +# persistence: +# mountPath: /dockerdata + +################################################################# +# Application configuration defaults. +################################################################# +# application image +repository: nexus3.onap.org:10001 +image: library/cassandra:2.1.17 +pullPolicy: Always + +# flag to enable debugging - application support required +debugEnabled: false + +# 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: ClusterIP + name: aaf-cs + #targetPort + internalPort: 7000 + #port + externalPort: 7000 + + internalPort2: 7001 + externalPort2: 7001 + internalPort3: 9042 + externalPort3: 9042 + internalPort4: 9160 + externalPort4: 9160 + +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/aaf/requirements.yaml b/kubernetes/aaf/requirements.yaml new file mode 100644 index 0000000000..fb4321ded6 --- /dev/null +++ b/kubernetes/aaf/requirements.yaml @@ -0,0 +1,7 @@ +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/aaf/templates/aaf-cs-deployment.yaml b/kubernetes/aaf/templates/aaf-cs-deployment.yaml deleted file mode 100644 index 7f8cdb6f26..0000000000 --- a/kubernetes/aaf/templates/aaf-cs-deployment.yaml +++ /dev/null @@ -1,52 +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.disableAafAafCs }} -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: aaf-cs - namespace: "{{ .Values.nsPrefix }}" -spec: - replicas: {{ .Values.aafcsReplicas }} - selector: - matchLabels: - app: aaf-cs - template: - metadata: - labels: - app: aaf-cs - name: aaf-cs - spec: - hostname: aaf-cs - containers: - - args: - image: {{ .Values.image.csImage }}:{{ .Values.image.csVersion }} - imagePullPolicy: {{ .Values.pullPolicy }} - name: "aaf-cs" - volumeMounts: - - mountPath: /data - name: aaf-cs-data - readinessProbe: - tcpSocket: - port: 7000 - initialDelaySeconds: 5 - periodSeconds: 10 - volumes: - - name: aaf-cs-data - secret: - secretName: aaf-cs-data-secret - imagePullSecrets: - - name: {{ .Values.nsPrefix }}-docker-registry-key -#{{ end }} diff --git a/kubernetes/aaf/templates/aaf-deployment.yaml b/kubernetes/aaf/templates/aaf-deployment.yaml deleted file mode 100644 index 0341344383..0000000000 --- a/kubernetes/aaf/templates/aaf-deployment.yaml +++ /dev/null @@ -1,70 +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.disableAafAaf }} -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - labels: - app: aaf - name: aaf - namespace: "{{ .Values.nsPrefix }}" -spec: - replicas: {{ .Values.aafReplicas }} - selector: - matchLabels: - app: aaf - template: - metadata: - labels: - app: aaf - name: aaf - spec: - initContainers: - - command: - - /root/ready.py - args: - - --container-name - - aaf-cs - env: - - name: NAMESPACE - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: metadata.namespace - image: {{ .Values.image.readiness }} - imagePullPolicy: {{ .Values.pullPolicy }} - name: aaf-readiness - containers: - - env: - - name: CASSANDRA_CLUSTER - value: cassandra_container - image: {{ .Values.image.aafImage }}:{{ .Values.image.aafVersion }} - imagePullPolicy: {{ .Values.pullPolicy }} - volumeMounts: - - mountPath: /data - name: aaf-data - name: aaf - readinessProbe: - tcpSocket: - port: 8101 - initialDelaySeconds: 5 - periodSeconds: 10 - volumes: - - name: aaf-data - configMap: - name: aaf-data-configmap - imagePullSecrets: - - name: {{ .Values.nsPrefix }}-docker-registry-key -#{{ end }} diff --git a/kubernetes/aaf/templates/all-services.yaml b/kubernetes/aaf/templates/all-services.yaml deleted file mode 100644 index 5ccbd252c8..0000000000 --- a/kubernetes/aaf/templates/all-services.yaml +++ /dev/null @@ -1,54 +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.disableAafAafCs }} -apiVersion: v1 -kind: Service -metadata: - name: aaf-cs - namespace: "{{ .Values.nsPrefix }}" - labels: - app: aaf-cs -spec: - ports: - - name: aaf-cs-port-7000 - port: 7000 - - name: aaf-cs-port-7001 - port: 7001 - - name: aaf-cs-port-9042 - port: 9042 - - name: aaf-cs-port-9160 - port: 9160 - selector: - app: aaf-cs - clusterIP: None -#{{ end }} -#{{ if not .Values.disableAafAaf }} ---- -apiVersion: v1 -kind: Service -metadata: - name: aaf-authz-service - namespace: "{{ .Values.nsPrefix }}" - labels: - app: aaf-authz-service -spec: - ports: - - name: aaf-authz-service - port: 8101 - nodePort: {{ .Values.nodePortPrefix }}99 - selector: - app: clamp - type: NodePort -#{{ end }}
\ No newline at end of file diff --git a/kubernetes/aaf/templates/aaf-configmap.yaml b/kubernetes/aaf/templates/configmap.yaml index f89ccec946..c7cf9ae6c4 100644 --- a/kubernetes/aaf/templates/aaf-configmap.yaml +++ b/kubernetes/aaf/templates/configmap.yaml @@ -12,12 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -#{{ if not .Values.disableAafAaf }} apiVersion: v1 kind: ConfigMap metadata: - name: aaf-data-configmap - namespace: {{ .Values.nsPrefix }} + name: {{ include "common.fullname" . }} + namespace: {{ include "common.namespace" . }} data: {{ (.Files.Glob "resources/config/aaf-data/*").AsConfig | indent 2 }} -#{{ end }} diff --git a/kubernetes/aaf/templates/deployment.yaml b/kubernetes/aaf/templates/deployment.yaml new file mode 100644 index 0000000000..03506b52eb --- /dev/null +++ b/kubernetes/aaf/templates/deployment.yaml @@ -0,0 +1,91 @@ +# 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: + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + name: {{ include "common.fullname" . }} + namespace: {{ include "common.namespace" . }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + app: {{ include "common.name" . }} + template: + metadata: + labels: + app: {{ include "common.name" . }} + name: {{ include "common.fullname" . }} + spec: + initContainers: + - command: + - /root/ready.py + args: + - --container-name + - aaf-cs + env: + - name: NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + name: {{ include "common.name" . }}-readiness + containers: + - env: + - name: CASSANDRA_CLUSTER + value: cassandra_container + image: "{{ .Values.global.repository | default .Values.repository }}/{{ .Values.image }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + volumeMounts: + - mountPath: /data + name: aaf-data + name: {{ include "common.name" . }} + # 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 }} + 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: aaf-data + configMap: + name: {{ include "common.fullname" . }} + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/kubernetes/aaf/templates/service.yaml b/kubernetes/aaf/templates/service.yaml new file mode 100644 index 0000000000..3f6e1f07ef --- /dev/null +++ b/kubernetes/aaf/templates/service.yaml @@ -0,0 +1,41 @@ +# 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: {{ 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: + ports: + {{if eq .Values.service.type "NodePort" -}} + - port: {{ .Values.service.externalPort }} + #Example internal target port if required + #targetPort: {{ .Values.service.internalPort }} + nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort }} + name: {{ .Values.service.name }} + {{- else -}} + - port: {{ .Values.service.externalPort }} + targetPort: {{ .Values.service.internalPort }} + name: {{ .Values.service.name }} + {{- end}} + selector: + app: {{ include "common.name" . }} + release: {{ .Release.Name }} + type: {{ .Values.service.type }} diff --git a/kubernetes/aaf/values.yaml b/kubernetes/aaf/values.yaml index 088adfe6a6..4f9c1c6da0 100644 --- a/kubernetes/aaf/values.yaml +++ b/kubernetes/aaf/values.yaml @@ -12,14 +12,80 @@ # See the License for the specific language governing permissions and # limitations under the License. -nsPrefix: onap +################################################################# +# Global configuration defaults. +################################################################# +global: + nodePortPrefix: 302 + repository: nexus3.onap.org:10001 + repositorySecret: eyJuZXh1czMub25hcC5vcmc6MTAwMDEiOnsidXNlcm5hbWUiOiJkb2NrZXIiLCJwYXNzd29yZCI6ImRvY2tlciIsImVtYWlsIjoiQCIsImF1dGgiOiJaRzlqYTJWeU9tUnZZMnRsY2c9PSJ9fQ== + readinessRepository: oomk8s + readinessImage: readiness-check:1.1.0 + +# If mountPath is over NFS (e.g. /dockerdata-nfs is NFS mounted between the nodes), uncomment following lines. +# persistence: +# mountPath: /dockerdata + +################################################################# +# Application configuration defaults. +################################################################# +# application image +repository: nexus3.onap.org:10001 +image: onap/aaf/authz-service:latest pullPolicy: Always -nodePortPrefix: 302 -aafcsReplicas: 1 -aafReplicas: 1 -image: - readiness: oomk8s/readiness-check:1.1.0 - aafImage: nexus3.onap.org:10001/onap/aaf/authz-service - aafVersion: latest - csImage: nexus3.onap.org:10001/library/cassandra - csVersion: 2.1.17 + +# flag to enable debugging - application support required +debugEnabled: false + +# 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: aaf-authz + #targetPort + internalPort: 8101 + #port + externalPort: 8101 + nodePort: 99 + +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/mysql/.helmignore b/kubernetes/aai/.helmignore index f0c1319444..f0c1319444 100644 --- a/kubernetes/mysql/.helmignore +++ b/kubernetes/aai/.helmignore diff --git a/kubernetes/aai/Chart.yaml b/kubernetes/aai/Chart.yaml index 49b12ec0a3..5b36e11e0a 100644 --- a/kubernetes/aai/Chart.yaml +++ b/kubernetes/aai/Chart.yaml @@ -13,6 +13,6 @@ # limitations under the License. apiVersion: v1 -description: A Helm chart for Kubernetes +description: ONAP Active and Available Inventory name: aai -version: 0.1.0 +version: 2.0.0 diff --git a/kubernetes/aai/charts/aai-data-router/.helmignore b/kubernetes/aai/charts/aai-data-router/.helmignore new file mode 100644 index 0000000000..f0c1319444 --- /dev/null +++ b/kubernetes/aai/charts/aai-data-router/.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-data-router/Chart.yaml b/kubernetes/aai/charts/aai-data-router/Chart.yaml new file mode 100644 index 0000000000..59d3c77d2e --- /dev/null +++ b/kubernetes/aai/charts/aai-data-router/Chart.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +description: ONAP AAI Data-Router +name: aai-data-router +version: 2.0.0 diff --git a/kubernetes/aai/resources/config/data-router/appconfig/auth/client-cert-onap.p12 b/kubernetes/aai/charts/aai-data-router/resources/config/auth/client-cert-onap.p12 Binary files differindex dbf4fcacec..dbf4fcacec 100644 --- a/kubernetes/aai/resources/config/data-router/appconfig/auth/client-cert-onap.p12 +++ b/kubernetes/aai/charts/aai-data-router/resources/config/auth/client-cert-onap.p12 diff --git a/kubernetes/aai/resources/config/data-router/appconfig/auth/data-router_policy.json b/kubernetes/aai/charts/aai-data-router/resources/config/auth/data-router_policy.json index 1b4a6b0868..1b4a6b0868 100644 --- a/kubernetes/aai/resources/config/data-router/appconfig/auth/data-router_policy.json +++ b/kubernetes/aai/charts/aai-data-router/resources/config/auth/data-router_policy.json diff --git a/kubernetes/aai/resources/config/data-router/appconfig/auth/tomcat_keystore b/kubernetes/aai/charts/aai-data-router/resources/config/auth/tomcat_keystore Binary files differindex 9eec841aa2..9eec841aa2 100644 --- a/kubernetes/aai/resources/config/data-router/appconfig/auth/tomcat_keystore +++ b/kubernetes/aai/charts/aai-data-router/resources/config/auth/tomcat_keystore diff --git a/kubernetes/aai/resources/config/data-router/appconfig/data-router.properties b/kubernetes/aai/charts/aai-data-router/resources/config/data-router.properties index e69de29bb2..e69de29bb2 100644 --- a/kubernetes/aai/resources/config/data-router/appconfig/data-router.properties +++ b/kubernetes/aai/charts/aai-data-router/resources/config/data-router.properties diff --git a/kubernetes/aai/resources/config/data-router/appconfig/model/aai_oxm_v10.xml b/kubernetes/aai/charts/aai-data-router/resources/config/model/aai_oxm_v10.xml index 7eddd10179..7eddd10179 100644 --- a/kubernetes/aai/resources/config/data-router/appconfig/model/aai_oxm_v10.xml +++ b/kubernetes/aai/charts/aai-data-router/resources/config/model/aai_oxm_v10.xml diff --git a/kubernetes/aai/resources/config/data-router/appconfig/model/aai_oxm_v11.xml b/kubernetes/aai/charts/aai-data-router/resources/config/model/aai_oxm_v11.xml index ecf163e097..ecf163e097 100644 --- a/kubernetes/aai/resources/config/data-router/appconfig/model/aai_oxm_v11.xml +++ b/kubernetes/aai/charts/aai-data-router/resources/config/model/aai_oxm_v11.xml diff --git a/kubernetes/aai/resources/config/data-router/appconfig/model/aai_oxm_v8.xml b/kubernetes/aai/charts/aai-data-router/resources/config/model/aai_oxm_v8.xml index 3ed2ea531f..3ed2ea531f 100644 --- a/kubernetes/aai/resources/config/data-router/appconfig/model/aai_oxm_v8.xml +++ b/kubernetes/aai/charts/aai-data-router/resources/config/model/aai_oxm_v8.xml diff --git a/kubernetes/aai/resources/config/data-router/appconfig/model/aai_oxm_v9.xml b/kubernetes/aai/charts/aai-data-router/resources/config/model/aai_oxm_v9.xml index 87a3d656e5..87a3d656e5 100644 --- a/kubernetes/aai/resources/config/data-router/appconfig/model/aai_oxm_v9.xml +++ b/kubernetes/aai/charts/aai-data-router/resources/config/model/aai_oxm_v9.xml diff --git a/kubernetes/aai/resources/config/data-router/dynamic/conf/entity-event-policy.xml b/kubernetes/aai/charts/aai-data-router/resources/dynamic/conf/entity-event-policy.xml index e995053f12..e995053f12 100644 --- a/kubernetes/aai/resources/config/data-router/dynamic/conf/entity-event-policy.xml +++ b/kubernetes/aai/charts/aai-data-router/resources/dynamic/conf/entity-event-policy.xml diff --git a/kubernetes/aai/resources/config/data-router/dynamic/routes/entity-event.route b/kubernetes/aai/charts/aai-data-router/resources/dynamic/routes/entity-event.route index 293688ecd4..7b4e902313 100644 --- a/kubernetes/aai/resources/config/data-router/dynamic/routes/entity-event.route +++ b/kubernetes/aai/charts/aai-data-router/resources/dynamic/routes/entity-event.route @@ -1,4 +1,4 @@ <route xmlns="http://camel.apache.org/schema/spring" trace="true"> - <from uri="event-bus:mybus/?eventTopic=AAI-EVENT&groupName=datarouter&groupId=datarouter&url=http://dmaap.{{.Values.nsPrefix}}:3904"/> + <from uri="event-bus:mybus/?eventTopic=AAI-EVENT&groupName=datarouter&groupId=datarouter&url=http://dmaap.{{.Release.Namespace}}:3904"/> <to uri="bean:entityEventPolicy?method=process"/> </route> diff --git a/kubernetes/aai/charts/aai-data-router/templates/configmap.yaml b/kubernetes/aai/charts/aai-data-router/templates/configmap.yaml new file mode 100644 index 0000000000..a8793acd9f --- /dev/null +++ b/kubernetes/aai/charts/aai-data-router/templates/configmap.yaml @@ -0,0 +1,48 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }}-prop + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/data-router.properties").AsConfig . | indent 2 }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }}-model-v8 + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/model/aai_oxm_v8.xml").AsConfig . | indent 2 }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }}-model-v9 + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/model/aai_oxm_v9.xml").AsConfig . | indent 2 }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }}-model-v10 + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/model/aai_oxm_v10.xml").AsConfig . | indent 2 }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }}-model-v11 + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/model/aai_oxm_v11.xml").AsConfig . | indent 2 }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }}-dynamic + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/dynamic/routes/entity-event.route").AsConfig . | indent 2 }} +{{ tpl (.Files.Glob "resources/dynamic/conf/entity-event-policy.xml").AsConfig . | indent 2 }} diff --git a/kubernetes/aai/charts/aai-data-router/templates/deployment.yaml b/kubernetes/aai/charts/aai-data-router/templates/deployment.yaml new file mode 100644 index 0000000000..79bcff33eb --- /dev/null +++ b/kubernetes/aai/charts/aai-data-router/templates/deployment.yaml @@ -0,0 +1,154 @@ +# 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: + initContainers: + - command: + - /bin/sh + - -c + - | + mkdir -p /logroot/data-router/logs + chmod -R 777 /logroot/data-router/logs + chown -R root:root /logroot + env: + - name: NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + securityContext: + privileged: true + image: {{ .Values.global.dockerhubRepository | default .Values.dockerhubRepository }}/{{ .Values.global.busyboxImage | default .Values.busyboxImage }} + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + name: init-sysctl + volumeMounts: + - name: {{ include "common.fullname" . }}-logs + mountPath: /logroot/ + containers: + - name: {{ include "common.name" . }} + image: "{{ .Values.global.repository | default .Values.repository }}/{{ .Values.image }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + env: + - name: SERVICE_BEANS + value: /opt/app/data-router/dynamic/conf + - name: CONFIG_HOME + value: /opt/app/data-router/config/ + - name: KEY_STORE_PASSWORD + value: {{ .Values.config.keyStorePassword }} + - name: DYNAMIC_ROUTES + value: /opt/app/data-router/dynamic/routes + - name: KEY_MANAGER_PASSWORD + value: {{ .Values.config.keyManagerPassword }} + - name: PATH + value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + - name: JAVA_HOME + value: usr/lib/jvm/java-8-openjdk-amd64 + volumeMounts: + - mountPath: /etc/localtime + name: localtime + readOnly: true + - mountPath: /opt/app/data-router/config/model/aai_oxm_v8.xml + subPath: aai_oxm_v8.xml + name: {{ include "common.fullname" . }}-model-v8 + - mountPath: /opt/app/data-router/config/model/aai_oxm_v9.xml + subPath: aai_oxm_v9.xml + name: {{ include "common.fullname" . }}-model-v9 + - mountPath: /opt/app/data-router/config/model/aai_oxm_v10.xml + subPath: aai_oxm_v10.xml + name: {{ include "common.fullname" . }}-model-v10 + - mountPath: /opt/app/data-router/config/model/aai_oxm_v11.xml + subPath: aai_oxm_v11.xml + name: {{ include "common.fullname" . }}-model-v11 + - mountPath: /opt/app/data-router/config/auth + name: {{ include "common.fullname" . }}-auth + - mountPath: /opt/app/data-router/config/data-router.properties + name: {{ include "common.fullname" . }}-properties + subPath: data-router.properties + - mountPath: /opt/app/data-router/dynamic/routes/entity-event.route + subPath: entity-event.route + name: {{ include "common.fullname" . }}-dynamic-route + - mountPath: /opt/app/data-router/dynamic/conf/entity-event-policy.xml + subPath: entity-event-policy.xml + name: {{ include "common.fullname" . }}-dynamic-policy + - mountPath: /logs/ + name: {{ include "common.fullname" . }}-logs + ports: + - containerPort: {{ .Values.service.internalPort }} + {{- 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 }} + volumes: + - name: localtime + hostPath: + path: /etc/localtime + - name: {{ include "common.fullname" . }}-model-v8 + configMap: + name: {{ include "common.fullname" . }}-model-v8 + - name: {{ include "common.fullname" . }}-model-v9 + configMap: + name: {{ include "common.fullname" . }}-model-v9 + - name: {{ include "common.fullname" . }}-model-v10 + configMap: + name: {{ include "common.fullname" . }}-model-v10 + - name: {{ include "common.fullname" . }}-model-v11 + configMap: + name: {{ include "common.fullname" . }}-model-v11 + - name: {{ include "common.fullname" . }}-auth + secret: + secretName: {{ include "common.fullname" . }} + - name: {{ include "common.fullname" . }}-properties + configMap: + name: {{ include "common.fullname" . }}-prop + - name: {{ include "common.fullname" . }}-dynamic-route + configMap: + name: {{ include "common.fullname" . }}-dynamic + - name: {{ include "common.fullname" . }}-dynamic-policy + configMap: + name: {{ include "common.fullname" . }}-dynamic + - name: {{ include "common.fullname" . }}-logs + hostPath: + path: {{ .Values.persistence.mountPath }}/{{ include "common.namespace" . }}/{{ .Values.persistence.mountSubPath }} + restartPolicy: {{ .Values.global.restartPolicy | default .Values.restartPolicy }} + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/kubernetes/aai/charts/aai-data-router/templates/secret.yaml b/kubernetes/aai/charts/aai-data-router/templates/secret.yaml new file mode 100644 index 0000000000..69bd3f86de --- /dev/null +++ b/kubernetes/aai/charts/aai-data-router/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-data-router/values.yaml b/kubernetes/aai/charts/aai-data-router/values.yaml new file mode 100644 index 0000000000..3957df156d --- /dev/null +++ b/kubernetes/aai/charts/aai-data-router/values.yaml @@ -0,0 +1,86 @@ +# Default values for data-router. +# 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/data-router:v1.1.0 +pullPolicy: Always +restartPolicy: Always + +# 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: + name: aai-data-router + internalPort: 9502 + +ingress: + enabled: false + +persistence: + enabled: true + + ## A manually managed Persistent Volume and Claim + ## Requires persistence.enabled: true + ## If defined, PVC must be created manually before volume will be bound + # existingClaim: + volumeReclaimPolicy: Retain + + ## database data Persistent Volume Storage Class + ## If defined, storageClassName: <storageClass> + ## If set to "-", storageClassName: "", which disables dynamic provisioning + ## If undefined (the default) or set to null, no storageClassName spec is + ## set, choosing the default provisioner. (gp2 on AWS, standard on + ## GKE, AWS & OpenStack) + ## + ## storageClass: "-" + accessMode: ReadWriteMany + size: 2Gi + mountPath: /dockerdata-nfs + mountSubPath: aai/data-router/logs + +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/aai/charts/aai-elasticsearch/.helmignore b/kubernetes/aai/charts/aai-elasticsearch/.helmignore new file mode 100644 index 0000000000..f0c1319444 --- /dev/null +++ b/kubernetes/aai/charts/aai-elasticsearch/.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-elasticsearch/Chart.yaml b/kubernetes/aai/charts/aai-elasticsearch/Chart.yaml new file mode 100644 index 0000000000..348e4fa8cd --- /dev/null +++ b/kubernetes/aai/charts/aai-elasticsearch/Chart.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +description: ONAP AAI elasticsearch +name: aai-elasticsearch +version: 2.0.0 diff --git a/kubernetes/aai/resources/config/elasticsearch/config/elasticsearch.yml b/kubernetes/aai/charts/aai-elasticsearch/resources/config/elasticsearch.yml index 21e29df84b..822ae32f10 100644 --- a/kubernetes/aai/resources/config/elasticsearch/config/elasticsearch.yml +++ b/kubernetes/aai/charts/aai-elasticsearch/resources/config/elasticsearch.yml @@ -155,14 +155,14 @@ network.bind_host: 0.0.0.0 # Set a custom port for the node to node communication (9300 by default): -transport.tcp.port: 8443 +transport.tcp.port: {{ .Values.config.tcpPort }} # Enable compression for all communication between nodes (disabled by default): transport.tcp.compress: false # Set a custom port to listen for HTTP traffic: # http.port: 9200 -http.port: 9200 +http.port: {{ .Values.service.internalPort }} # Set a custom allowed content length: # http.max_content_length: 100mb diff --git a/kubernetes/aai/templates/elasticsearch-configmap.yaml b/kubernetes/aai/charts/aai-elasticsearch/templates/configmap.yaml index e3225be8aa..991a06abcf 100644 --- a/kubernetes/aai/templates/elasticsearch-configmap.yaml +++ b/kubernetes/aai/charts/aai-elasticsearch/templates/configmap.yaml @@ -16,8 +16,8 @@ apiVersion: v1 kind: ConfigMap metadata: - name: aai-elasticsearch-configmap - namespace: {{ .Values.nsPrefix }} + name: {{ include "common.fullname" . }} + namespace: {{ include "common.namespace" . }} data: -{{ tpl (.Files.Glob "resources/config/elasticsearch/config/elasticsearch.yml").AsConfig . | indent 2 }} +{{ tpl (.Files.Glob "resources/config/elasticsearch.yml").AsConfig . | indent 2 }} #{{ end }} diff --git a/kubernetes/aai/charts/aai-elasticsearch/templates/deployment.yaml b/kubernetes/aai/charts/aai-elasticsearch/templates/deployment.yaml new file mode 100644 index 0000000000..6792d4cd54 --- /dev/null +++ b/kubernetes/aai/charts/aai-elasticsearch/templates/deployment.yaml @@ -0,0 +1,96 @@ +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" . }} + name: {{ include "common.name" . }} + spec: + initContainers: + - command: + - /bin/sh + - -c + - | + mkdir -p /logroot/elasticsearch/es-data + chmod -R 777 /logroot/elasticsearch/es-data + chown -R root:root /logroot + env: + - name: NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + securityContext: + privileged: true + image: {{ .Values.global.dockerhubRepository | default .Values.dockerhubRepository }}/{{ .Values.global.busyboxImage | default .Values.busyboxImage }} + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + name: init-sysctl + volumeMounts: + - name: elasticsearch-data + mountPath: /logroot/ + hostname: {{ include "common.name" . }} + containers: + - name: {{ include "common.name" . }} + image: {{ .Values.global.dockerhubRepository | default .Values.dockerhubRepository }}/{{ .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 }} + volumeMounts: + - name: localtime + mountPath: /etc/localtime + readOnly: true + - name: elasticsearch-config + subPath: elasticsearch.yml + mountPath: /usr/share/elasticsearch/config/elasticsearch.yml + - name: elasticsearch-data + mountPath: /usr/share/elasticsearch/data + resources: +{{ toYaml .Values.resources | indent 10 }} + {{- if .Values.nodeSelector }} + nodeSelector: +{{ toYaml .Values.nodeSelector | indent 8 }} + {{- end -}} + {{- if .Values.affinity }} + affinity: +{{ toYaml .Values.affinity | indent 8 }} + {{- end }} + + volumes: + - name: localtime + hostPath: + path: /etc/localtime + - name: elasticsearch-config + configMap: + name: {{ include "common.fullname" . }} + - name: elasticsearch-data + hostPath: + path: {{ .Values.persistence.mountPath }}/{{ include "common.namespace" . }}/{{ .Values.persistence.mountSubPath }} + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/kubernetes/aai/charts/aai-elasticsearch/templates/service.yaml b/kubernetes/aai/charts/aai-elasticsearch/templates/service.yaml new file mode 100644 index 0000000000..84548eda86 --- /dev/null +++ b/kubernetes/aai/charts/aai-elasticsearch/templates/service.yaml @@ -0,0 +1,25 @@ +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 }} + {{- else -}} + - port: {{ .Values.service.internalPort }} + name: {{ .Values.service.name }} + {{- end}} + selector: + app: {{ include "common.fullname" . }} + release: {{ .Release.Name }} + clusterIP: None diff --git a/kubernetes/aai/charts/aai-elasticsearch/values.yaml b/kubernetes/aai/charts/aai-elasticsearch/values.yaml new file mode 100644 index 0000000000..af7fd3d3ed --- /dev/null +++ b/kubernetes/aai/charts/aai-elasticsearch/values.yaml @@ -0,0 +1,84 @@ +# Default values for elasticsearch. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. +global: # global defaults + nodePortPrefix: 302 + repositorySecret: eyJuZXh1czMub25hcC5vcmc6MTAwMDEiOnsidXNlcm5hbWUiOiJkb2NrZXIiLCJwYXNzd29yZCI6ImRvY2tlciIsImVtYWlsIjoiQCIsImF1dGgiOiJaRzlqYTJWeU9tUnZZMnRsY2c9PSJ9fQ== + +# application image +dockerhubRepository: docker.io +image: elasticsearch:2.4.1 +pullPolicy: Always + +# application configuration +config: + tcpPort: 8443 + + +# 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: ClusterIP + name: aai-elasticsearch + internalPort: 9200 + +ingress: + enabled: false + +persistence: + enabled: true + + ## A manually managed Persistent Volume and Claim + ## Requires persistence.enabled: true + ## If defined, PVC must be created manually before volume will be bound + # existingClaim: + volumeReclaimPolicy: Retain + + ## database data Persistent Volume Storage Class + ## If defined, storageClassName: <storageClass> + ## If set to "-", storageClassName: "", which disables dynamic provisioning + ## If undefined (the default) or set to null, no storageClassName spec is + ## set, choosing the default provisioner. (gp2 on AWS, standard on + ## GKE, AWS & OpenStack) + ## + ## storageClass: "-" + accessMode: ReadWriteMany + size: 2Gi + mountPath: /dockerdata-nfs + mountSubPath: aai/elasticsearch/data + +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/aai/charts/aai-hbase/.helmignore b/kubernetes/aai/charts/aai-hbase/.helmignore new file mode 100644 index 0000000000..f0c1319444 --- /dev/null +++ b/kubernetes/aai/charts/aai-hbase/.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-hbase/Chart.yaml b/kubernetes/aai/charts/aai-hbase/Chart.yaml new file mode 100644 index 0000000000..eaf6bbdb74 --- /dev/null +++ b/kubernetes/aai/charts/aai-hbase/Chart.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +description: ONAP AAI hbase +name: aai-hbase +version: 2.0.0 diff --git a/kubernetes/aai/charts/aai-hbase/templates/deployment.yaml b/kubernetes/aai/charts/aai-hbase/templates/deployment.yaml new file mode 100644 index 0000000000..4c92dfd4a8 --- /dev/null +++ b/kubernetes/aai/charts/aai-hbase/templates/deployment.yaml @@ -0,0 +1,72 @@ +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 }} + name: {{ include "common.name" . }} + spec: + hostname: aai-hbase + containers: + - name: {{ include "common.name" . }} + image: {{ .Values.global.dockerhubRepository | default .Values.dockerhubRepository }}/{{ .Values.image }} + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + ports: + - containerPort: {{ .Values.service.internalPort }} + - containerPort: {{ .Values.service.internalPort2 }} + - containerPort: {{ .Values.service.internalPort3 }} + - containerPort: {{ .Values.service.internalPort4 }} + - containerPort: {{ .Values.service.internalPort5 }} + - containerPort: {{ .Values.service.internalPort6 }} + - containerPort: {{ .Values.service.internalPort7 }} + # 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 }} + volumeMounts: + - name: hbase-data + mountPath: /tmp + - name: localtime + mountPath: /etc/localtime + readOnly: true + resources: +{{ toYaml .Values.resources | indent 10 }} + {{- if .Values.nodeSelector }} + nodeSelector: +{{ toYaml .Values.nodeSelector | indent 8 }} + {{- end -}} + {{- if .Values.affinity }} + affinity: +{{ toYaml .Values.affinity | indent 8 }} + {{- end }} + + volumes: + - name: hbase-data + hostPath: + path: {{ .Values.persistence.mountPath }}/{{ include "common.namespace" . }}/{{ .Values.persistence.mountSubPath }} + - name: localtime + hostPath: + path: /etc/localtime + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/kubernetes/aai/charts/aai-hbase/templates/service.yaml b/kubernetes/aai/charts/aai-hbase/templates/service.yaml new file mode 100644 index 0000000000..c503e6ca6a --- /dev/null +++ b/kubernetes/aai/charts/aai-hbase/templates/service.yaml @@ -0,0 +1,55 @@ +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 + - port: {{ .Values.service.internalPor3t }} + nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort3 }} + name: {{ .Values.service.name }}3 + - port: {{ .Values.service.internalPort4 }} + nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort4 }} + name: {{ .Values.service.name }}4 + - port: {{ .Values.service.internalPort5 }} + nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort5 }} + name: {{ .Values.service.name }}5 + - port: {{ .Values.service.internalPort6 }} + nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort6 }} + name: {{ .Values.service.name }}6 + - port: {{ .Values.service.internalPort7 }} + nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort7 }} + name: {{ .Values.service.name }}7 + {{- else -}} + - port: {{ .Values.service.internalPort }} + name: {{ .Values.service.name }} + - port: {{ .Values.service.internalPort2 }} + name: {{ .Values.service.name }}2 + - port: {{ .Values.service.internalPort3 }} + name: {{ .Values.service.name }}3 + - port: {{ .Values.service.internalPort4 }} + name: {{ .Values.service.name }}4 + - port: {{ .Values.service.internalPort5 }} + name: {{ .Values.service.name }}5 + - port: {{ .Values.service.internalPort6 }} + name: {{ .Values.service.name }}6 + - port: {{ .Values.service.internalPort7 }} + name: {{ .Values.service.name }}7 + {{- end}} + selector: + app: {{ include "common.name" . }} + release: {{ .Release.Name }} + clusterIP: None diff --git a/kubernetes/aai/charts/aai-hbase/values.yaml b/kubernetes/aai/charts/aai-hbase/values.yaml new file mode 100644 index 0000000000..f1d0c33eff --- /dev/null +++ b/kubernetes/aai/charts/aai-hbase/values.yaml @@ -0,0 +1,92 @@ +# Default values for hbase. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. +global: # global defaults + nodePortPrefix: 302 + repositorySecret: eyJuZXh1czMub25hcC5vcmc6MTAwMDEiOnsidXNlcm5hbWUiOiJkb2NrZXIiLCJwYXNzd29yZCI6ImRvY2tlciIsImVtYWlsIjoiQCIsImF1dGgiOiJaRzlqYTJWeU9tUnZZMnRsY2c9PSJ9fQ== + + +# application image +dockerhubRepository: registry.hub.docker.com +image: aaionap/hbase:1.2.0 +pullPolicy: 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: ClusterIP + name: aai-hbase + internalPort: 2181 + internalPort2: 8080 + internalPort3: 8085 + internalPort4: 9090 + internalPort5: 16000 + internalPort6: 16010 + internalPort7: 16201 + + +ingress: + enabled: false + +persistence: + enabled: true + + ## A manually managed Persistent Volume and Claim + ## Requires persistence.enabled: true + ## If defined, PVC must be created manually before volume will be bound + # existingClaim: + volumeReclaimPolicy: Retain + + ## database data Persistent Volume Storage Class + ## If defined, storageClassName: <storageClass> + ## If set to "-", storageClassName: "", which disables dynamic provisioning + ## If undefined (the default) or set to null, no storageClassName spec is + ## set, choosing the default provisioner. (gp2 on AWS, standard on + ## GKE, AWS & OpenStack) + ## + ## storageClass: "-" + accessMode: ReadWriteMany + size: 2Gi + mountPath: /dockerdata-nfs + mountSubPath: aai/hbase + + +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/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/resources/config/model-loader/appconfig/auth/aai-os-cert.p12 b/kubernetes/aai/charts/aai-modelloader/resources/config/auth/aai-os-cert.p12 Binary files differindex ee57120fa0..ee57120fa0 100644 --- a/kubernetes/aai/resources/config/model-loader/appconfig/auth/aai-os-cert.p12 +++ b/kubernetes/aai/charts/aai-modelloader/resources/config/auth/aai-os-cert.p12 diff --git a/kubernetes/aai/resources/config/log/model-loader/logback.xml b/kubernetes/aai/charts/aai-modelloader/resources/config/log/logback.xml index d512d3b91c..d512d3b91c 100644 --- a/kubernetes/aai/resources/config/log/model-loader/logback.xml +++ b/kubernetes/aai/charts/aai-modelloader/resources/config/log/logback.xml diff --git a/kubernetes/aai/resources/config/model-loader/appconfig/model-loader.properties b/kubernetes/aai/charts/aai-modelloader/resources/config/model-loader.properties index 5d61fbaaae..5604c1f877 100644 --- a/kubernetes/aai/resources/config/model-loader/appconfig/model-loader.properties +++ b/kubernetes/aai/charts/aai-modelloader/resources/config/model-loader.properties @@ -1,6 +1,6 @@ # Model Loader Distribution Client Configuration ml.distribution.ACTIVE_SERVER_TLS_AUTH=false -ml.distribution.ASDC_ADDRESS=sdc-be.{{.Values.nsPrefix}}:8443 +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 @@ -13,7 +13,7 @@ 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-service.{{.Values.nsPrefix}}:8443 +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 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 diff --git a/kubernetes/aai/charts/aai-resources/.helmignore b/kubernetes/aai/charts/aai-resources/.helmignore new file mode 100644 index 0000000000..f0c1319444 --- /dev/null +++ b/kubernetes/aai/charts/aai-resources/.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-resources/Chart.yaml b/kubernetes/aai/charts/aai-resources/Chart.yaml new file mode 100644 index 0000000000..3ab5c1a486 --- /dev/null +++ b/kubernetes/aai/charts/aai-resources/Chart.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +description: ONAP AAI resources +name: aai-resources +version: 2.0.0 diff --git a/kubernetes/aai/resources/config/log/resources/logback.xml b/kubernetes/aai/charts/aai-resources/resources/config/log/logback.xml index 6cfc293f46..6cfc293f46 100644 --- a/kubernetes/aai/resources/config/log/resources/logback.xml +++ b/kubernetes/aai/charts/aai-resources/resources/config/log/logback.xml diff --git a/kubernetes/aai/charts/aai-resources/templates/configmap.yaml b/kubernetes/aai/charts/aai-resources/templates/configmap.yaml new file mode 100644 index 0000000000..97c720a6ab --- /dev/null +++ b/kubernetes/aai/charts/aai-resources/templates/configmap.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }} + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/log/logback.xml").AsConfig . | indent 2 }} diff --git a/kubernetes/aai/templates/aai-resources-deployment.yaml b/kubernetes/aai/charts/aai-resources/templates/deployment.yaml index 332b89045b..6aef4475f7 100644 --- a/kubernetes/aai/templates/aai-resources-deployment.yaml +++ b/kubernetes/aai/charts/aai-resources/templates/deployment.yaml @@ -12,22 +12,27 @@ # See the License for the specific language governing permissions and # limitations under the License. -#{{ if not .Values.disableAaiAaiResources }} apiVersion: extensions/v1beta1 kind: Deployment metadata: - name: aai-resources - namespace: "{{ .Values.nsPrefix }}" + 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.aaiResourceReplicas }} + replicas: {{ .Values.replicaCount }} selector: matchLabels: - app: aai-resources + app: {{ include "common.name" . }} template: metadata: labels: - app: aai-resources - name: aai-resources + app: {{ include "common.name" . }} + release: {{ .Release.Name }} + name: {{ include "common.name" . }} annotations: msb.onap.org/service-info: '[ { @@ -407,7 +412,7 @@ spec: "enable_ssl": true, "lb_policy":"ip_hash", "visualRange": "1" - } + } ]' spec: initContainers: @@ -415,27 +420,27 @@ spec: - /root/ready.py args: - --container-name - - hbase + - aai-hbase env: - name: NAMESPACE valueFrom: fieldRef: apiVersion: v1 fieldPath: metadata.namespace - image: {{ .Values.image.readiness }} - imagePullPolicy: {{ .Values.pullPolicy }} - name: aai-resources-readiness + image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + name: {{ include "common.name" . }}-readiness containers: - - name: aai-resources - image: "{{ .Values.image.aaiResourcesImage }}:{{ .Values.image.aaiResourcesVersion}}" - imagePullPolicy: {{ .Values.pullPolicy }} + - name: {{ include "common.name" . }} + image: "{{ .Values.global.repository | default .Values.repository }}/{{ .Values.image }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} env: - name: CHEF_BRANCH value: master - name: AAI_CHEF_ENV value: simpledemo - name: AAI_CORE_VERSION - value: {{ .Values.aaicoreversion }} + value: {{ .Values.config.aaicoreversion }} - name: AAI_CHEF_LOC value: /var/chef/aai-data/environments - name: CHEF_GIT_URL @@ -457,15 +462,37 @@ spec: name: aai-resources-log-conf subPath: logback.xml ports: - - containerPort: 8447 + - containerPort: {{ .Values.service.internalPort }} + - containerPort: {{ .Values.service.internalPort2 }} + # disable liveness probe when breakpoints set in debugger + # so K8s doesn't restart unresponsive container + {{ if .Values.liveness.enabled }} + livenessProbe: + tcpSocket: + port: {{ .Values.service.internalPort }} + initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} + periodSeconds: {{ .Values.liveness.periodSeconds }} + {{ end }} readinessProbe: tcpSocket: - port: 8447 - initialDelaySeconds: 5 - periodSeconds: 10 - - name: filebeat-onap-aai-resources - image: {{ .Values.image.filebeat }} - imagePullPolicy: {{ .Values.pullPolicy }} + port: {{ .Values.service.internalPort }} + initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} + periodSeconds: {{ .Values.readiness.periodSeconds }} + resources: +{{ toYaml .Values.resources | indent 10 }} + {{- if .Values.nodeSelector }} + nodeSelector: +{{ toYaml .Values.nodeSelector | indent 8 }} + {{- end -}} + {{- if .Values.affinity }} + affinity: +{{ toYaml .Values.affinity | indent 8 }} + {{- 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 subPath: filebeat.yml @@ -474,28 +501,27 @@ spec: name: aai-resources-logs - mountPath: /usr/share/filebeat/data name: aai-resources-filebeat + volumes: - name: localtime hostPath: path: /etc/localtime - name: aai-chef-config configMap: - name: aai-chef-config-configmap + name: aai-chef-config - name: aai-data configMap: - name: aai-resources-environments-configmap + name: aai-resources-environments - name: filebeat-conf configMap: - name: aai-filebeat-configmap + name: aai-filebeat - name: aai-resources-logs emptyDir: {} - name: aai-resources-filebeat emptyDir: {} - name: aai-resources-log-conf configMap: - name: aai-resources-log-configmap - restartPolicy: Always + name: {{ include "common.fullname" . }} + restartPolicy: {{ .Values.global.restartPolicy | default .Values.restartPolicy }} imagePullSecrets: - - name: "{{ .Values.nsPrefix }}-docker-registry-key" -#{{ end }} - + - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/kubernetes/aai/charts/aai-resources/templates/service.yaml b/kubernetes/aai/charts/aai-resources/templates/service.yaml new file mode 100644 index 0000000000..8cea86cf54 --- /dev/null +++ b/kubernetes/aai/charts/aai-resources/templates/service.yaml @@ -0,0 +1,30 @@ +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 }} + clusterIP: None diff --git a/kubernetes/aai/charts/aai-resources/values.yaml b/kubernetes/aai/charts/aai-resources/values.yaml new file mode 100644 index 0000000000..f72e29905f --- /dev/null +++ b/kubernetes/aai/charts/aai-resources/values.yaml @@ -0,0 +1,68 @@ +# Default values for resources. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. +global: # global defaults + nodePortPrefix: 302 + repositorySecret: eyJuZXh1czMub25hcC5vcmc6MTAwMDEiOnsidXNlcm5hbWUiOiJkb2NrZXIiLCJwYXNzd29yZCI6ImRvY2tlciIsImVtYWlsIjoiQCIsImF1dGgiOiJaRzlqYTJWeU9tUnZZMnRsY2c9PSJ9fQ== + readinessRepository: oomk8s + readinessImage: readiness-check:1.1.0 + + +# application image +repository: nexus3.onap.org:10001 +image: openecomp/aai-resources:v1.1.0 +pullPolicy: Always +restartPolicy: Always + +# application configuration +config: + aaicoreversion: 1.1.0-SNAPSHOT + +# default number of instances +replicaCount: 1 + +nodeSelector: {} + +affinity: {} + +# probe configuration parameters +liveness: + initialDelaySeconds: 60 + periodSeconds: 60 + # necessary to disable liveness probe when setting breakpoints + # in debugger so K8s doesn't restart unresponsive container + enabled: false + +readiness: + initialDelaySeconds: 60 + periodSeconds: 10 + + +service: + type: ClusterIP + name: aai-resources + internalPort: 8447 + internalPort2: 5005 + + +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/aai/charts/aai-search-data/.helmignore b/kubernetes/aai/charts/aai-search-data/.helmignore new file mode 100644 index 0000000000..f0c1319444 --- /dev/null +++ b/kubernetes/aai/charts/aai-search-data/.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-search-data/Chart.yaml b/kubernetes/aai/charts/aai-search-data/Chart.yaml new file mode 100644 index 0000000000..da911abb5e --- /dev/null +++ b/kubernetes/aai/charts/aai-search-data/Chart.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +description: ONAP AAI search-data +name: aai-search-data +version: 2.0.0 diff --git a/kubernetes/aai/resources/config/search-data-service/appconfig/analysis-config.json b/kubernetes/aai/charts/aai-search-data/resources/config/analysis-config.json index f98ea3799b..f98ea3799b 100644 --- a/kubernetes/aai/resources/config/search-data-service/appconfig/analysis-config.json +++ b/kubernetes/aai/charts/aai-search-data/resources/config/analysis-config.json diff --git a/kubernetes/aai/resources/config/search-data-service/appconfig/auth/search_policy.json b/kubernetes/aai/charts/aai-search-data/resources/config/auth/search_policy.json index 72d8902fbe..72d8902fbe 100644 --- a/kubernetes/aai/resources/config/search-data-service/appconfig/auth/search_policy.json +++ b/kubernetes/aai/charts/aai-search-data/resources/config/auth/search_policy.json diff --git a/kubernetes/aai/resources/config/search-data-service/appconfig/auth/tomcat_keystore b/kubernetes/aai/charts/aai-search-data/resources/config/auth/tomcat_keystore Binary files differindex 9eec841aa2..9eec841aa2 100644 --- a/kubernetes/aai/resources/config/search-data-service/appconfig/auth/tomcat_keystore +++ b/kubernetes/aai/charts/aai-search-data/resources/config/auth/tomcat_keystore diff --git a/kubernetes/aai/charts/aai-search-data/resources/config/elastic-search.properties b/kubernetes/aai/charts/aai-search-data/resources/config/elastic-search.properties new file mode 100644 index 0000000000..532a9fb2f0 --- /dev/null +++ b/kubernetes/aai/charts/aai-search-data/resources/config/elastic-search.properties @@ -0,0 +1,5 @@ +# ElasticSearch Configuration + +es.cluster-name=ES_AAI +es.ip-address=aai-elasticsearch.{{.Release.Namespace}} +es.http-port={{ .Values.config.elasticsearchHttpPort }} diff --git a/kubernetes/aai/resources/config/search-data-service/appconfig/filter-config.json b/kubernetes/aai/charts/aai-search-data/resources/config/filter-config.json index e2d5285824..e2d5285824 100644 --- a/kubernetes/aai/resources/config/search-data-service/appconfig/filter-config.json +++ b/kubernetes/aai/charts/aai-search-data/resources/config/filter-config.json diff --git a/kubernetes/aai/resources/config/log/search-data-service/logback.xml b/kubernetes/aai/charts/aai-search-data/resources/config/log/logback.xml index 14ed4142fe..14ed4142fe 100644 --- a/kubernetes/aai/resources/config/log/search-data-service/logback.xml +++ b/kubernetes/aai/charts/aai-search-data/resources/config/log/logback.xml diff --git a/kubernetes/aai/charts/aai-search-data/templates/configmap.yaml b/kubernetes/aai/charts/aai-search-data/templates/configmap.yaml new file mode 100644 index 0000000000..0715f0d51a --- /dev/null +++ b/kubernetes/aai/charts/aai-search-data/templates/configmap.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }} + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/*").AsConfig . | indent 2 }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }}-service-log + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/log/logback.xml").AsConfig . | indent 2 }} diff --git a/kubernetes/aai/charts/aai-search-data/templates/deployment.yaml b/kubernetes/aai/charts/aai-search-data/templates/deployment.yaml new file mode 100644 index 0000000000..beaee7d374 --- /dev/null +++ b/kubernetes/aai/charts/aai-search-data/templates/deployment.yaml @@ -0,0 +1,137 @@ +# 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/search-data-service/config/ + - name: KEY_STORE_PASSWORD + value: {{ .Values.config.keyStorePassword }} + - name: KEY_MANAGER_PASSWORD + value: {{ .Values.config.keyManagerPassword }} + volumeMounts: + - mountPath: /etc/localtime + name: localtime + readOnly: true + - mountPath: /opt/app/search-data-service/config/filter-config.json + subPath: filter-config.json + name: {{ include "common.fullname" . }}-service-config + - mountPath: /opt/app/search-data-service/config/elastic-search.properties + subPath: elastic-search.properties + name: {{ include "common.fullname" . }}-service-config + - mountPath: /opt/app/search-data-service/config/analysis-config.json + subPath: filter-config.json + name: {{ include "common.fullname" . }}-service-config + - mountPath: /opt/app/search-data-service/config/auth/tomcat_keystore + subPath: tomcat_keystore + name: {{ include "common.fullname" . }}-service-auth-config + - mountPath: /opt/app/search-data-service/config/auth/search_policy.json + subPath: search_policy.json + name: {{ include "common.fullname" . }}-search-policy-config + - mountPath: /var/log/onap + name: {{ include "common.fullname" . }}-service-logs + - mountPath: /opt/app/search-data-service/bundleconfig/etc/logback.xml + name: {{ include "common.fullname" . }}-service-log-conf + subPath: logback.xml + 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 }} + resources: +{{ toYaml .Values.resources | indent 10 }} + {{- if .Values.nodeSelector }} + nodeSelector: +{{ toYaml .Values.nodeSelector | indent 8 }} + {{- end -}} + {{- if .Values.affinity }} + affinity: +{{ toYaml .Values.affinity | indent 8 }} + {{- 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 + subPath: filebeat.yml + name: filebeat-conf + - mountPath: /var/log/onap + name: {{ include "common.fullname" . }}-service-logs + - mountPath: /usr/share/filebeat/data + name: {{ include "common.fullname" . }}-service-filebeat + + volumes: + - name: localtime + hostPath: + path: /etc/localtime + - name: {{ include "common.fullname" . }}-service-config + configMap: + name: {{ include "common.fullname" . }} + - name: {{ include "common.fullname" . }}-service-auth-config + secret: + secretName: {{ include "common.fullname" . }}-keystone + - name: {{ include "common.fullname" . }}-search-policy-config + secret: + secretName: {{ include "common.fullname" . }}-policy + - name: filebeat-conf + configMap: + name: aai-filebeat + - name: {{ include "common.fullname" . }}-service-logs + emptyDir: {} + - name: {{ include "common.fullname" . }}-service-filebeat + emptyDir: {} + - name: {{ include "common.fullname" . }}-service-log-conf + configMap: + name: {{ include "common.fullname" . }}-service-log + restartPolicy: {{ .Values.global.restartPolicy | default .Values.restartPolicy }} + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/kubernetes/aai/charts/aai-search-data/templates/secret.yaml b/kubernetes/aai/charts/aai-search-data/templates/secret.yaml new file mode 100644 index 0000000000..33b058fc8f --- /dev/null +++ b/kubernetes/aai/charts/aai-search-data/templates/secret.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "common.fullname" . }}-keystone + namespace: {{ include "common.namespace" . }} +type: Opaque +data: +{{ tpl (.Files.Glob "resources/config/auth/tomcat_keystore").AsSecrets . | indent 2 }} +--- +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "common.fullname" . }}-policy + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/auth/search_policy.json").AsSecrets . | indent 2 }} diff --git a/kubernetes/aai/charts/aai-search-data/templates/service.yaml b/kubernetes/aai/charts/aai-search-data/templates/service.yaml new file mode 100644 index 0000000000..41bc163696 --- /dev/null +++ b/kubernetes/aai/charts/aai-search-data/templates/service.yaml @@ -0,0 +1,25 @@ +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 }} + {{- else -}} + - port: {{ .Values.service.internalPort }} + name: {{ .Values.service.name }} + {{- end}} + selector: + app: {{ include "common.name" . }} + release: {{ .Release.Name }} + clusterIP: None diff --git a/kubernetes/aai/charts/aai-search-data/values.yaml b/kubernetes/aai/charts/aai-search-data/values.yaml new file mode 100644 index 0000000000..e7bfa6bdfa --- /dev/null +++ b/kubernetes/aai/charts/aai-search-data/values.yaml @@ -0,0 +1,68 @@ +# Default values for search-data. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. +global: # global defaults + nodePortPrefix: 302 + repositorySecret: eyJuZXh1czMub25hcC5vcmc6MTAwMDEiOnsidXNlcm5hbWUiOiJkb2NrZXIiLCJwYXNzd29yZCI6ImRvY2tlciIsImVtYWlsIjoiQCIsImF1dGgiOiJaRzlqYTJWeU9tUnZZMnRsY2c9PSJ9fQ== + readinessRepository: oomk8s + readinessImage: readiness-check:1.1.0 + + +# application image +repository: nexus3.onap.org:10001 +image: onap/search-data-service:v1.1.0 +pullPolicy: Always +restartPolicy: Always + +# application configuration +config: + elasticsearchHttpPort: 9200 + 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: ClusterIP + name: aai-search-data + internalPort: 9509 + +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/aai/charts/aai-sparky-be/.helmignore b/kubernetes/aai/charts/aai-sparky-be/.helmignore new file mode 100644 index 0000000000..f0c1319444 --- /dev/null +++ b/kubernetes/aai/charts/aai-sparky-be/.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-sparky-be/Chart.yaml b/kubernetes/aai/charts/aai-sparky-be/Chart.yaml new file mode 100644 index 0000000000..4d8a3a496b --- /dev/null +++ b/kubernetes/aai/charts/aai-sparky-be/Chart.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +description: ONAP AAI sparky-be +name: aai-sparky-be +version: 2.0.0 diff --git a/kubernetes/aai/resources/config/sparky-be/appconfig/aai.properties b/kubernetes/aai/charts/aai-sparky-be/resources/config/aai.properties index aaca346760..813a263d90 100644 --- a/kubernetes/aai/resources/config/sparky-be/appconfig/aai.properties +++ b/kubernetes/aai/charts/aai-sparky-be/resources/config/aai.properties @@ -6,7 +6,7 @@ # # The ip address/hostname and port to the desired AAI instance # -aai.rest.host=aai-service.{{.Values.nsPrefix}} +aai.rest.host=aai.{{.Release.Namespace}} aai.rest.port=8443 ############################## REST ############################## diff --git a/kubernetes/aai/resources/config/sparky-be/appconfig/auth/aai-os-cert.p12 b/kubernetes/aai/charts/aai-sparky-be/resources/config/auth/aai-os-cert.p12 Binary files differindex ee57120fa0..ee57120fa0 100644 --- a/kubernetes/aai/resources/config/sparky-be/appconfig/auth/aai-os-cert.p12 +++ b/kubernetes/aai/charts/aai-sparky-be/resources/config/auth/aai-os-cert.p12 diff --git a/kubernetes/aai/resources/config/sparky-be/appconfig/auth/client-cert-onap.p12 b/kubernetes/aai/charts/aai-sparky-be/resources/config/auth/client-cert-onap.p12 Binary files differindex dbf4fcacec..dbf4fcacec 100644 --- a/kubernetes/aai/resources/config/sparky-be/appconfig/auth/client-cert-onap.p12 +++ b/kubernetes/aai/charts/aai-sparky-be/resources/config/auth/client-cert-onap.p12 diff --git a/kubernetes/aai/resources/config/sparky-be/appconfig/auth/inventory-ui-keystore b/kubernetes/aai/charts/aai-sparky-be/resources/config/auth/inventory-ui-keystore Binary files differindex efa01f8d79..efa01f8d79 100644 --- a/kubernetes/aai/resources/config/sparky-be/appconfig/auth/inventory-ui-keystore +++ b/kubernetes/aai/charts/aai-sparky-be/resources/config/auth/inventory-ui-keystore diff --git a/kubernetes/aai/resources/config/sparky-be/appconfig/elasticsearch.properties b/kubernetes/aai/charts/aai-sparky-be/resources/config/elasticsearch.properties index 99aea27d9e..082744b94e 100644 --- a/kubernetes/aai/resources/config/sparky-be/appconfig/elasticsearch.properties +++ b/kubernetes/aai/charts/aai-sparky-be/resources/config/elasticsearch.properties @@ -7,8 +7,8 @@ # The ip address/hostname and port to the desired AAI instance # For development it's recommended to use a local instance of ES # -elasticsearch.ipAddress=aai-elasticsearch.{{.Values.nsPrefix}} -elasticsearch.httpPort=9200 +elasticsearch.ipAddress=aai-elasticsearch.{{.Release.Namespace}} +elasticsearch.httpPort={{ .Values.config.elasticsearchHttpPort }} elasticsearch.javaApiPort=8443 ############################## Indexes ############################## diff --git a/kubernetes/aai/resources/config/log/sparky-be/logback.xml b/kubernetes/aai/charts/aai-sparky-be/resources/config/log/logback.xml index c1b99c183f..c1b99c183f 100644 --- a/kubernetes/aai/resources/config/log/sparky-be/logback.xml +++ b/kubernetes/aai/charts/aai-sparky-be/resources/config/log/logback.xml diff --git a/kubernetes/aai/resources/config/sparky-be/appconfig/model/aai_oxm_v9.xml b/kubernetes/aai/charts/aai-sparky-be/resources/config/model/aai_oxm_v9.xml index 6337c32edc..6337c32edc 100644 --- a/kubernetes/aai/resources/config/sparky-be/appconfig/model/aai_oxm_v9.xml +++ b/kubernetes/aai/charts/aai-sparky-be/resources/config/model/aai_oxm_v9.xml diff --git a/kubernetes/aai/resources/config/sparky-be/appconfig/portal/portal-authentication.properties b/kubernetes/aai/charts/aai-sparky-be/resources/config/portal/portal-authentication.properties index 0873fc1c61..0873fc1c61 100644 --- a/kubernetes/aai/resources/config/sparky-be/appconfig/portal/portal-authentication.properties +++ b/kubernetes/aai/charts/aai-sparky-be/resources/config/portal/portal-authentication.properties diff --git a/kubernetes/aai/resources/config/sparky-be/appconfig/portal/portal.properties b/kubernetes/aai/charts/aai-sparky-be/resources/config/portal/portal.properties index 90147362b0..04a19555e2 100644 --- a/kubernetes/aai/resources/config/sparky-be/appconfig/portal/portal.properties +++ b/kubernetes/aai/charts/aai-sparky-be/resources/config/portal/portal.properties @@ -7,10 +7,10 @@ portal.api.impl.class = org.openecomp.sparky.security.portal.PortalRestAPIServic # Instance of ECOMP Portal where the app has been on-boarded # use insecure http for dev purposes to avoid self-signed certificate -ecomp_rest_url = http://portalapps.{{.Values.nsPrefix}}:8989/ONAPPORTAL/auxapi +ecomp_rest_url = http://portalapps.{{.Release.Namespace}}:8989/ONAPPORTAL/auxapi # Standard global logon page -ecomp_redirect_url = http://portalapps.{{.Values.nsPrefix}}:8989/ONAPPORTAL/login.htm +ecomp_redirect_url = http://portalapps.{{.Release.Namespace}}:8989/ONAPPORTAL/login.htm # Name of cookie to extract on login request csp_cookie_name = EPService diff --git a/kubernetes/aai/resources/config/sparky-be/appconfig/roles.config b/kubernetes/aai/charts/aai-sparky-be/resources/config/roles.config index b8313bd378..b8313bd378 100644 --- a/kubernetes/aai/resources/config/sparky-be/appconfig/roles.config +++ b/kubernetes/aai/charts/aai-sparky-be/resources/config/roles.config diff --git a/kubernetes/aai/resources/config/sparky-be/appconfig/search-service.properties b/kubernetes/aai/charts/aai-sparky-be/resources/config/search-service.properties index 57e34759d3..f28047333a 100644 --- a/kubernetes/aai/resources/config/sparky-be/appconfig/search-service.properties +++ b/kubernetes/aai/charts/aai-sparky-be/resources/config/search-service.properties @@ -6,7 +6,7 @@ # # The ip address/hostname and port to the desired Search Data Service instance # -search-service.ipAddress=search-data-service.{{.Values.nsPrefix}} +search-service.ipAddress=aai-search-data.{{.Release.Namespace}} search-service.httpPort=9509 ############################## Indexes ############################## diff --git a/kubernetes/aai/resources/config/sparky-be/appconfig/suggestive-search.properties b/kubernetes/aai/charts/aai-sparky-be/resources/config/suggestive-search.properties index b82baffc14..b82baffc14 100644 --- a/kubernetes/aai/resources/config/sparky-be/appconfig/suggestive-search.properties +++ b/kubernetes/aai/charts/aai-sparky-be/resources/config/suggestive-search.properties diff --git a/kubernetes/aai/resources/config/sparky-be/appconfig/synchronizer.properties b/kubernetes/aai/charts/aai-sparky-be/resources/config/synchronizer.properties index 0b84f06abe..0b84f06abe 100644 --- a/kubernetes/aai/resources/config/sparky-be/appconfig/synchronizer.properties +++ b/kubernetes/aai/charts/aai-sparky-be/resources/config/synchronizer.properties diff --git a/kubernetes/aai/charts/aai-sparky-be/templates/configmap.yaml b/kubernetes/aai/charts/aai-sparky-be/templates/configmap.yaml new file mode 100644 index 0000000000..68fa1e4966 --- /dev/null +++ b/kubernetes/aai/charts/aai-sparky-be/templates/configmap.yaml @@ -0,0 +1,31 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }} + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/*").AsConfig . | indent 2 }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }}-model + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/model/*").AsConfig . | indent 2 }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }}-portal + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/portal/*").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-sparky-be/templates/deployment.yaml b/kubernetes/aai/charts/aai-sparky-be/templates/deployment.yaml new file mode 100644 index 0000000000..278a32728e --- /dev/null +++ b/kubernetes/aai/charts/aai-sparky-be/templates/deployment.yaml @@ -0,0 +1,149 @@ +# 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/sparky/config/ + - name: KEY_MANAGER_PASSWORD + value: {{ .Values.config.keyManagerPassword }} + - name: KEY_STORE_PASSWORD + value: {{ .Values.config.keyStorePassword }} + volumeMounts: + - mountPath: /etc/localtime + name: localtime + readOnly: true + - mountPath: /opt/app/sparky/config/auth/ + name: {{ include "common.fullname" . }}-auth-config + - mountPath: /opt/app/sparky/config/synchronizer.properties + subPath: synchronizer.properties + name: {{ include "common.fullname" . }}-config + - mountPath: /opt/app/sparky/config/suggestive-search.properties + subPath: suggestive-search.properties + name: {{ include "common.fullname" . }}-config + - mountPath: /opt/app/sparky/config/search-service.properties + subPath: search-service.properties + name: {{ include "common.fullname" . }}-config + - mountPath: /opt/app/sparky/config/roles.config + subPath: roles.config + name: {{ include "common.fullname" . }}-config + - mountPath: /opt/app/sparky/config/elasticsearch.properties + subPath: elasticsearch.properties + name: {{ include "common.fullname" . }}-config + - mountPath: /opt/app/sparky/config/aai.properties + subPath: aai.properties + name: {{ include "common.fullname" . }}-config + - mountPath: /opt/app/sparky/config/model/ + name: {{ include "common.fullname" . }}-model-config + - mountPath: /opt/app/sparky/config/portal/ + name: {{ include "common.fullname" . }}-portal-config + - mountPath: /var/log/onap + name: {{ include "common.fullname" . }}-logs + - mountPath: /opt/app/sparky/bundleconfig/etc/logback.xml + name: {{ include "common.fullname" . }}-log-conf + subPath: logback.xml + 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 }} + resources: +{{ toYaml .Values.resources | indent 10 }} + {{- if .Values.nodeSelector }} + nodeSelector: +{{ toYaml .Values.nodeSelector | indent 8 }} + {{- end -}} + {{- if .Values.affinity }} + affinity: +{{ toYaml .Values.affinity | indent 8 }} + {{- 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 + subPath: filebeat.yml + name: filebeat-conf + - mountPath: /var/log/onap + name: {{ include "common.fullname" . }}-logs + - mountPath: /usr/share/filebeat/data + name: aai-sparky-filebeat + + volumes: + - name: localtime + hostPath: + path: /etc/localtime + - name: {{ include "common.fullname" . }}-config + configMap: + name: {{ include "common.fullname" . }} + - name: {{ include "common.fullname" . }}-model-config + configMap: + name: {{ include "common.fullname" . }}-model + - name: {{ include "common.fullname" . }}-portal-config + configMap: + name: {{ include "common.fullname" . }}-portal + - 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-sparky-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-sparky-be/templates/secret.yaml b/kubernetes/aai/charts/aai-sparky-be/templates/secret.yaml new file mode 100644 index 0000000000..69bd3f86de --- /dev/null +++ b/kubernetes/aai/charts/aai-sparky-be/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-sparky-be/templates/service.yaml b/kubernetes/aai/charts/aai-sparky-be/templates/service.yaml new file mode 100644 index 0000000000..41bc163696 --- /dev/null +++ b/kubernetes/aai/charts/aai-sparky-be/templates/service.yaml @@ -0,0 +1,25 @@ +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 }} + {{- else -}} + - port: {{ .Values.service.internalPort }} + name: {{ .Values.service.name }} + {{- end}} + selector: + app: {{ include "common.name" . }} + release: {{ .Release.Name }} + clusterIP: None diff --git a/kubernetes/aai/charts/aai-sparky-be/values.yaml b/kubernetes/aai/charts/aai-sparky-be/values.yaml new file mode 100644 index 0000000000..34be1befb2 --- /dev/null +++ b/kubernetes/aai/charts/aai-sparky-be/values.yaml @@ -0,0 +1,70 @@ +# Default values for sparky-be. +# 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/sparky-be:v1.1.0 +pullPolicy: Always +restartPolicy: Always + +# application configuration +config: + elasticsearchHttpPort: 9200 + keyStorePassword: OBF:1i9a1u2a1unz1lr61wn51wn11lss1unz1u301i6o + keyManagerPassword: OBF:1i9a1u2a1unz1lr61wn51wn11lss1unz1u301i6o + +# override chart name (sparky-be) to share a common namespace +# suffix with parent chart (aai) +nsSuffix: aai + + +# 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: ClusterIP + name: aai-sparky-be + internalPort: 9517 + +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/aai/charts/aai-traversal/.helmignore b/kubernetes/aai/charts/aai-traversal/.helmignore new file mode 100644 index 0000000000..f0c1319444 --- /dev/null +++ b/kubernetes/aai/charts/aai-traversal/.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-traversal/Chart.yaml b/kubernetes/aai/charts/aai-traversal/Chart.yaml new file mode 100644 index 0000000000..8f79b421c3 --- /dev/null +++ b/kubernetes/aai/charts/aai-traversal/Chart.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +description: ONAP AAI traversal +name: aai-traversal +version: 2.0.0 diff --git a/kubernetes/aai/resources/config/log/traversal/logback.xml b/kubernetes/aai/charts/aai-traversal/resources/config/log/logback.xml index fb8d8a53bf..fb8d8a53bf 100644 --- a/kubernetes/aai/resources/config/log/traversal/logback.xml +++ b/kubernetes/aai/charts/aai-traversal/resources/config/log/logback.xml diff --git a/kubernetes/aai/charts/aai-traversal/templates/configmap.yaml b/kubernetes/aai/charts/aai-traversal/templates/configmap.yaml new file mode 100644 index 0000000000..a7e9428a88 --- /dev/null +++ b/kubernetes/aai/charts/aai-traversal/templates/configmap.yaml @@ -0,0 +1,7 @@ +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/templates/aai-traversal-deployment.yaml b/kubernetes/aai/charts/aai-traversal/templates/deployment.yaml index f039d0f332..b4249aede1 100644 --- a/kubernetes/aai/templates/aai-traversal-deployment.yaml +++ b/kubernetes/aai/charts/aai-traversal/templates/deployment.yaml @@ -12,22 +12,27 @@ # See the License for the specific language governing permissions and # limitations under the License. -#{{ if not .Values.disableAaiAaiTraversal }} apiVersion: extensions/v1beta1 kind: Deployment metadata: - name: aai-traversal - namespace: "{{ .Values.nsPrefix }}" + 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.aaiTraversalReplicas }} + replicas: {{ .Values.replicaCount }} selector: matchLabels: - app: aai-traversal + app: {{ include "common.name" . }} template: metadata: labels: - app: aai-traversal - name: aai-traversal + app: {{ include "common.name" . }} + release: {{ .Release.Name }} + name: {{ include "common.name" . }} annotations: msb.onap.org/service-info: '[ { @@ -245,8 +250,6 @@ spec: - /root/ready.py args: - --container-name - - hbase - - --container-name - aai-resources env: - name: NAMESPACE @@ -254,26 +257,26 @@ spec: fieldRef: apiVersion: v1 fieldPath: metadata.namespace - image: {{ .Values.image.readiness }} - imagePullPolicy: {{ .Values.pullPolicy }} - name: aai-traversal-readiness + image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + name: {{ include "common.name" . }}-readiness containers: - - name: aai-traversal - image: "{{ .Values.image.aaiTraversalImage }}:{{ .Values.image.aaiTraversalVersion }}" - imagePullPolicy: {{ .Values.pullPolicy }} + - name: {{ include "common.name" . }} + image: "{{ .Values.global.repository | default .Values.repository }}/{{ .Values.image }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} env: - name: CHEF_BRANCH value: master - name: AAI_CHEF_ENV value: simpledemo - name: AAI_CORE_VERSION - value: {{ .Values.aaicoreversion }} + value: {{ .Values.config.aaicoreversion }} - name: AAI_CHEF_LOC value: /var/chef/aai-data/environments - name: CHEF_GIT_URL value: http://gerrit.onap.org/r/aai - name: RESOURCES_HOSTNAME - value: aai-resources.{{ .Values.nsPrefix }} + value: aai-resources.{{ include "common.namespace" . }} volumeMounts: - mountPath: /etc/localtime name: localtime @@ -289,15 +292,37 @@ spec: name: aai-traversal-log-conf subPath: logback.xml ports: - - containerPort: 8446 + - containerPort: {{ .Values.service.internalPort }} + - containerPort: {{ .Values.service.internalPort2 }} + # disable liveness probe when breakpoints set in debugger + # so K8s doesn't restart unresponsive container + {{ if .Values.liveness.enabled }} + livenessProbe: + tcpSocket: + port: {{ .Values.service.internalPort }} + initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} + periodSeconds: {{ .Values.liveness.periodSeconds }} + {{ end }} readinessProbe: tcpSocket: - port: 8446 - initialDelaySeconds: 5 - periodSeconds: 10 - - name: filebeat-onap-aai-traversal - image: {{ .Values.image.filebeat }} - imagePullPolicy: {{ .Values.pullPolicy }} + port: {{ .Values.service.internalPort }} + initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} + periodSeconds: {{ .Values.readiness.periodSeconds }} + resources: +{{ toYaml .Values.resources | indent 10 }} + {{- if .Values.nodeSelector }} + nodeSelector: +{{ toYaml .Values.nodeSelector | indent 8 }} + {{- end -}} + {{- if .Values.affinity }} + affinity: +{{ toYaml .Values.affinity | indent 8 }} + {{- 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 subPath: filebeat.yml @@ -306,28 +331,27 @@ spec: name: aai-traversal-logs - mountPath: /usr/share/filebeat/data name: aai-traversal-filebeat + volumes: - name: localtime hostPath: path: /etc/localtime - name: aai-chef-config configMap: - name: aai-chef-config-configmap + name: aai-chef-config - name: aai-data configMap: - name: aai-resources-environments-configmap + name: aai-resources-environments - name: filebeat-conf configMap: - name: aai-filebeat-configmap + name: aai-filebeat - name: aai-traversal-logs emptyDir: {} - name: aai-traversal-filebeat emptyDir: {} - name: aai-traversal-log-conf configMap: - name: aai-traversal-log-configmap - restartPolicy: Always + name: {{ include "common.fullname" . }}-log + restartPolicy: {{ .Values.global.restartPolicy | default .Values.restartPolicy }} imagePullSecrets: - - name: "{{ .Values.nsPrefix }}-docker-registry-key" -#{{ end }} - + - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/kubernetes/aai/charts/aai-traversal/templates/service.yaml b/kubernetes/aai/charts/aai-traversal/templates/service.yaml new file mode 100644 index 0000000000..8cea86cf54 --- /dev/null +++ b/kubernetes/aai/charts/aai-traversal/templates/service.yaml @@ -0,0 +1,30 @@ +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 }} + clusterIP: None diff --git a/kubernetes/aai/charts/aai-traversal/values.yaml b/kubernetes/aai/charts/aai-traversal/values.yaml new file mode 100644 index 0000000000..17640338d1 --- /dev/null +++ b/kubernetes/aai/charts/aai-traversal/values.yaml @@ -0,0 +1,67 @@ +# Default values for traversal. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. +global: # global defaults + nodePortPrefix: 302 + repositorySecret: eyJuZXh1czMub25hcC5vcmc6MTAwMDEiOnsidXNlcm5hbWUiOiJkb2NrZXIiLCJwYXNzd29yZCI6ImRvY2tlciIsImVtYWlsIjoiQCIsImF1dGgiOiJaRzlqYTJWeU9tUnZZMnRsY2c9PSJ9fQ== + readinessRepository: oomk8s + readinessImage: readiness-check:1.1.0 + + +# application image +repository: nexus3.onap.org:10001 +image: openecomp/aai-traversal:v1.1.0 +pullPolicy: Always +restartPolicy: Always + +# application configuration +config: + aaicoreversion: 1.1.0-SNAPSHOT + + +# default number of instances +replicaCount: 1 + +nodeSelector: {} + +affinity: {} + +# probe configuration parameters +liveness: + initialDelaySeconds: 60 + periodSeconds: 60 + # 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: ClusterIP + name: aai-traversal + internalPort: 8446 + internalPort2: 5005 + +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/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/esr/templates/esr-filebeat-configmap.yaml b/kubernetes/aai/charts/champ/templates/configmap.yaml index 5f9ee9c217..8f48f199f8 100644 --- a/kubernetes/esr/templates/esr-filebeat-configmap.yaml +++ b/kubernetes/aai/charts/champ/templates/configmap.yaml @@ -1,4 +1,4 @@ -# Copyright © 2017 Amdocs, Bell Canada +# 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. @@ -12,12 +12,18 @@ # 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 }} + name: {{ include "common.fullname" . }}-configmap + namespace: {{ include "common.namespace" . }} data: -{{ tpl (.Files.Glob "resources/config/log/filebeat/*").AsConfig . | indent 2 }} -#{{ end }} +{{ 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/aai/requirements.yaml b/kubernetes/aai/requirements.yaml new file mode 100644 index 0000000000..56029ab047 --- /dev/null +++ b/kubernetes/aai/requirements.yaml @@ -0,0 +1,7 @@ +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'
\ No newline at end of file diff --git a/kubernetes/aai/resources/config/aai-data/environments/simpledemo.json b/kubernetes/aai/resources/config/aai-data/environments/simpledemo.json index 7b299f7a39..9795975c16 100644 --- a/kubernetes/aai/resources/config/aai-data/environments/simpledemo.json +++ b/kubernetes/aai/resources/config/aai-data/environments/simpledemo.json @@ -33,16 +33,16 @@ "PROJECT_HOME": "/opt/app/aai-traversal", "LOGROOT": "/opt/aai/logroot", "JAVA_HOME": "/usr/lib/jvm/java-8-openjdk-amd64", - "AAI_SERVER_URL_BASE": "https://aai-servicei.{{.Values.nsPrefix}}:8443/aai/", - "AAI_SERVER_URL": "https://aai-service.{{.Values.nsPrefix}}:8443/aai/v11/", - "AAI_GLOBAL_CALLBACK_URL": "https://aai-service.{{.Values.nsPrefix}}:8443/aai/", + "AAI_SERVER_URL_BASE": "https:/aai.{{.Release.Namespace}}:8443/aai/", + "AAI_SERVER_URL": "https:/aai.{{.Release.Namespace}}:8443/aai/v11/", + "AAI_GLOBAL_CALLBACK_URL": "https:/aai.{{.Release.Namespace}}:8443/aai/", "AAI_TRUSTSTORE_FILENAME": "aai_keystore", "AAI_TRUSTSTORE_PASSWD_X": "OBF:1vn21ugu1saj1v9i1v941sar1ugw1vo0", "AAI_KEYSTORE_FILENAME": "aai_keystore", "AAI_KEYSTORE_PASSWD_X": "OBF:1vn21ugu1saj1v9i1v941sar1ugw1vo0", - "APPLICATION_SERVERS": "aai-service.{{.Values.nsPrefix}}", + "APPLICATION_SERVERS": "aai.{{.Release.Namespace}}", "AAI_DMAAP_PROTOCOL": "http", - "AAI_DMAAP_HOST_PORT": "dmaap.{{.Values.nsPrefix}}:3904", + "AAI_DMAAP_HOST_PORT": "dmaap.{{.Release.Namespace}}:3904", "AAI_DMAAP_TOPIC_NAME": "AAI-EVENT", "AAI_NOTIFICATION_EVENT_DEFAULT_EVENT_STATUS": "UNPROCESSED", "AAI_NOTIFICATION_EVENT_DEFAULT_EVENT_TYPE": "AAI-EVENT", @@ -54,11 +54,11 @@ "AAI_NOTIFICATION_CURRENT_VERSION": "v11", "RESOURCE_VERSION_ENABLE_FLAG": "true", "TXN_HBASE_TABLE_NAME": "aailogging.dev", - "TXN_ZOOKEEPER_QUORUM": "hbase.{{.Values.nsPrefix}}", + "TXN_ZOOKEEPER_QUORUM": "aai-hbase.{{.Release.Namespace}}", "TXN_ZOOKEEPER_PROPERTY_CLIENTPORT": "2181", "TXN_HBASE_ZOOKEEPER_ZNODE_PARENT": "/hbase", "AAI_WORKLOAD_PREFERRED_ROUTE_KEY": "MR1", - "STORAGE_HOSTNAME": "hbase.{{.Values.nsPrefix}}", + "STORAGE_HOSTNAME": "aai-hbase.{{.Release.Namespace}}", "STORAGE_HBASE_TABLE": "aaigraph.dev", "STORAGE_HBASE_ZOOKEEPER_ZNODE_PARENT": "/hbase", "DB_CACHE_CLEAN_WAIT": "20", @@ -85,16 +85,16 @@ "PROJECT_HOME": "/opt/app/aai-resources", "LOGROOT": "/opt/aai/logroot", "JAVA_HOME": "/usr/lib/jvm/java-8-openjdk-amd64", - "AAI_SERVER_URL_BASE": "https://aai-service.{{.Values.nsPrefix}}:8443/aai/", - "AAI_SERVER_URL": "https://aai-service.{{.Values.nsPrefix}}:8443/aai/v11/", - "AAI_GLOBAL_CALLBACK_URL": "https://aai-service.{{.Values.nsPrefix}}:8443/aai/", + "AAI_SERVER_URL_BASE": "https:/aai.{{.Release.Namespace}}:8443/aai/", + "AAI_SERVER_URL": "https:/aai.{{.Release.Namespace}}:8443/aai/v11/", + "AAI_GLOBAL_CALLBACK_URL": "https:/aai.{{.Release.Namespace}}:8443/aai/", "AAI_TRUSTSTORE_FILENAME": "aai_keystore", "AAI_TRUSTSTORE_PASSWD_X": "OBF:1vn21ugu1saj1v9i1v941sar1ugw1vo0", "AAI_KEYSTORE_FILENAME": "aai_keystore", "AAI_KEYSTORE_PASSWD_X": "OBF:1vn21ugu1saj1v9i1v941sar1ugw1vo0", - "APPLICATION_SERVERS": "aai-service.{{.Values.nsPrefix}}", + "APPLICATION_SERVERS": "aai.{{.Release.Namespace}}", "AAI_DMAAP_PROTOCOL": "http", - "AAI_DMAAP_HOST_PORT": "dmaap.{{.Values.nsPrefix}}:3904", + "AAI_DMAAP_HOST_PORT": "dmaap.{{.Release.Namespace}}:3904", "AAI_DMAAP_TOPIC_NAME": "AAI-EVENT", "AAI_NOTIFICATION_EVENT_DEFAULT_EVENT_STATUS": "UNPROCESSED", "AAI_NOTIFICATION_EVENT_DEFAULT_EVENT_TYPE": "AAI-EVENT", @@ -106,11 +106,11 @@ "AAI_NOTIFICATION_CURRENT_VERSION": "v11", "RESOURCE_VERSION_ENABLE_FLAG": "true", "TXN_HBASE_TABLE_NAME": "aailogging.dev", - "TXN_ZOOKEEPER_QUORUM": "hbase.{{.Values.nsPrefix}}", + "TXN_ZOOKEEPER_QUORUM": "aai-hbase.{{.Release.Namespace}}", "TXN_ZOOKEEPER_PROPERTY_CLIENTPORT": "2181", "TXN_HBASE_ZOOKEEPER_ZNODE_PARENT": "/hbase", "AAI_WORKLOAD_PREFERRED_ROUTE_KEY": "MR1", - "STORAGE_HOSTNAME": "hbase.{{.Values.nsPrefix}}", + "STORAGE_HOSTNAME": "aai-hbase.{{.Release.Namespace}}", "STORAGE_HBASE_TABLE": "aaigraph.dev", "STORAGE_HBASE_ZOOKEEPER_ZNODE_PARENT": "/hbase", "DB_CACHE_CLEAN_WAIT": "20", diff --git a/kubernetes/aai/resources/config/haproxy/haproxy.cfg b/kubernetes/aai/resources/config/haproxy/haproxy.cfg index 6e6f489470..b9721ae41a 100644 --- a/kubernetes/aai/resources/config/haproxy/haproxy.cfg +++ b/kubernetes/aai/resources/config/haproxy/haproxy.cfg @@ -95,7 +95,7 @@ backend IST_Default_8447 balance roundrobin http-request set-header X-Forwarded-Port %[src_port] http-response set-header Strict-Transport-Security max-age=16000000;\ includeSubDomains;\ preload; - server aai-resources.{{.Values.nsPrefix}} aai-resources.{{.Values.nsPrefix}}:8447 port 8447 ssl verify none + server aai-resources.{{.Release.Namespace}} aai-resources.{{.Release.Namespace}}:8447 port 8447 ssl verify none ####################### # BACKEND 8446######### @@ -105,7 +105,7 @@ backend IST_AAI_8446 balance roundrobin http-request set-header X-Forwarded-Port %[src_port] http-response set-header Strict-Transport-Security max-age=16000000;\ includeSubDomains;\ preload; - server aai-traversal.{{.Values.nsPrefix}} aai-traversal.{{.Values.nsPrefix}}:8446 port 8446 ssl verify none + server aai-traversal.{{.Release.Namespace}} aai-traversal.{{.Release.Namespace}}:8446 port 8446 ssl verify none listen IST_AAI_STATS mode http @@ -118,4 +118,3 @@ listen IST_AAI_STATS stats show-legends stats show-desc IST AAI APPLICATION NODES stats admin if TRUE - diff --git a/kubernetes/aai/resources/config/log/filebeat/filebeat.yml b/kubernetes/aai/resources/config/log/filebeat/filebeat.yml index 89c6932577..b0d4690754 100644 --- a/kubernetes/aai/resources/config/log/filebeat/filebeat.yml +++ b/kubernetes/aai/resources/config/log/filebeat/filebeat.yml @@ -21,7 +21,7 @@ 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.{{.Values.nsPrefix}}:5044"] + hosts: ["{{.Values.config.logstashServiceName}}.{{.Release.Namespace}}:{{.Values.config.logstashPort}}"] #If enable will do load balancing among availabe Logstash, automatically. loadbalance: true diff --git a/kubernetes/aai/resources/config/search-data-service/appconfig/elastic-search.properties b/kubernetes/aai/resources/config/search-data-service/appconfig/elastic-search.properties deleted file mode 100644 index c19667ad3c..0000000000 --- a/kubernetes/aai/resources/config/search-data-service/appconfig/elastic-search.properties +++ /dev/null @@ -1,5 +0,0 @@ -# ElasticSearch Configuration - -es.cluster-name=ES_AAI -es.ip-address=aai-elasticsearch.{{.Values.nsPrefix}} -es.http-port=9200 diff --git a/kubernetes/aai/templates/aai-deployment.yaml b/kubernetes/aai/templates/aai-deployment.yaml deleted file mode 100644 index 1b32463735..0000000000 --- a/kubernetes/aai/templates/aai-deployment.yaml +++ /dev/null @@ -1,83 +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.disableAaiAaiService }} -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: aai-service - namespace: "{{ .Values.nsPrefix }}" -spec: - replicas: {{ .Values.aaiServiceReplicas }} - selector: - matchLabels: - app: aai-service - template: - metadata: - labels: - app: aai-service - name: aai-service - spec: - initContainers: - - command: - - /root/ready.py - args: - - --container-name - - aai-resources - - --container-name - - aai-traversal - env: - - name: NAMESPACE - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: metadata.namespace - image: {{ .Values.image.readiness }} - imagePullPolicy: {{ .Values.pullPolicy }} - name: aai-service-readiness - containers: - - name: aai-service - image: "{{ .Values.image.aaiProxy }}:{{ .Values.image.aaiProxyVersion}}" - imagePullPolicy: {{ .Values.pullPolicy }} - volumeMounts: - - mountPath: /etc/localtime - name: localtime - readOnly: true - - mountPath: /dev/log - name: aai-service-log - - mountPath: /usr/local/etc/haproxy/haproxy.cfg - subPath: haproxy.cfg - name: haproxy-cfg - ports: - - containerPort: 8080 - - containerPort: 8443 - readinessProbe: - tcpSocket: - port: 8443 - initialDelaySeconds: 5 - periodSeconds: 10 - volumes: - - name: localtime - hostPath: - path: /etc/localtime - - name: aai-service-log - hostPath: - path: "/dev/log" - - name: haproxy-cfg - configMap: - name: aai-deployment-configmap - restartPolicy: Always - imagePullSecrets: - - name: "{{ .Values.nsPrefix }}-docker-registry-key" -#{{ end }} diff --git a/kubernetes/aai/templates/aai-resources-traversal-configmap.yaml b/kubernetes/aai/templates/aai-resources-traversal-configmap.yaml deleted file mode 100644 index 32055c47c8..0000000000 --- a/kubernetes/aai/templates/aai-resources-traversal-configmap.yaml +++ /dev/null @@ -1,47 +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.disableAaiAaiResources }} -apiVersion: v1 -kind: ConfigMap -metadata: - name: aai-chef-config-configmap - namespace: {{ .Values.nsPrefix }} -data: -{{ tpl (.Files.Glob "resources/config/aai-data/chef-config/dev/.knife/solo.rb").AsConfig . | indent 2 }} ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: aai-resources-environments-configmap - namespace: {{ .Values.nsPrefix }} -data: -{{ tpl (.Files.Glob "resources/config/aai-data/environments/*").AsConfig . | indent 2 }} ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: aai-resources-log-configmap - namespace: {{ .Values.nsPrefix }} -data: -{{ tpl (.Files.Glob "resources/config/log/resources/logback.xml").AsConfig . | indent 2 }} ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: aai-traversal-log-configmap - namespace: {{ .Values.nsPrefix }} -data: -{{ tpl (.Files.Glob "resources/config/log/traversal/logback.xml").AsConfig . | indent 2 }} -#{{ end }} diff --git a/kubernetes/aai/templates/all-services.yaml b/kubernetes/aai/templates/all-services.yaml deleted file mode 100644 index 39739de723..0000000000 --- a/kubernetes/aai/templates/all-services.yaml +++ /dev/null @@ -1,191 +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.disableAaiHbase }} -apiVersion: v1 -kind: Service -metadata: - name: hbase - namespace: "{{ .Values.nsPrefix }}" - labels: - app: hbase -spec: - ports: - - name: "hbase-port-1" - port: 2181 - - name: "hbase-port-2" - port: 8080 - - name: "hbase-port-3" - port: 8085 - - name: "hbase-port-4" - port: 9090 - - name: "hbase-port-5" - port: 16000 - - name: "hbase-port-6" - port: 16010 - - name: "hbase-port-7" - port: 16201 - selector: - app: hbase - clusterIP: None -#{{ end }} -#{{ if not .Values.disableAaiAaiService }} ---- -apiVersion: v1 -kind: Service -metadata: - name: aai-service - namespace: "{{ .Values.nsPrefix }}" - labels: - app: aai-service -spec: - ports: - - name: "aai-service-port-8443" - port: 8443 - targetPort: 8443 - nodePort: {{ .Values.nodePortPrefix }}33 - - name: "aai-service-port-8080" - port: 8080 - targetPort: 8080 - nodePort: {{ .Values.nodePortPrefix }}32 - type: NodePort - selector: - app: aai-service - clusterIP: {{ .Values.aaiServiceClusterIp }} -#{{ end }} -#{{ if not .Values.disableAaiModelLoaderService }} ---- -apiVersion: v1 -kind: Service -metadata: - name: model-loader-service - namespace: "{{ .Values.nsPrefix }}" - labels: - app: model-loader-service -spec: - ports: - - name: "model-loader-service-port-8443" - port: 8443 - nodePort: {{ .Values.nodePortPrefix }}29 - - name: "model-loader-service-port-8080" - port: 8080 - nodePort: {{ .Values.nodePortPrefix }}10 - type: NodePort - selector: - app: model-loader-service -#{{ end }} ---- -apiVersion: v1 -kind: Service -metadata: - name: gremlin - namespace: "{{ .Values.nsPrefix }}" - labels: - app: gremlin -spec: - ports: - - name: "gremlin-port" - port: 8182 - selector: - app: gremlin - clusterIP: None -#{{ if not .Values.disableAaiElasticsearch }} ---- -apiVersion: v1 -kind: Service -metadata: - name: aai-elasticsearch - namespace: "{{ .Values.nsPrefix }}" - labels: - app: aai-elasticsearch -spec: - ports: - - name: "aai-elasticsearch-port" - port: 9200 - selector: - app: aai-elasticsearch - clusterIP: None -#{{ end }} -#{{ if not .Values.disableAaiSearchDataService }} ---- -apiVersion: v1 -kind: Service -metadata: - name: search-data-service - namespace: "{{ .Values.nsPrefix }}" - labels: - app: search-data-service -spec: - ports: - - name: "search-data-service-port-9509" - port: 9509 - selector: - app: search-data-service - clusterIP: None -#{{ end }} -#{{ if not .Values.disableAaiAaiTraversal }} ---- -apiVersion: v1 -kind: Service -metadata: - name: aai-traversal - namespace: "{{ .Values.nsPrefix }}" - labels: - app: aai-traversal -spec: - ports: - - name: "aai-traversal-port-8446" - port: 8446 - - name: aai-traversal-port-debug - port: 5005 - selector: - app: aai-traversal - clusterIP: None -#{{ end }} -#{{ if not .Values.disableAaiAaiResources }} ---- -apiVersion: v1 -kind: Service -metadata: - name: aai-resources - namespace: "{{ .Values.nsPrefix }}" - labels: - app: aai-resources -spec: - ports: - - name: "aai-resources-port-8447" - port: 8447 - - name: aai-resources-port-debug - port: 5005 - selector: - app: aai-resources - clusterIP: None -#{{ end }} -#{{ if not .Values.disableAaiSparkyBe }} ---- -apiVersion: v1 -kind: Service -metadata: - name: sparky-be - namespace: "{{ .Values.nsPrefix }}" - labels: - app: sparky-be -spec: - ports: - - name: "sparky-be-port-9517" - port: 9517 - selector: - app: sparky-be - clusterIP: None -#{{ end }} diff --git a/kubernetes/aai/templates/configmap.yaml b/kubernetes/aai/templates/configmap.yaml new file mode 100644 index 0000000000..78235bcd4f --- /dev/null +++ b/kubernetes/aai/templates/configmap.yaml @@ -0,0 +1,35 @@ +# this is a shared resource for subcharts +apiVersion: v1 +kind: ConfigMap +metadata: + name: aai-filebeat + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/log/filebeat/*").AsConfig . | indent 2 }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: aai-deployment-configmap + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/haproxy/*").AsConfig . | indent 2 }} +--- +# this is a shared resource for subcharts +apiVersion: v1 +kind: ConfigMap +metadata: + name: aai-chef-config + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/aai-data/chef-config/dev/.knife/solo.rb").AsConfig . | indent 2 }} +--- +# this is a shared resource for subcharts +apiVersion: v1 +kind: ConfigMap +metadata: + name: aai-resources-environments + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/aai-data/environments/*").AsConfig . | indent 2 }} + diff --git a/kubernetes/aai/templates/data-router-configmap.yaml b/kubernetes/aai/templates/data-router-configmap.yaml deleted file mode 100644 index 8c2d988e66..0000000000 --- a/kubernetes/aai/templates/data-router-configmap.yaml +++ /dev/null @@ -1,73 +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.disableAaiDataRouter }} -apiVersion: v1 -kind: ConfigMap -metadata: - name: aai-data-router-prop-configmap - namespace: {{ .Values.nsPrefix }} -data: -{{ tpl (.Files.Glob "resources/config/data-router/appconfig/data-router.properties").AsConfig . | indent 2 }} ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: aai-data-router-model-v8-configmap - namespace: {{ .Values.nsPrefix }} -data: -{{ tpl (.Files.Glob "resources/config/data-router/appconfig/model/aai_oxm_v8.xml").AsConfig . | indent 2 }} ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: aai-data-router-model-v9-configmap - namespace: {{ .Values.nsPrefix }} -data: -{{ tpl (.Files.Glob "resources/config/data-router/appconfig/model/aai_oxm_v9.xml").AsConfig . | indent 2 }} ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: aai-data-router-model-v10-configmap - namespace: {{ .Values.nsPrefix }} -data: -{{ tpl (.Files.Glob "resources/config/data-router/appconfig/model/aai_oxm_v10.xml").AsConfig . | indent 2 }} ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: aai-data-router-model-v11-configmap - namespace: {{ .Values.nsPrefix }} -data: -{{ tpl (.Files.Glob "resources/config/data-router/appconfig/model/aai_oxm_v11.xml").AsConfig . | indent 2 }} ---- -apiVersion: v1 -kind: Secret -metadata: - name: aai-data-router-secret - namespace: {{ .Values.nsPrefix }} -type: Opaque -data: -{{ tpl (.Files.Glob "resources/config/data-router/appconfig/auth/*").AsSecrets . | indent 2 }} ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: aai-data-router-dynamic-configmap - namespace: {{ .Values.nsPrefix }} -data: -{{ tpl (.Files.Glob "resources/config/data-router/dynamic/routes/entity-event.route").AsConfig . | indent 2 }} -{{ tpl (.Files.Glob "resources/config/data-router/dynamic/conf/entity-event-policy.xml").AsConfig . | indent 2 }} -#{{ end }} diff --git a/kubernetes/aai/templates/data-router-deployment.yaml b/kubernetes/aai/templates/data-router-deployment.yaml deleted file mode 100644 index b1cb834eeb..0000000000 --- a/kubernetes/aai/templates/data-router-deployment.yaml +++ /dev/null @@ -1,144 +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.disableAaiDataRouter }} -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: aai-data-router - namespace: "{{ .Values.nsPrefix }}" -spec: - replicas: {{ .Values.dataRouterReplicas }} - selector: - matchLabels: - app: aai-data-router - template: - metadata: - labels: - app: aai-data-router - name: aai-data-router - spec: - initContainers: - - command: - - /bin/sh - - -c - - | - mkdir -p /logroot/data-router/logs - chmod -R 777 /logroot/data-router/logs - chown -R root:root /logroot - env: - - name: NAMESPACE - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: metadata.namespace - securityContext: - privileged: true - image: {{ .Values.image.es_bb }} - imagePullPolicy: {{ .Values.pullPolicy }} - name: init-sysctl - volumeMounts: - - name: aai-data-router-logs - mountPath: /logroot/ - containers: - - name: aai-data-router - image: "{{ .Values.image.dataRouterImage }}:{{ .Values.image.dataRouterVersion }}" - imagePullPolicy: {{ .Values.pullPolicy }} - env: - - name: SERVICE_BEANS - value: /opt/app/data-router/dynamic/conf - - name: CONFIG_HOME - value: /opt/app/data-router/config/ - - name: KEY_STORE_PASSWORD - value: OBF:1y0q1uvc1uum1uvg1pil1pjl1uuq1uvk1uuu1y10 - - name: DYNAMIC_ROUTES - value: /opt/app/data-router/dynamic/routes - - name: KEY_MANAGER_PASSWORD - value: OBF:1y0q1uvc1uum1uvg1pil1pjl1uuq1uvk1uuu1y10 - - name: PATH - value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin - - name: JAVA_HOME - value: usr/lib/jvm/java-8-openjdk-amd64 - volumeMounts: - - mountPath: /etc/localtime - name: localtime - readOnly: true - - mountPath: /opt/app/data-router/config/model/aai_oxm_v8.xml - subPath: aai_oxm_v8.xml - name: aai-data-router-model-v8 - - mountPath: /opt/app/data-router/config/model/aai_oxm_v9.xml - subPath: aai_oxm_v9.xml - name: aai-data-router-model-v9 - - mountPath: /opt/app/data-router/config/model/aai_oxm_v10.xml - subPath: aai_oxm_v10.xml - name: aai-data-router-model-v10 - - mountPath: /opt/app/data-router/config/model/aai_oxm_v11.xml - subPath: aai_oxm_v11.xml - name: aai-data-router-model-v11 - - mountPath: /opt/app/data-router/config/auth - name: aai-data-router-auth - - mountPath: /opt/app/data-router/config/data-router.properties - name: aai-data-router-properties - subPath: data-router.properties - - mountPath: /opt/app/data-router/dynamic/routes/entity-event.route - subPath: entity-event.route - name: aai-data-router-dynamic-route - - mountPath: /opt/app/data-router/dynamic/conf/entity-event-policy.xml - subPath: entity-event-policy.xml - name: aai-data-router-dynamic-policy - - mountPath: /logs/ - name: aai-data-router-logs - ports: - - containerPort: 9502 - readinessProbe: - tcpSocket: - port: 9502 - initialDelaySeconds: 5 - periodSeconds: 10 - volumes: - - name: localtime - hostPath: - path: /etc/localtime - - name: aai-data-router-model-v8 - configMap: - name: aai-data-router-model-v8-configmap - - name: aai-data-router-model-v9 - configMap: - name: aai-data-router-model-v9-configmap - - name: aai-data-router-model-v10 - configMap: - name: aai-data-router-model-v10-configmap - - name: aai-data-router-model-v11 - configMap: - name: aai-data-router-model-v11-configmap - - name: aai-data-router-auth - secret: - secretName: aai-data-router-secret - - name: aai-data-router-properties - configMap: - name: aai-data-router-prop-configmap - - name: aai-data-router-dynamic-route - configMap: - name: aai-data-router-dynamic-configmap - - name: aai-data-router-dynamic-policy - configMap: - name: aai-data-router-dynamic-configmap - - name: aai-data-router-logs - hostPath: - path: {{ .Values.persistence.mountPath }}/{{ .Release.Name }}/aai/data-router/logs - restartPolicy: Always - imagePullSecrets: - - name: "{{ .Values.nsPrefix }}-docker-registry-key" -#{{ end }} - diff --git a/kubernetes/aai/templates/deployment.yaml b/kubernetes/aai/templates/deployment.yaml new file mode 100644 index 0000000000..6216758749 --- /dev/null +++ b/kubernetes/aai/templates/deployment.yaml @@ -0,0 +1,86 @@ +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" . }} + name: {{ .Release.Name }} + spec: + initContainers: + - command: + - /root/ready.py + args: + - --container-name + - aai-traversal + env: + - name: NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + name: {{ include "common.name" . }}-readiness + containers: + - name: {{ include "common.name" . }} + image: "{{ .Values.global.dockerhubRepository | default .Values.dockerhubRepository }}/{{ .Values.image }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + volumeMounts: + - mountPath: /etc/localtime + name: localtime + readOnly: true + - mountPath: /dev/log + name: aai-service-log + - mountPath: /usr/local/etc/haproxy/haproxy.cfg + subPath: haproxy.cfg + name: haproxy-cfg + ports: + - containerPort: {{ .Values.service.internalPort }} + - containerPort: {{ .Values.service.internalPort2 }} + # 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.internalPort2 }} + initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} + periodSeconds: {{ .Values.liveness.periodSeconds }} + {{ end -}} + readinessProbe: + tcpSocket: + port: {{ .Values.service.internalPort2 }} + initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} + periodSeconds: {{ .Values.readiness.periodSeconds }} + 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 + - name: aai-service-log + hostPath: + path: "/dev/log" + - name: haproxy-cfg + configMap: + name: aai-deployment-configmap + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/kubernetes/aai/templates/elasticsearch-deployment.yaml b/kubernetes/aai/templates/elasticsearch-deployment.yaml deleted file mode 100644 index a07db04566..0000000000 --- a/kubernetes/aai/templates/elasticsearch-deployment.yaml +++ /dev/null @@ -1,88 +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.disableAaiElasticsearch }} -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: aai-elasticsearch - namespace: "{{ .Values.nsPrefix }}" -spec: - replicas: {{ .Values.elasticsearchReplicas }} - selector: - matchLabels: - app: aai-elasticsearch - template: - metadata: - labels: - app: aai-elasticsearch - name: aai-elasticsearch - spec: - initContainers: - - command: - - /bin/sh - - -c - - | - mkdir -p /logroot/elasticsearch/es-data - chmod -R 777 /logroot/elasticsearch/es-data - chown -R root:root /logroot - env: - - name: NAMESPACE - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: metadata.namespace - securityContext: - privileged: true - image: {{ .Values.image.es_bb }} - imagePullPolicy: {{ .Values.pullPolicy }} - name: init-sysctl - volumeMounts: - - name: elasticsearch-data - mountPath: /logroot/ - hostname: aai-elasticsearch - containers: - - name: aai-elasticsearch - image: "{{ .Values.image.elasticsearchImage }}:{{ .Values.image.elasticsearchVersion }}" - imagePullPolicy: {{ .Values.pullPolicy }} - ports: - - containerPort: 9200 - readinessProbe: - tcpSocket: - port: 9200 - initialDelaySeconds: 5 - periodSeconds: 10 - volumeMounts: - - name: localtime - mountPath: /etc/localtime - readOnly: true - - name: elasticsearch-config - subPath: elasticsearch.yml - mountPath: /usr/share/elasticsearch/config/elasticsearch.yml - - name: elasticsearch-data - mountPath: /usr/share/elasticsearch/data - volumes: - - name: localtime - hostPath: - path: /etc/localtime - - name: elasticsearch-config - configMap: - name: aai-elasticsearch-configmap - - name: elasticsearch-data - hostPath: - path: {{ .Values.persistence.mountPath }}/{{ .Release.Name }}/aai/elasticsearch/data - imagePullSecrets: - - name: "{{ .Values.nsPrefix }}-docker-registry-key" -#{{ end }} - diff --git a/kubernetes/aai/templates/hbase-deployment.yaml b/kubernetes/aai/templates/hbase-deployment.yaml deleted file mode 100644 index 62b017db29..0000000000 --- a/kubernetes/aai/templates/hbase-deployment.yaml +++ /dev/null @@ -1,66 +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.disableAaiHbase }} -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: aai-hbase - namespace: "{{ .Values.nsPrefix }}" -spec: - replicas: {{ .Values.hbaseReplicas }} - selector: - matchLabels: - app: hbase - template: - metadata: - labels: - app: hbase - name: aai-hbase - spec: - hostname: hbase - containers: - - name: hbase - image: "{{ .Values.image.aaiHbaseImage }}:{{ .Values.image.aaiHbaseVersion }}" - imagePullPolicy: {{ .Values.pullPolicy }} - ports: - - containerPort: 2181 - - containerPort: 8080 - - containerPort: 8085 - - containerPort: 9090 - - containerPort: 16000 - - containerPort: 16010 - - containerPort: 16201 - readinessProbe: - tcpSocket: - port: 2181 - initialDelaySeconds: 5 - periodSeconds: 10 - volumeMounts: - - name: hbase-data - mountPath: /tmp - - name: localtime - mountPath: /etc/localtime - readOnly: true - volumes: - - name: hbase-data - hostPath: - path: {{ .Values.persistence.mountPath }}/{{ .Release.Name }}/aai/hbase - - name: localtime - hostPath: - path: /etc/localtime - imagePullSecrets: - - name: "{{ .Values.nsPrefix }}-docker-registry-key" -#{{ end }} - diff --git a/kubernetes/aai/templates/modelloader-deployment-configmap.yaml b/kubernetes/aai/templates/modelloader-deployment-configmap.yaml deleted file mode 100644 index 14d316c42b..0000000000 --- a/kubernetes/aai/templates/modelloader-deployment-configmap.yaml +++ /dev/null @@ -1,40 +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.disableAaiModelLoaderService }} -apiVersion: v1 -kind: ConfigMap -metadata: - name: aai-model-loader-prop-configmap - namespace: {{ .Values.nsPrefix }} -data: -{{ tpl (.Files.Glob "resources/config/model-loader/appconfig/model-loader.properties").AsConfig . | indent 2 }} ---- -apiVersion: v1 -kind: Secret -metadata: - name: aai-model-loader-secret - namespace: {{ .Values.nsPrefix }} -type: Opaque -data: -{{ tpl (.Files.Glob "resources/config/model-loader/appconfig/auth/*").AsSecrets . | indent 2 }} ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: aai-model-loader-log-configmap - namespace: {{ .Values.nsPrefix }} -data: -{{ tpl (.Files.Glob "resources/config/log/model-loader/logback.xml").AsConfig . | indent 2 }} -#{{ end }} diff --git a/kubernetes/aai/templates/modelloader-deployment.yaml b/kubernetes/aai/templates/modelloader-deployment.yaml deleted file mode 100644 index 33458c772a..0000000000 --- a/kubernetes/aai/templates/modelloader-deployment.yaml +++ /dev/null @@ -1,90 +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.disableAaiModelLoaderService }} -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: aai-model-loader-service - namespace: "{{ .Values.nsPrefix }}" -spec: - replicas: {{ .Values.modelLoaderReplicas }} - selector: - matchLabels: - app: model-loader-service - template: - metadata: - labels: - app: model-loader-service - name: aai-model-loader-service - spec: - containers: - - name: model-loader-service - image: "{{ .Values.image.modelLoaderImage }}:{{ .Values.image.modelLoaderVersion }}" - imagePullPolicy: {{ .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: aai-model-loader-prop-config - - mountPath: /opt/app/model-loader/config/auth/ - name: aai-model-loader-auth-config - - mountPath: /var/log/onap - name: aai-model-loader-logs - - mountPath: /opt/app/model-loader/bundleconfig/etc/logback.xml - name: aai-model-loader-log-conf - subPath: logback.xml - ports: - - containerPort: 8080 - - containerPort: 8443 - - name: filebeat-onap-aai-model-loader - image: {{ .Values.image.filebeat }} - imagePullPolicy: {{ .Values.pullPolicy }} - volumeMounts: - - mountPath: /usr/share/filebeat/filebeat.yml - subPath: filebeat.yml - name: filebeat-conf - - mountPath: /var/log/onap - name: aai-model-loader-logs - - mountPath: /usr/share/filebeat/data - name: aai-model-loader-filebeat - volumes: - - name: localtime - hostPath: - path: /etc/localtime - - name: aai-model-loader-prop-config - configMap: - name: aai-model-loader-prop-configmap - - name: aai-model-loader-auth-config - secret: - secretName: aai-model-loader-secret - - name: filebeat-conf - configMap: - name: aai-filebeat-configmap - - name: aai-model-loader-logs - emptyDir: {} - - name: aai-model-loader-filebeat - emptyDir: {} - - name: aai-model-loader-log-conf - configMap: - name: aai-model-loader-log-configmap - restartPolicy: Always - imagePullSecrets: - - name: "{{ .Values.nsPrefix }}-docker-registry-key" -#{{ end }} diff --git a/kubernetes/aai/templates/search-data-service-configmap.yaml b/kubernetes/aai/templates/search-data-service-configmap.yaml deleted file mode 100644 index 2094f605c2..0000000000 --- a/kubernetes/aai/templates/search-data-service-configmap.yaml +++ /dev/null @@ -1,48 +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.disableAaiSearchDataService }} -apiVersion: v1 -kind: ConfigMap -metadata: - name: aai-search-data-configmap - namespace: {{ .Values.nsPrefix }} -data: -{{ tpl (.Files.Glob "resources/config/search-data-service/appconfig/*").AsConfig . | indent 2 }} ---- -apiVersion: v1 -kind: Secret -metadata: - name: aai-search-data-keystone-secret - namespace: {{ .Values.nsPrefix }} -type: Opaque -data: -{{ tpl (.Files.Glob "resources/config/search-data-service/appconfig/auth/tomcat_keystore").AsSecrets . | indent 2 }} ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: aai-search-policy-configmap - namespace: {{ .Values.nsPrefix }} -data: -{{ tpl (.Files.Glob "resources/config/search-data-service/appconfig/auth/search_policy.json").AsSecrets . | indent 2 }} ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: aai-search-data-service-log-configmap - namespace: {{ .Values.nsPrefix }} -data: -{{ tpl (.Files.Glob "resources/config/log/search-data-service/logback.xml").AsConfig . | indent 2 }} -#{{ end }} diff --git a/kubernetes/aai/templates/search-data-service-deployment.yaml b/kubernetes/aai/templates/search-data-service-deployment.yaml deleted file mode 100644 index 28cc4f3236..0000000000 --- a/kubernetes/aai/templates/search-data-service-deployment.yaml +++ /dev/null @@ -1,111 +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.disableAaiSearchDataService }} -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: aai-search-data-service - namespace: "{{ .Values.nsPrefix }}" -spec: - replicas: {{ .Values.searchDataServiceReplicas }} - selector: - matchLabels: - app: search-data-service - template: - metadata: - labels: - app: search-data-service - name: aai-search-data-service - spec: - containers: - - name: search-data-service - image: "{{ .Values.image.searchDataImage }}:{{ .Values.image.searchDataVersion }}" - imagePullPolicy: {{ .Values.pullPolicy }} - env: - - name: CONFIG_HOME - value: /opt/app/search-data-service/config/ - - name: KEY_STORE_PASSWORD - value: OBF:1y0q1uvc1uum1uvg1pil1pjl1uuq1uvk1uuu1y10 - - name: KEY_MANAGER_PASSWORD - value: OBF:1y0q1uvc1uum1uvg1pil1pjl1uuq1uvk1uuu1y10 - volumeMounts: - - mountPath: /etc/localtime - name: localtime - readOnly: true - - mountPath: /opt/app/search-data-service/config/filter-config.json - subPath: filter-config.json - name: aai-search-data-service-config - - mountPath: /opt/app/search-data-service/config/elastic-search.properties - subPath: elastic-search.properties - name: aai-search-data-service-config - - mountPath: /opt/app/search-data-service/config/analysis-config.json - subPath: filter-config.json - name: aai-search-data-service-config - - mountPath: /opt/app/search-data-service/config/auth/tomcat_keystore - subPath: tomcat_keystore - name: aai-search-data-service-auth-config - - mountPath: /opt/app/search-data-service/config/auth/search_policy.json - subPath: search_policy.json - name: aai-search-data-search-policy-config - - mountPath: /var/log/onap - name: aai-search-data-service-logs - - mountPath: /opt/app/search-data-service/bundleconfig/etc/logback.xml - name: aai-search-data-service-log-conf - subPath: logback.xml - ports: - - containerPort: 9509 - readinessProbe: - tcpSocket: - port: 9509 - initialDelaySeconds: 5 - periodSeconds: 10 - - name: filebeat-onap-aai-search - image: {{ .Values.image.filebeat }} - imagePullPolicy: {{ .Values.pullPolicy }} - volumeMounts: - - mountPath: /usr/share/filebeat/filebeat.yml - subPath: filebeat.yml - name: filebeat-conf - - mountPath: /var/log/onap - name: aai-search-data-service-logs - - mountPath: /usr/share/filebeat/data - name: aai-search-data-service-filebeat - volumes: - - name: localtime - hostPath: - path: /etc/localtime - - name: aai-search-data-service-config - configMap: - name: aai-search-data-configmap - - name: aai-search-data-service-auth-config - secret: - secretName: aai-search-data-keystone-secret - - name: aai-search-data-search-policy-config - configMap: - name: aai-search-policy-configmap - - name: filebeat-conf - configMap: - name: aai-filebeat-configmap - - name: aai-search-data-service-logs - emptyDir: {} - - name: aai-search-data-service-filebeat - emptyDir: {} - - name: aai-search-data-service-log-conf - configMap: - name: aai-search-data-service-log-configmap - restartPolicy: Always - imagePullSecrets: - - name: "{{ .Values.nsPrefix }}-docker-registry-key" -#{{ end }} diff --git a/kubernetes/aai/templates/service.yaml b/kubernetes/aai/templates/service.yaml new file mode 100644 index 0000000000..d21ac7ed87 --- /dev/null +++ b/kubernetes/aai/templates/service.yaml @@ -0,0 +1,33 @@ +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: + ports: + {{if eq .Values.service.type "NodePort" -}} + - name: {{ .Values.service.name }} + port: {{ .Values.service.internalPort }} + targetPort: {{ .Values.service.internalPort }} + nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort }} + - name: {{ .Values.service.name }}2 + port: {{ .Values.service.internalPort2 }} + targetPort: {{ .Values.service.internalPort2 }} + nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort2 }} + {{- else -}} + - port: {{ .Values.service.externalPort }} + targetPort: {{ .Values.service.internalPort }} + name: {{ .Values.service.name }} + - port: {{ .Values.service.externalPort2 }} + targetPort: {{ .Values.service.internalPort2 }} + name: {{ .Values.service.name }}2 + {{- end}} + type: {{ .Values.service.type }} + selector: + app: {{ include "common.name" . }} + clusterIP: {{ .Values.config.aaiServiceClusterIp }} diff --git a/kubernetes/aai/templates/sparky-be-deployment-configmap.yaml b/kubernetes/aai/templates/sparky-be-deployment-configmap.yaml deleted file mode 100644 index 39c6138db3..0000000000 --- a/kubernetes/aai/templates/sparky-be-deployment-configmap.yaml +++ /dev/null @@ -1,56 +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.disableAaiSparkyBe }} -apiVersion: v1 -kind: ConfigMap -metadata: - name: aai-sparky-be-configmap - namespace: {{ .Values.nsPrefix }} -data: -{{ tpl (.Files.Glob "resources/config/sparky-be/appconfig/*").AsConfig . | indent 2 }} ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: aai-sparky-be-model-configmap - namespace: {{ .Values.nsPrefix }} -data: -{{ tpl (.Files.Glob "resources/config/sparky-be/appconfig/model/*").AsConfig . | indent 2 }} ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: aai-sparky-be-portal-configmap - namespace: {{ .Values.nsPrefix }} -data: -{{ tpl (.Files.Glob "resources/config/sparky-be/appconfig/portal/*").AsConfig . | indent 2 }} ---- -apiVersion: v1 -kind: Secret -metadata: - name: aai-sparky-be-secret - namespace: {{ .Values.nsPrefix }} -type: Opaque -data: -{{ tpl (.Files.Glob "resources/config/sparky-be/appconfig/auth/*").AsSecrets . | indent 2 }} ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: aai-sparky-be-log-configmap - namespace: {{ .Values.nsPrefix }} -data: -{{ tpl (.Files.Glob "resources/config/log/sparky-be/logback.xml").AsConfig . | indent 2 }} -#{{ end }} diff --git a/kubernetes/aai/templates/sparky-be-deployment.yaml b/kubernetes/aai/templates/sparky-be-deployment.yaml deleted file mode 100644 index 4b3196910e..0000000000 --- a/kubernetes/aai/templates/sparky-be-deployment.yaml +++ /dev/null @@ -1,123 +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.disableAaiSparkyBe }} -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: aai-sparky-be - namespace: "{{ .Values.nsPrefix }}" -spec: - replicas: {{ .Values.sparkyReplicas }} - selector: - matchLabels: - app: sparky-be - template: - metadata: - labels: - app: sparky-be - name: aai-sparky-be - spec: - containers: - - name: sparky-be - image: "{{ .Values.image.sparkyBeImage }}:{{ .Values.image.sparkyBeVersion }}" - imagePullPolicy: {{ .Values.pullPolicy }} - env: - - name: CONFIG_HOME - value: /opt/app/sparky/config/ - - name: KEY_MANAGER_PASSWORD - value: OBF:1i9a1u2a1unz1lr61wn51wn11lss1unz1u301i6o - - name: KEY_STORE_PASSWORD - value: OBF:1i9a1u2a1unz1lr61wn51wn11lss1unz1u301i6o - volumeMounts: - - mountPath: /etc/localtime - name: localtime - readOnly: true - - mountPath: /opt/app/sparky/config/auth/ - name: aai-sparky-be-auth-config - - mountPath: /opt/app/sparky/config/synchronizer.properties - subPath: synchronizer.properties - name: aai-sparky-be-config - - mountPath: /opt/app/sparky/config/suggestive-search.properties - subPath: suggestive-search.properties - name: aai-sparky-be-config - - mountPath: /opt/app/sparky/config/search-service.properties - subPath: search-service.properties - name: aai-sparky-be-config - - mountPath: /opt/app/sparky/config/roles.config - subPath: roles.config - name: aai-sparky-be-config - - mountPath: /opt/app/sparky/config/elasticsearch.properties - subPath: elasticsearch.properties - name: aai-sparky-be-config - - mountPath: /opt/app/sparky/config/aai.properties - subPath: aai.properties - name: aai-sparky-be-config - - mountPath: /opt/app/sparky/config/model/ - name: aai-sparky-be-model-config - - mountPath: /opt/app/sparky/config/portal/ - name: aai-sparky-be-portal-config - - mountPath: /var/log/onap - name: aai-sparky-be-logs - - mountPath: /opt/app/sparky/bundleconfig/etc/logback.xml - name: aai-sparky-be-log-conf - subPath: logback.xml - ports: - - containerPort: 9517 - readinessProbe: - tcpSocket: - port: 9517 - initialDelaySeconds: 5 - periodSeconds: 10 - - name: filebeat-onap-aai-sparky - image: {{ .Values.image.filebeat }} - imagePullPolicy: {{ .Values.pullPolicy }} - volumeMounts: - - mountPath: /usr/share/filebeat/filebeat.yml - subPath: filebeat.yml - name: filebeat-conf - - mountPath: /var/log/onap - name: aai-sparky-be-logs - - mountPath: /usr/share/filebeat/data - name: aai-sparky-filebeat - volumes: - - name: localtime - hostPath: - path: /etc/localtime - - name: aai-sparky-be-config - configMap: - name: aai-sparky-be-configmap - - name: aai-sparky-be-model-config - configMap: - name: aai-sparky-be-model-configmap - - name: aai-sparky-be-portal-config - configMap: - name: aai-sparky-be-portal-configmap - - name: aai-sparky-be-auth-config - secret: - secretName: aai-sparky-be-secret - - name: filebeat-conf - configMap: - name: aai-filebeat-configmap - - name: aai-sparky-be-logs - emptyDir: {} - - name: aai-sparky-filebeat - emptyDir: {} - - name: aai-sparky-be-log-conf - configMap: - name: aai-sparky-be-log-configmap - restartPolicy: Always - imagePullSecrets: - - name: "{{ .Values.nsPrefix }}-docker-registry-key" -#{{ end }} diff --git a/kubernetes/aai/values.yaml b/kubernetes/aai/values.yaml index e283cb6f2e..b06456800a 100644 --- a/kubernetes/aai/values.yaml +++ b/kubernetes/aai/values.yaml @@ -12,65 +12,84 @@ # See the License for the specific language governing permissions and # limitations under the License. -nsPrefix: onap +# Default values for aai. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. +global: # global defaults + nodePortPrefix: 302 + repository: nexus3.onap.org:10001 + repositorySecret: eyJuZXh1czMub25hcC5vcmc6MTAwMDEiOnsidXNlcm5hbWUiOiJkb2NrZXIiLCJwYXNzd29yZCI6ImRvY2tlciIsImVtYWlsIjoiQCIsImF1dGgiOiJaRzlqYTJWeU9tUnZZMnRsY2c9PSJ9fQ== + dockerhubRepository: docker.io + busyboxImage: busybox + readinessRepository: oomk8s + readinessImage: readiness-check:1.1.0 + loggingRepository: docker.elastic.co + loggingImage: beats/filebeat:5.5.0 + restartPolicy: Always + +# application image +dockerhubRepository: registry.hub.docker.com +image: aaionap/haproxy:1.1.0 pullPolicy: Always -nodePortPrefix: 302 -# POLICY hotfix - Note this must be temporary -# See https://jira.onap.org/browse/POLICY-510 -aaiServiceClusterIp: 10.43.255.254 -aaiServiceReplicas: 1 -aaiResourceReplicas: 1 -aaiTraversalReplicas: 1 -dataRouterReplicas: 1 -elasticsearchReplicas: 1 -hbaseReplicas: 1 -modelLoaderReplicas: 1 -searchDataServiceReplicas: 1 -sparkyReplicas: 1 -image: - readiness: oomk8s/readiness-check:1.1.0 - aaiProxy: aaionap/haproxy - aaiProxyVersion: 1.1.0 - aaiHbaseImage: aaionap/hbase - aaiHbaseVersion: 1.2.0 - modelLoaderImage: nexus3.onap.org:10001/onap/model-loader - modelLoaderVersion: v1.1.0 - aaiResourcesImage: nexus3.onap.org:10001/openecomp/aai-resources - aaiResourcesVersion: v1.1.0 - aaiTraversalImage: nexus3.onap.org:10001/openecomp/aai-traversal - aaiTraversalVersion: v1.1.0 - dataRouterImage: nexus3.onap.org:10001/onap/data-router - dataRouterVersion: v1.1.0 - elasticsearchImage: elasticsearch - elasticsearchVersion: 2.4.1 - searchDataImage: nexus3.onap.org:10001/onap/search-data-service - searchDataVersion: v1.1.0 - sparkyBeImage: nexus3.onap.org:10001/onap/sparky-be - sparkyBeVersion: v1.1.0 - gremlinServerImage: aaionap/gremlin-server - filebeat: docker.elastic.co/beats/filebeat:5.5.0 - es_bb: busybox -aaicoreversion: 1.1.0-SNAPSHOT -persistence: +# flag to enable debugging - application support required +debugEnabled: false + +# application configuration +config: + # POLICY hotfix - Note this must be temporary + # See https://jira.onap.org/browse/POLICY-510 + aaiServiceClusterIp: + 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 - - ## A manually managed Persistent Volume and Claim - ## Requires persistence.enabled: true - ## If defined, PVC must be created manually before volume will be bound - # existingClaim: - volumeReclaimPolicy: Retain - ## database data Persistent Volume Storage Class - ## If defined, storageClassName: <storageClass> - ## If set to "-", storageClassName: "", which disables dynamic provisioning - ## If undefined (the default) or set to null, no storageClassName spec is - ## set, choosing the default provisioner. (gp2 on AWS, standard on - ## GKE, AWS & OpenStack) - ## - # storageClass: "-" - accessMode: ReadWriteMany - size: 2Gi - mountPath: /dockerdata-nfs - mountSubPath: aai/data-router/logs +readiness: + initialDelaySeconds: 10 + periodSeconds: 10 + +service: + type: NodePort + name: aai + externalPort: 8080 + internalPort: 8080 + nodePort: 32 + externalPort2: 8443 + internalPort2: 8443 + nodePort2: 33 + +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/appc/resources/config/log/filebeat/log4j/filebeat.yml b/kubernetes/appc/resources/config/log/filebeat/log4j/filebeat.yml index 52161aafad..49d818a807 100644 --- a/kubernetes/appc/resources/config/log/filebeat/log4j/filebeat.yml +++ b/kubernetes/appc/resources/config/log/filebeat/log4j/filebeat.yml @@ -29,7 +29,7 @@ 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.Namespace}}:5044"] + hosts: ["{{.Values.config.logstashServiceName}}.{{.Release.Namespace}}:{{.Values.config.logstashPort}}"] #If enable will do load balancing among availabe Logstash, automatically. loadbalance: true diff --git a/kubernetes/appc/values.yaml b/kubernetes/appc/values.yaml index e31980a990..b5a13ef87c 100644 --- a/kubernetes/appc/values.yaml +++ b/kubernetes/appc/values.yaml @@ -43,6 +43,8 @@ config: enableClustering: true configDir: /opt/onap/appc/data/properties dmaapTopic: SUCCESS + logstashServiceName: log-ls + logstashPort: 5044 mysql: nameOverride: appc-db diff --git a/kubernetes/common/Makefile b/kubernetes/common/Makefile index b9cc1250d5..d634a8c506 100644 --- a/kubernetes/common/Makefile +++ b/kubernetes/common/Makefile @@ -19,7 +19,7 @@ PACKAGE_DIR := $(OUTPUT_DIR)/packages SECRET_DIR := $(OUTPUT_DIR)/secrets EXCLUDES := -HELM_CHARTS := $(filter-out $(EXCLUDES), $(patsubst %/.,%,$(wildcard */.))) $(PARENT_CHART) +HELM_CHARTS := $(filter-out $(EXCLUDES), $(patsubst %/.,%,$(wildcard */.))) .PHONY: $(EXCLUDES) $(HELM_CHARTS) @@ -41,6 +41,7 @@ lint-%: dep-% package-%: lint-% @mkdir -p $(PACKAGE_DIR) @if [ -f $*/Chart.yaml ]; then helm package -d $(PACKAGE_DIR) $*; fi + @helm repo index $(PACKAGE_DIR) clean: @rm -f */requirements.lock diff --git a/kubernetes/common/dgbuilder/.helmignore b/kubernetes/common/dgbuilder/.helmignore new file mode 100644 index 0000000000..f0c1319444 --- /dev/null +++ b/kubernetes/common/dgbuilder/.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/dgbuilder/Chart.yaml b/kubernetes/common/dgbuilder/Chart.yaml index e1955a137c..e1955a137c 100644 --- a/kubernetes/dgbuilder/Chart.yaml +++ b/kubernetes/common/dgbuilder/Chart.yaml diff --git a/kubernetes/dgbuilder/requirements.yaml b/kubernetes/common/dgbuilder/requirements.yaml index acca8ef7e2..acca8ef7e2 100644 --- a/kubernetes/dgbuilder/requirements.yaml +++ b/kubernetes/common/dgbuilder/requirements.yaml diff --git a/kubernetes/dgbuilder/resources/config/svclogic.properties b/kubernetes/common/dgbuilder/resources/config/svclogic.properties index fdaf5779e2..fdaf5779e2 100644 --- a/kubernetes/dgbuilder/resources/config/svclogic.properties +++ b/kubernetes/common/dgbuilder/resources/config/svclogic.properties diff --git a/kubernetes/dgbuilder/resources/scripts/createReleaseDir.sh b/kubernetes/common/dgbuilder/resources/scripts/createReleaseDir.sh index 38f7fe2720..38f7fe2720 100755 --- a/kubernetes/dgbuilder/resources/scripts/createReleaseDir.sh +++ b/kubernetes/common/dgbuilder/resources/scripts/createReleaseDir.sh diff --git a/kubernetes/dgbuilder/resources/scripts/customSettings.js b/kubernetes/common/dgbuilder/resources/scripts/customSettings.js index f09d396f96..f09d396f96 100644 --- a/kubernetes/dgbuilder/resources/scripts/customSettings.js +++ b/kubernetes/common/dgbuilder/resources/scripts/customSettings.js diff --git a/kubernetes/dgbuilder/templates/NOTES.txt b/kubernetes/common/dgbuilder/templates/NOTES.txt index 2465e03634..2465e03634 100644 --- a/kubernetes/dgbuilder/templates/NOTES.txt +++ b/kubernetes/common/dgbuilder/templates/NOTES.txt diff --git a/kubernetes/dgbuilder/templates/configmap.yaml b/kubernetes/common/dgbuilder/templates/configmap.yaml index 7ef92d09e7..7ef92d09e7 100644 --- a/kubernetes/dgbuilder/templates/configmap.yaml +++ b/kubernetes/common/dgbuilder/templates/configmap.yaml diff --git a/kubernetes/dgbuilder/templates/deployment.yaml b/kubernetes/common/dgbuilder/templates/deployment.yaml index 4e1f1019ee..4e1f1019ee 100644 --- a/kubernetes/dgbuilder/templates/deployment.yaml +++ b/kubernetes/common/dgbuilder/templates/deployment.yaml diff --git a/kubernetes/dgbuilder/templates/secrets.yaml b/kubernetes/common/dgbuilder/templates/secrets.yaml index 7604be8239..7604be8239 100644 --- a/kubernetes/dgbuilder/templates/secrets.yaml +++ b/kubernetes/common/dgbuilder/templates/secrets.yaml diff --git a/kubernetes/dgbuilder/templates/service.yaml b/kubernetes/common/dgbuilder/templates/service.yaml index c61cdd549b..c61cdd549b 100644 --- a/kubernetes/dgbuilder/templates/service.yaml +++ b/kubernetes/common/dgbuilder/templates/service.yaml diff --git a/kubernetes/dgbuilder/values.yaml b/kubernetes/common/dgbuilder/values.yaml index 23f8eea78e..23f8eea78e 100644 --- a/kubernetes/dgbuilder/values.yaml +++ b/kubernetes/common/dgbuilder/values.yaml diff --git a/kubernetes/common/mysql/.helmignore b/kubernetes/common/mysql/.helmignore new file mode 100644 index 0000000000..f0c1319444 --- /dev/null +++ b/kubernetes/common/mysql/.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/mysql/Chart.yaml b/kubernetes/common/mysql/Chart.yaml index 99e7c44fb9..99e7c44fb9 100644 --- a/kubernetes/mysql/Chart.yaml +++ b/kubernetes/common/mysql/Chart.yaml diff --git a/kubernetes/mysql/requirements.yaml b/kubernetes/common/mysql/requirements.yaml index acca8ef7e2..acca8ef7e2 100644 --- a/kubernetes/mysql/requirements.yaml +++ b/kubernetes/common/mysql/requirements.yaml diff --git a/kubernetes/mysql/templates/configmap.yaml b/kubernetes/common/mysql/templates/configmap.yaml index dd2b5b7db2..dd2b5b7db2 100644 --- a/kubernetes/mysql/templates/configmap.yaml +++ b/kubernetes/common/mysql/templates/configmap.yaml diff --git a/kubernetes/mysql/templates/nfs-provisoner.yaml b/kubernetes/common/mysql/templates/nfs-provisoner.yaml index 478224e1a1..478224e1a1 100644 --- a/kubernetes/mysql/templates/nfs-provisoner.yaml +++ b/kubernetes/common/mysql/templates/nfs-provisoner.yaml diff --git a/kubernetes/mysql/templates/pv.yaml b/kubernetes/common/mysql/templates/pv.yaml index ba128b95d0..ba128b95d0 100644 --- a/kubernetes/mysql/templates/pv.yaml +++ b/kubernetes/common/mysql/templates/pv.yaml diff --git a/kubernetes/mysql/templates/pvc.yaml b/kubernetes/common/mysql/templates/pvc.yaml index a2949fef36..a2949fef36 100644 --- a/kubernetes/mysql/templates/pvc.yaml +++ b/kubernetes/common/mysql/templates/pvc.yaml diff --git a/kubernetes/mysql/templates/secrets.yaml b/kubernetes/common/mysql/templates/secrets.yaml index 7604be8239..7604be8239 100644 --- a/kubernetes/mysql/templates/secrets.yaml +++ b/kubernetes/common/mysql/templates/secrets.yaml diff --git a/kubernetes/mysql/templates/service.yaml b/kubernetes/common/mysql/templates/service.yaml index c6a28c4605..c6a28c4605 100644 --- a/kubernetes/mysql/templates/service.yaml +++ b/kubernetes/common/mysql/templates/service.yaml diff --git a/kubernetes/mysql/templates/statefulset.yaml b/kubernetes/common/mysql/templates/statefulset.yaml index 7b55bf2be0..7b55bf2be0 100644 --- a/kubernetes/mysql/templates/statefulset.yaml +++ b/kubernetes/common/mysql/templates/statefulset.yaml diff --git a/kubernetes/mysql/templates/storageclass.yaml b/kubernetes/common/mysql/templates/storageclass.yaml index 1a4e6b6bb7..1a4e6b6bb7 100644 --- a/kubernetes/mysql/templates/storageclass.yaml +++ b/kubernetes/common/mysql/templates/storageclass.yaml diff --git a/kubernetes/mysql/values.yaml b/kubernetes/common/mysql/values.yaml index c0beb6fd22..c0beb6fd22 100644 --- a/kubernetes/mysql/values.yaml +++ b/kubernetes/common/mysql/values.yaml diff --git a/kubernetes/dcae/README b/kubernetes/dcae/README deleted file mode 100644 index c733355682..0000000000 --- a/kubernetes/dcae/README +++ /dev/null @@ -1,18 +0,0 @@ -DCAE Port mapping ------------------------------------------------------------------------------------------ -Container name | Connector name | Node port | Target port | ------------------------------------------------------------------------------------------ -dcae-collector-common-event | dcae-ce1 | 30236 | 8080 | ------------------------------------------------------------------------------------------ - | dcae-ce2 | 30237 | 8443 | ------------------------------------------------------------------------------------------ - | dcae-ce3 | 30238 | 9999 | ------------------------------------------------------------------------------------------ -dcae-collector-dmaapbc | dcae-bc1 | 30239 | 8080 | ------------------------------------------------------------------------------------------ - | dcae-bc2 | 30240 | 8443 | ------------------------------------------------------------------------------------------ -dcae-ves-collector | dcae-ves1 | 30241 | 8080 | ------------------------------------------------------------------------------------------ - | dcae-ves2 | 30242 | 9999 | ------------------------------------------------------------------------------------------ diff --git a/kubernetes/dcae/cdap/docker/00-provisioning.sh b/kubernetes/dcae/cdap/docker/00-provisioning.sh deleted file mode 100755 index 98b67c4476..0000000000 --- a/kubernetes/dcae/cdap/docker/00-provisioning.sh +++ /dev/null @@ -1,257 +0,0 @@ -#!/bin/bash -set -x - -export DEBIAN_FRONTEND=noninteractive - -############################################################## -################### File provisioning ######################## -############################################################## - -cd /tmp - - -## Adding configuration file: mount_config -cat > /tmp/dcae-mount.conf << EOF_CONFIG -osType: ubuntu -volumes: - ephemeral: - uuid: ephemeral - size: 80 - filesystems: - /opt/tools: - size: 80 - type: ext4 - mount_opts: '' - data: - uuid: cinder - size: 75 - filesystems: - /opt/data: - size: 75 - type: ext4 - mount_opts: '' -EOF_CONFIG - - -## Adding configuration file: ecomp-nexus -cat > /tmp/ecomp-nexus.crt << EOF_CONFIG ------BEGIN CERTIFICATE----- -MIIFRTCCBC2gAwIBAgIQM/5eM8D0jY3yHTSyN5iO9zANBgkqhkiG9w0BAQsFADCB -kDELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G -A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxNjA0BgNV -BAMTLUNPTU9ETyBSU0EgRG9tYWluIFZhbGlkYXRpb24gU2VjdXJlIFNlcnZlciBD -QTAeFw0xNzAzMjgwMDAwMDBaFw0xODAzMjgyMzU5NTlaMFcxITAfBgNVBAsTGERv -bWFpbiBDb250cm9sIFZhbGlkYXRlZDEdMBsGA1UECxMUUG9zaXRpdmVTU0wgV2ls -ZGNhcmQxEzARBgNVBAMMCioub25hcC5vcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IB -DwAwggEKAoIBAQDIVo+kmG2sGaeIJy5pqP6mzlIwqYUXcFOG2fodsCPg9CEdlsBO -IECuoPYmCqrJ/MHLfs+F+SjEoBfpJlqyrpLhVj8O/9xCp4Tda/YJ18n59uDJ7Rpq -omqZlFCj/B4+H6+dkWCFy1FxYBBAIO52iscd4F6YHD1p3xUjJRd9Yf6qnktmSooI -hbIKzPIpSTsYiN3ArWbrGeucoQUdKX+intRHFLkKay88R7yqoqguPFIEtkXwDoJj -aV+rC103eZ1RLwtBcS/4UcDXRDfkyQANAYvKGeHiyGuRQqEUyGEmKz2i11m1oyEP -uD1AK+zPd33wBdOe8iZMr0CxcOGhgcKOWJ7vAgMBAAGjggHRMIIBzTAfBgNVHSME -GDAWgBSQr2o6lFoL2JDqElZz30O0Oija5zAdBgNVHQ4EFgQUMVkz3DD9qwhzY5WT -/P1mCVpsauQwDgYDVR0PAQH/BAQDAgWgMAwGA1UdEwEB/wQCMAAwHQYDVR0lBBYw -FAYIKwYBBQUHAwEGCCsGAQUFBwMCME8GA1UdIARIMEYwOgYLKwYBBAGyMQECAgcw -KzApBggrBgEFBQcCARYdaHR0cHM6Ly9zZWN1cmUuY29tb2RvLmNvbS9DUFMwCAYG -Z4EMAQIBMFQGA1UdHwRNMEswSaBHoEWGQ2h0dHA6Ly9jcmwuY29tb2RvY2EuY29t -L0NPTU9ET1JTQURvbWFpblZhbGlkYXRpb25TZWN1cmVTZXJ2ZXJDQS5jcmwwgYUG -CCsGAQUFBwEBBHkwdzBPBggrBgEFBQcwAoZDaHR0cDovL2NydC5jb21vZG9jYS5j -b20vQ09NT0RPUlNBRG9tYWluVmFsaWRhdGlvblNlY3VyZVNlcnZlckNBLmNydDAk -BggrBgEFBQcwAYYYaHR0cDovL29jc3AuY29tb2RvY2EuY29tMB8GA1UdEQQYMBaC -Cioub25hcC5vcmeCCG9uYXAub3JnMA0GCSqGSIb3DQEBCwUAA4IBAQAd5mu22sts -at/bdRlIOz3dbqGwIFOo8XajlAs6ApMpyx/xetcgIKipzvGp9Wc1X8lDZl4boCH6 -KQ1//4tpksYj8RsZSZeac8vQLKggWO107sBa33yFg6Y1Dk2DdgOKZ+lNbvB1iMwK -hSGtV3HYx1jLyQRoeYby4R7+kTI1lHAiOgT+vn5C9Z3TxqfgWuBf24CFp/95gki6 -vRysJh9Jf7A8JrrMGykC94Tpo6OiUehtQ+f65xtetvwsfNHVp3hsLzR5KwIMDARI -IgXKyROodILsOXfR9qdA9klcXUSi6qvKF8wAopNuot4Ltyz8chiFKISjxqVrKnY2 -M7En/HyX0s1I ------END CERTIFICATE----- -EOF_CONFIG - - -## Adding configuration file: vm-cdap-cluster-cdap.properties -cat > /tmp/vm-cdap-cluster-cdap.properties << EOF_CONFIG -cluster.endpoint= foobar -cluster.user= foobar -cluster.password= foobar -EOF_CONFIG - - -## Adding configuration file: vm-cdap-cluster-console.properties -cat > /tmp/vm-cdap-cluster-console.properties << EOF_CONFIG -localhost.endpoint=http://localhost:1999 -localhost.user=console -localhost.password=NTJhYWU1NzAwMzc3OTk1 -EOF_CONFIG - - -## Adding configuration file: vm-cdap-cluster-gui.properties -cat > /tmp/vm-cdap-cluster-gui.properties << EOF_CONFIG -EOF_CONFIG - - -## Adding configuration file: vm-cdap-cluster-log4j.properties -cat > /tmp/vm-cdap-cluster-log4j.properties << EOF_CONFIG -#log4j.debug=0 -log4j.rootLogger=warn, file -log4j.logger.org.openecomp.ncomp=info, file -log4j.additivity.org.openecomp.ncomp=false - -#log4j.logger.org.apache.http.headers=debug, file -#log4j.logger.org.apache.http.wire=debug, file -## uploaded logger -log4j.logger.org.openecomp.ncomp.sirius.manager.uploaded=info, uploaded -log4j.additivity.org.openecomp.ncomp.sirius.manager.uploaded=false -## request logging -log4j.logger.org.openecomp.ncomp.sirius.manager.ManagementServer.requests=info, requests -log4j.additivity.org.openecomp.ncomp.sirius.manager.ManagementServer.requests=false -## openstack polling -log4j.logger.org.openecomp.ncomp.openstack.OpenStackUtil.polling=info, polling -log4j.additivity.org.openecomp.ncomp.openstack.OpenStackUtil.polling=false -log4j.appender.file=org.apache.log4j.RollingFileAppender -log4j.appender.file.File=logs/manager.log -log4j.appender.file.layout=org.apache.log4j.PatternLayout -log4j.appender.file.layout.ConversionPattern=%d %5p [%t] %m %C:%L%n -log4j.appender.file.MaxFileSize=50MB -log4j.appender.file.MaxBackupIndex=5 - -log4j.appender.uploaded=org.apache.log4j.RollingFileAppender -log4j.appender.uploaded.File=logs/manager-uploaded.log -log4j.appender.uploaded.layout=org.apache.log4j.PatternLayout -log4j.appender.uploaded.layout.ConversionPattern=%d %5p [%t] %m %C:%L%n -log4j.appender.uploaded.MaxFileSize=50MB -log4j.appender.uploaded.MaxBackupIndex=5 - -log4j.appender.requests=org.apache.log4j.RollingFileAppender -log4j.appender.requests.File=logs/manager-requests.log -log4j.appender.requests.layout=org.apache.log4j.PatternLayout -log4j.appender.requests.layout.ConversionPattern=%d %5p [%t] %m %C:%L%n -log4j.appender.requests.MaxFileSize=50MB -log4j.appender.requests.MaxBackupIndex=5 -log4j.appender.polling=org.apache.log4j.RollingFileAppender -log4j.appender.polling.File=logs/manager-polling.log -log4j.appender.polling.layout=org.apache.log4j.PatternLayout -log4j.appender.polling.layout.ConversionPattern=%d %5p [%t] %m %C:%L%n -log4j.appender.polling.MaxFileSize=50MB -log4j.appender.polling.MaxBackupIndex=5 - -### ECOMP Logging -log4j.logger.org.openecomp.audit=info, audit -log4j.additivity.org.openecomp.audit=false -log4j.logger.org.openecomp.metrics=info, metrics -log4j.additivity.org.openecomp.metrics=false -log4j.logger.org.openecomp.error=info, error -log4j.additivity.org.openecomp.error=false -log4j.logger.com.att.eelf.debug=info, debug -log4j.additivity.org.openecomp.debug=false -log4j.appender.audit=org.apache.log4j.RollingFileAppender -log4j.appender.audit.File=logs/audit.log -log4j.appender.audit.layout=org.apache.log4j.PatternLayout -log4j.appender.audit.layout.ConversionPattern=%d{MM/dd-HH:mm:ss.SSS}|%X{RequestId}|%X{ServiceInstanceId}|%t|%X{ServiceName}|%X{InstanceUUID}|%5p|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ServerFQDN}|%X{RemoteHost}|%X{Timer}|%m%n -log4j.appender.audit.MaxFileSize=50MB -log4j.appender.audit.MaxBackupIndex=5 -log4j.appender.metrics=org.apache.log4j.RollingFileAppender -log4j.appender.metrics.File=logs/metrics.log -log4j.appender.metrics.layout=org.apache.log4j.PatternLayout -log4j.appender.metrics.layout.ConversionPattern=%d{MM/dd-HH:mm:ss.SSS}|%X{RequestId}|%X{ServiceInstanceId}|%t|%X{ServiceName}|%X{InstanceUUID}|%p|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ServerFQDN}|%X{RemoteHost}|%X{Timer}|%m%n -log4j.appender.metrics.MaxFileSize=50MB -log4j.appender.metrics.MaxBackupIndex=5 -log4j.appender.error=org.apache.log4j.RollingFileAppender -log4j.appender.error.File=logs/error.log -log4j.appender.error.layout=org.apache.log4j.PatternLayout -log4j.appender.error.layout.ConversionPattern=%d{MM/dd-HH:mm:ss.SSS}|%X{RequestId}|%X{ServiceInstanceId}|%t|%X{ServiceName}|%X{InstanceUUID}|%p|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ServerFQDN}|%X{RemoteHost}|%X{Timer}|%m%n -log4j.appender.error.MaxFileSize=50MB -log4j.appender.error.MaxBackupIndex=5 -log4j.appender.debug=org.apache.log4j.RollingFileAppender -log4j.appender.debug.File=logs/debug.log -log4j.appender.debug.layout=org.apache.log4j.PatternLayout -log4j.appender.debug.layout.ConversionPattern=%d{MM/dd-HH:mm:ss.SSS}|%X{RequestId}|%X{ServiceInstanceId}|%t|%X{ServiceName}|%X{InstanceUUID}|%p|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ServerFQDN}|%X{RemoteHost}|%X{Timer}|%m%n -log4j.appender.debug.MaxFileSize=50MB -log4j.appender.debug.MaxBackupIndex=5 -EOF_CONFIG - - -## Adding configuration file: vm-cdap-cluster-manager.properties -cat > /tmp/vm-cdap-cluster-manager.properties << EOF_CONFIG -server.dir = data/resources -metrics.dir = data/metrics -properties.dir = data/properties -server.port = 1999 -server.user.console = NTJhYWU1NzAwMzc3OTk1 -server.user.gui = MDlhZWVjZWEwMmFiOTJi -server.user.client = YmE2OGE1N2U5NzRmMDg1 -EOF_CONFIG - - -## Adding configuration file: vm-cdap-cluster-runtime.properties -cat > /tmp/vm-cdap-cluster-runtime.properties << EOF_CONFIG -factory.vm=org.openecomp.dcae.controller.service.servers.vm.DcaeVmFactory - -## Adding configuration file: monitoring-agent-gui.properties -cat > /tmp/monitoring-agent-gui.properties << EOF_CONFIG -EOF_CONFIG - - -cat > /tmp/certificate.pkcs12.b64code << EOF_CERT -EOF_CERT - - -############################################################## -################## Config Provisioning ####################### -############################################################## - -mkdir -p ~/.ssh -touch ~/.ssh/authorized_keys -echo ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDBn8Ctt5hJGkTQaffuSeINeABV4viBIM4TcP14kaLiWR1LkyNY+TaUnjxODobtZa4YW1lxFtoMCfZt2A5W9ZZPM+shZr4BOj+wU+xIrzn7ezN/CQjH7c4Wh0mWteuPnJrtdpyGQ/qBI2T+xo5G/Tl++SPUvvN2D4H8vl0miEgVPR47/P7Ba6kl7Bmrf9m0VDPdS69Qr2AhgBq5Qi/fTeGZA4sfKDHHRJxkQIXYmS8R5FISRpBD7ta2NTHapRz9dC6Cw8UttEFiWFUBjN6lwF9LUOkj9MiqiTQaElKKQzMIHr0AhlgIkwBLKAJoDrGQD9GKPwKCdW3OmnODMPxJjXc3 > ~/.ssh/authorized_keys - -cp /tmp/ecomp-nexus.crt /usr/local/share/ca-certificates/ ; update-ca-certificates - -wget https://nexus.onap.org/content/repositories/staging/org/openecomp/dcae/controller/dcae-controller-core-utils/1.1.0/dcae-controller-core-utils-1.1.0-runtime.zip -P /opt/app/dcae-controller-core-utils - -cd /opt/app/dcae-controller-core-utils -unzip -o dcae-controller-core-utils*.zip - -chown -R dcae:dcae /opt/app/dcae-controller-core-utils - -/opt/app/dcae-controller-core-utils/bin/fs-init.py - -wget https://nexus.onap.org/content/repositories/staging/org/openecomp/dcae/controller/dcae-controller-service-cdap-cluster-manager/1.1.0/dcae-controller-service-cdap-cluster-manager-1.1.0-runtime.zip -P /opt/app/dcae-controller-service-cdap-cluster-manager - -cd /opt/app/dcae-controller-service-cdap-cluster-manager -unzip -o dcae-controller-service-cdap-cluster-manager*.zip - -chown -R dcae:dcae /opt/app/dcae-controller-service-cdap-cluster-manager - -wget https://nexus.onap.org/content/repositories/staging/org/openecomp/dcae/controller/dcae-controller-service-dmaap-drsub/1.1.0/dcae-controller-service-dmaap-drsub-1.1.0.pom -P /opt/app/dcae-controller-service-dmaap-drsub - -chown -R dcae:dcae /opt/app/dcae-controller-service-dmaap-drsub - -curl -s -k -f -o /tmp/dcae-apod-cdap-small-hadoop_1.1.0.deb https://nexus.onap.org/content/sites/raw/org.openecomp.dcae.apod.cdap/deb-releases/dcae-apod-cdap-small-hadoop_1.1.0.deb - -curl -s -k -f -o /tmp/dcae-apod-analytics-tca_1.1.0.deb https://nexus.onap.org/content/sites/raw/org.openecomp.dcae.apod.analytics/deb-releases/dcae-apod-analytics-tca_1.1.0.deb - -curl -s -k -f -o /tmp/HelloWorld-3.5.1.jar http://repo1.maven.org/maven2/co/cask/cdap/HelloWorld/3.5.1/HelloWorld-3.5.1.jar -mkdir -p /opt/app/cask-hello-world/lib -mv /tmp/HelloWorld-3.5.1.jar /opt/app/cask-hello-world/lib - -find /opt -type f -exec sed -i 's/sudo//g' {} \; - -apt-key adv --keyserver-options --keyserver keyserver.ubuntu.com --recv 07513CAD -wget -qO - http://repository.cask.co/ubuntu/precise/amd64/cdap/3.5/pubkey.gpg | apt-key add - - -wget https://nexus.onap.org/content/repositories/staging/org/openecomp/dcae/controller/dcae-controller-service-dmaap-drsub-manager/1.1.0/dcae-controller-service-dmaap-drsub-manager-1.1.0-runtime.zip -P /opt/app/dcae-controller-service-dmaap-drsub-manager - -cd /opt/app/dcae-controller-service-dmaap-drsub-manager -unzip -o dcae-controller-service-dmaap-drsub-manager-1.1.0-runtime.zip - -chown -R dcae:dcae /opt/app/dcae-controller-service-dmaap-drsub-manager - -mkdir /home/dcae/.ssh -chmod og-rwx /home/dcae/.ssh -chown -R dcae:dcae /home/dcae/.ssh -touch /home/dcae/.ssh/authorized_keys -chmod og-rwx /home/dcae/.ssh/authorized_keys -chown -R dcae:dcae /home/dcae/.ssh/authorized_keys -echo ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDBn8Ctt5hJGkTQaffuSeINeABV4viBIM4TcP14kaLiWR1LkyNY+TaUnjxODobtZa4YW1lxFtoMCfZt2A5W9ZZPM+shZr4BOj+wU+xIrzn7ezN/CQjH7c4Wh0mWteuPnJrtdpyGQ/qBI2T+xo5G/Tl++SPUvvN2D4H8vl0miEgVPR47/P7Ba6kl7Bmrf9m0VDPdS69Qr2AhgBq5Qi/fTeGZA4sfKDHHRJxkQIXYmS8R5FISRpBD7ta2NTHapRz9dC6Cw8UttEFiWFUBjN6lwF9LUOkj9MiqiTQaElKKQzMIHr0AhlgIkwBLKAJoDrGQD9GKPwKCdW3OmnODMPxJjXc3 >> /home/dcae/.ssh/authorized_keys - -#bash /opt/app/dcae-cdap-small-hadoop/install.sh diff --git a/kubernetes/dcae/cdap/docker/01-entrypoint.sh b/kubernetes/dcae/cdap/docker/01-entrypoint.sh deleted file mode 100755 index 952d1d4cc6..0000000000 --- a/kubernetes/dcae/cdap/docker/01-entrypoint.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -dpkg --install /tmp/dcae-apod-cdap-small-hadoop_1.1.0.deb -dpkg --install /tmp/dcae-apod-analytics-tca_1.1.0.deb - -bash /opt/app/dcae-cdap-small-hadoop/install.sh -su dcae -c "/opt/app/dcae-controller-service-cdap-cluster-manager/bin/manager.sh config" -su dcae -c "/opt/app/dcae-controller-service-cdap-cluster-manager/bin/manager.sh restart"
\ No newline at end of file diff --git a/kubernetes/dcae/cdap/docker/Dockerfile b/kubernetes/dcae/cdap/docker/Dockerfile deleted file mode 100644 index 5b8583ee51..0000000000 --- a/kubernetes/dcae/cdap/docker/Dockerfile +++ /dev/null @@ -1,57 +0,0 @@ -FROM ubuntu:16.04 - -# Setup apt.conf proxy settings -#RUN echo 'Acquire::http::proxy "http://some.proxy:8084/";' >> /etc/apt/apt.conf - -# Setup Corporate proxy -#ENV no_proxy "localhost,127.0.0.1,localaddress,.localdomain.com,192.168.141.0/24" -#ENV https_proxy http://some.proxy:8084/ -#ENV http_proxy http://fsome.proxy:8084/ -#ENV HTTP_PROXY http://some.proxy:8084/ -#ENV HTTPS_PROXY http://some.proxy:8084/ -#ENV FTP_PROXY http://some.proxy:8084/ -#ENV NO_PROXY "localhost,127.0.0.1,localaddress,.localdomain.com,192.168.141.0/24" - -# Additional packages -RUN apt-get update -y -RUN apt-get install -y git wget unzip curl dnsutils sudo -RUN apt-get install -y maven unzip - -# Install python and pip -RUN apt-get install -y python -RUN wget https://bootstrap.pypa.io/get-pip.py -RUN python get-pip.py -RUN rm get-pip.py -RUN pip install pyyaml - -# Install Groovy -RUN mkdir -p /opt/app -RUN (cd /opt/app ; curl -Lo apache-groovy-binary-2.4.6.zip https://dl.bintray.com/groovy/maven/apache-groovy-binary-2.4.6.zip ) -RUN (cd /opt/app ; unzip apache-groovy-binary-2.4.6.zip ) -RUN mkdir -p /opt/app/java/jdk -RUN ln -s /usr /opt/app/java/jdk/jdk170 -RUN mkdir -p /opt/app/groovy -RUN ln -s /opt/app/groovy-2.4.6 /opt/app/groovy/246 -ENV JAVA_HOME /opt/app/java/jdk/jdk170 - -# Create user dcae -RUN if [ ! -e /home/dcae ]; then useradd -m -s /bin/bash dcae; fi - -# Hadoop -EXPOSE 8020 8025 50070 50075 50010 50020 - -# Zookeeper -EXPOSE 3888 2888 2181 - -VOLUME /opt/tools -VOLUME /opt/data - -# Provisioning -COPY 00-provisioning.sh /usr/local/bin/00-provisioning.sh -RUN chmod a+x /usr/local/bin/00-provisioning.sh -RUN /usr/local/bin/00-provisioning.sh - -# define the entrypoint -COPY 01-entrypoint.sh /usr/local/bin/01-entrypoint.sh -RUN chmod a+x /usr/local/bin/01-entrypoint.sh -ENTRYPOINT ["/usr/local/bin/01-entrypoint.sh"] diff --git a/kubernetes/dcae/cdap/docker/docker-compose.yaml b/kubernetes/dcae/cdap/docker/docker-compose.yaml deleted file mode 100644 index 100cef499f..0000000000 --- a/kubernetes/dcae/cdap/docker/docker-compose.yaml +++ /dev/null @@ -1,58 +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. - -version: '2' -services: - cdap00: - build: . - hostname: zldcprivatecloudtruecdap00 - image: cdap - ports: - - 8020 - - 50070 - - 50075 - - 50010 - - 50020 - - 3888 - - 2888 - - 2181 - - 8025 - cdap01: - build: . - hostname: zldcprivatecloudtruecdap01 - image: cdap - ports: - - 8020 - - 50070 - - 50075 - - 50010 - - 50020 - - 3888 - - 2888 - - 2181 - - 8025 - cdap02: - build: . - hostname: zldcprivatecloudtruecdap02 - image: cdap - ports: - - 8020 - - 50070 - - 50075 - - 50010 - - 50020 - - 3888 - - 2888 - - 2181 - - 8025
\ No newline at end of file diff --git a/kubernetes/dcae/cdap/docker/fs/Dockerfile b/kubernetes/dcae/cdap/docker/fs/Dockerfile deleted file mode 100644 index 4e458dcd1e..0000000000 --- a/kubernetes/dcae/cdap/docker/fs/Dockerfile +++ /dev/null @@ -1,4 +0,0 @@ -FROM ubuntu:16.04 - -RUN mkdir -p /cdap -VOLUME /cdap
\ No newline at end of file diff --git a/kubernetes/dcae/pgaas/Dockerfile b/kubernetes/dcae/pgaas/Dockerfile deleted file mode 100755 index e1d147dfa9..0000000000 --- a/kubernetes/dcae/pgaas/Dockerfile +++ /dev/null @@ -1,45 +0,0 @@ -FROM ubuntu:16.04 - -# Install additional packages -RUN apt-get update && apt-get -y install maven openjdk-8-jdk unzip python-pip curl dnsutils vim gawk wget openssh-client-ssh1 -RUN pip install pyyaml - -RUN apt-get update && apt-get install -y postgresql libpq5 repmgr python-psycopg2 python3-psycopg2 libgetopt-java -RUN rm -f /usr/sbin/policy-rc.d - -# Install Groovy -RUN mkdir -p /opt/app -RUN (cd /opt/app ; curl -Lo apache-groovy-binary-2.4.6.zip https://dl.bintray.com/groovy/maven/apache-groovy-binary-2.4.6.zip ) -RUN (cd /opt/app ; unzip apache-groovy-binary-2.4.6.zip ) -RUN mkdir -p /opt/app/java/jdk -RUN ln -s /usr /opt/app/java/jdk/jdk170 -RUN mkdir -p /opt/app/groovy -RUN ln -s /opt/app/groovy-2.4.6 /opt/app/groovy/246 - -# Create user dcae -RUN if [ ! -e /home/dcae ]; then useradd -m -s /bin/bash dcae; fi - -# Download required packages -RUN curl -s -k -f -o /tmp/org.openecomp.dcae.storage.pgaas-cdf_1.0.0.deb https://nexus.onap.org/content/sites/raw/org.openecomp.dcae.pgaas/deb-releases/org.openecomp.dcae.storage.pgaas-cdf_1.0.0.deb -RUN curl -s -k -f -o /tmp/org.openecomp.dcae.storage.pgaas-postgresql-prep_1.0.0.deb https://nexus.onap.org/content/sites/raw/org.openecomp.dcae.pgaas/deb-releases/org.openecomp.dcae.storage.pgaas-postgresql-prep_1.0.0.deb -RUN curl -s -k -f -o /tmp/org.openecomp.dcae.storage.pgaas-postgresql-config_1.0.0.deb https://nexus.onap.org/content/sites/raw/org.openecomp.dcae.pgaas/deb-releases/org.openecomp.dcae.storage.pgaas-postgresql-config_1.0.0.deb -RUN curl -s -k -f -o /tmp/org.openecomp.dcae.storage.pgaas-pgaas_1.0.0.deb https://nexus.onap.org/content/sites/raw/org.openecomp.dcae.pgaas/deb-releases/org.openecomp.dcae.storage.pgaas-pgaas_1.0.0.deb -RUN curl -s -k -f -o /tmp/org.openecomp.dcae.storage.pgaas-pgaas-post_1.0.0.deb https://nexus.onap.org/content/sites/raw/org.openecomp.dcae.pgaas/deb-releases/org.openecomp.dcae.storage.pgaas-pgaas-post_1.0.0.deb - -RUN apt-get update && apt-get install -y sudo && rm -rf /var/lib/apt/lists/* - -RUN mkdir -p /opt/tools -RUN mkdir -p /dbroot/pgdata -RUN mkdir -p /dbroot/pglogs - -EXPOSE 5432 - -VOLUME /opt/tools -VOLUME /dbroot/pgdata -VOLUME /dbroot/pglogs - -# Setup the entrypoint -COPY setup.sh /usr/local/bin/entrypoint.sh -RUN chmod a+x /usr/local/bin/entrypoint.sh - -ENTRYPOINT ["usr/local/bin/entrypoint.sh"] diff --git a/kubernetes/dcae/pgaas/setup.sh b/kubernetes/dcae/pgaas/setup.sh deleted file mode 100755 index a843995003..0000000000 --- a/kubernetes/dcae/pgaas/setup.sh +++ /dev/null @@ -1,437 +0,0 @@ -#!/bin/bash -cat > /tmp/dcae_install.sh << EOF_DCAE_INSTALL -#!/bin/bash -set -x -cd /tmp - -export DEBIAN_FRONTEND=noninteractive - -#### Using special configuration resource: instances/vm-postgresql/iad4.yaml -## Adding configuration file: main -cat | cat > /tmp/postgres.conf << EOF_CONFIG -master: zldciad4vipstg00 -secondmaster: notused -DRTR_NODE_KSTOREFILE: /opt/app/dcae-certificate/keystore.jks -DRTR_NODE_KSTOREPASS: "No Certificate" -DRTR_NODE_PVTKEYPASS: "No Certificate" -PG_NODES : zldciad4vipstg00 -PG_JAVA_HOME : /opt/app/java/jdk/jdk170 -PG_CLUSTER : site -EOF_CONFIG - -## Adding configuration file: mount_config -cat | cat > /tmp/dcae-mount.conf << EOF_CONFIG -osType: ubuntu -volumes: - opt: - uuid: ephemeral - size: 80 - filesystems: - /opt/tools: - size: 80 - type: ext4 - mount_opts: '' - dbroot: - uuid: cinder - size: 75 - filesystems: - /dbroot/pgdata: - size: 50 - type: ext4 - mount_opts: '' - /dbroot/pglogs: - size: 25 - type: ext4 - mount_opts: '' - -EOF_CONFIG - -## Adding configuration file: ecomp-nexus -cat > /tmp/ecomp-nexus.crt << EOF_CONFIG ------BEGIN CERTIFICATE----- -MIIDtzCCAp+gAwIBAgIEet16RjANBgkqhkiG9w0BAQsFADB2MQswCQYDVQQGEwJVUzEUMBIGA1UE -CBMLVW5zcGVjaWZpZWQxFDASBgNVBAcTC1Vuc3BlY2lmaWVkMREwDwYDVQQKEwhTb25hdHlwZTEQ -MA4GA1UECxMHRXhhbXBsZTEWMBQGA1UEAwwNKi5lY29tcC1uZXh1czAeFw0xNjExMTQxMDE5NDJa -Fw0zMDA3MjQxMDE5NDJaMHYxCzAJBgNVBAYTAlVTMRQwEgYDVQQIEwtVbnNwZWNpZmllZDEUMBIG -A1UEBxMLVW5zcGVjaWZpZWQxETAPBgNVBAoTCFNvbmF0eXBlMRAwDgYDVQQLEwdFeGFtcGxlMRYw -FAYDVQQDDA0qLmVjb21wLW5leHVzMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqkDu -vC91cZxOaRMYGHSyDeuw4hyXjqyD5Etl5L5TNN7+uFKEtvXsRYOxtD62TqWHKozffLE5o6zoRZL4 -8qNTQyAx0LaEfWfR2w0jat+UqtqEtW0xpOD0/O0qRq5Y/XG3Yr8SQ/y84Pr1FIflM7pM4PZTt3kc -UfqzbaONW5K8t+UG+5jgNXdRk3hln8WMunVZeci0J6TV+tWs9tOeAKBdpI7K7LV+FJBaF8vBAw2x -8AhlNPXKQUhK+M3DD73c1aLWrZ3mIwJXt2oQUDwgtXGCPR1/Z9f2tTAoDxpzvkwtP/BtH3qvgtpY -QfDNmWbJVHh6ll39Hapt7V0v4aCRSN21ZQIDAQABo00wSzAMBgNVHRMEBTADAQH/MBwGA1UdEQQV -MBOCC2Vjb21wLW5leHVzhwQK0MVLMB0GA1UdDgQWBBQxcUlk/lkKkwSz0GuewbXptJxl+zANBgkq -hkiG9w0BAQsFAAOCAQEAPnNbtdreMZaUSjv+1eqpriLKquwnZhnwWENn1u3sw4hTAWQc+ehhogGg -eIqPN81Dt3jhr0bYZW+r3gGq7tgrLxdSXso8bTtqHsFLszirgWcQXDlBQGnw9wqp/KBzeDJInJep -d6aGu3yBXV6459S/mClxZTSvsR+Vz3rRWxx01R3/ft5/myqrRMDnEncqPopTbEamBuUJL3eJDpFO -xlVqYR3y6AXwwguMaTiHMfFBmDOVaz4K8Qy6AaHH9eoch9fxOJ/7ASvqSwkC9GYTJSnF2vE37rmH -kPp//Vm4WSnQ2NrBGkH9rUUdYdDdgWJYnTeZ+YFd8J6z9xNiEn9QKQNNcA== ------END CERTIFICATE----- - -EOF_CONFIG -## Adding configuration file: vm-postgresql-console.properties -cat > /tmp/vm-postgresql-console.properties << EOF_CONFIG -localhost.endpoint=http://localhost:9999 -localhost.user=console -localhost.password=MDBmMzE0NTgyMDU1NmVj -EOF_CONFIG - -## Adding configuration file: vm-postgresql-gui.properties -cat > /tmp/vm-postgresql-gui.properties << EOF_CONFIG -EOF_CONFIG - -## Adding configuration file: vm-postgresql-log4j.properties -cat > /tmp/vm-postgresql-log4j.properties << EOF_CONFIG -#log4j.debug=0 -log4j.rootLogger=warn, file -log4j.logger.org.openecomp.ncomp=info, file -log4j.additivity.org.openecomp.ncomp=false - -#log4j.logger.org.apache.http.headers=debug, file -#log4j.logger.org.apache.http.wire=debug, file -## uploaded logger -log4j.logger.org.openecomp.ncomp.sirius.manager.uploaded=info, uploaded -log4j.additivity.org.openecomp.ncomp.sirius.manager.uploaded=false -## request logging -log4j.logger.org.openecomp.ncomp.sirius.manager.ManagementServer.requests=info, requests -log4j.additivity.org.openecomp.ncomp.sirius.manager.ManagementServer.requests=false -## openstack polling -log4j.logger.org.openecomp.ncomp.openstack.OpenStackUtil.polling=info, polling -log4j.additivity.org.openecomp.ncomp.openstack.OpenStackUtil.polling=false -log4j.appender.file=org.apache.log4j.RollingFileAppender -log4j.appender.file.File=logs/manager.log -log4j.appender.file.layout=org.apache.log4j.PatternLayout -log4j.appender.file.layout.ConversionPattern=%d %5p [%t] %m %C:%L%n -log4j.appender.file.MaxFileSize=50MB -log4j.appender.file.MaxBackupIndex=5 - -log4j.appender.uploaded=org.apache.log4j.RollingFileAppender -log4j.appender.uploaded.File=logs/manager-uploaded.log -log4j.appender.uploaded.layout=org.apache.log4j.PatternLayout -log4j.appender.uploaded.layout.ConversionPattern=%d %5p [%t] %m %C:%L%n -log4j.appender.uploaded.MaxFileSize=50MB -log4j.appender.uploaded.MaxBackupIndex=5 - -log4j.appender.requests=org.apache.log4j.RollingFileAppender -log4j.appender.requests.File=logs/manager-requests.log -log4j.appender.requests.layout=org.apache.log4j.PatternLayout -log4j.appender.requests.layout.ConversionPattern=%d %5p [%t] %m %C:%L%n -log4j.appender.requests.MaxFileSize=50MB -log4j.appender.requests.MaxBackupIndex=5 -log4j.appender.polling=org.apache.log4j.RollingFileAppender -log4j.appender.polling.File=logs/manager-polling.log -log4j.appender.polling.layout=org.apache.log4j.PatternLayout -log4j.appender.polling.layout.ConversionPattern=%d %5p [%t] %m %C:%L%n -log4j.appender.polling.MaxFileSize=50MB -log4j.appender.polling.MaxBackupIndex=5 - -### ECOMP Logging -log4j.logger.org.openecomp.audit=info, audit -log4j.additivity.org.openecomp.audit=false -log4j.logger.org.openecomp.metrics=info, metrics -log4j.additivity.org.openecomp.metrics=false -log4j.logger.org.openecomp.error=info, error -log4j.additivity.org.openecomp.error=false -log4j.logger.com.att.eelf.debug=info, debug -log4j.additivity.org.openecomp.debug=false -log4j.appender.audit=org.apache.log4j.RollingFileAppender -log4j.appender.audit.File=logs/audit.log -log4j.appender.audit.layout=org.apache.log4j.PatternLayout -log4j.appender.audit.layout.ConversionPattern=%d{MM/dd-HH:mm:ss.SSS}|%X{RequestId}|%X{ServiceInstanceId}|%t|%X{ServiceName}|%X{InstanceUUID}|%5p|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ServerFQDN}|%X{RemoteHost}|%X{Timer}|%m%n -log4j.appender.audit.MaxFileSize=50MB -log4j.appender.audit.MaxBackupIndex=5 -log4j.appender.metrics=org.apache.log4j.RollingFileAppender -log4j.appender.metrics.File=logs/metrics.log -log4j.appender.metrics.layout=org.apache.log4j.PatternLayout -log4j.appender.metrics.layout.ConversionPattern=%d{MM/dd-HH:mm:ss.SSS}|%X{RequestId}|%X{ServiceInstanceId}|%t|%X{ServiceName}|%X{InstanceUUID}|%p|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ServerFQDN}|%X{RemoteHost}|%X{Timer}|%m%n -log4j.appender.metrics.MaxFileSize=50MB -log4j.appender.metrics.MaxBackupIndex=5 -log4j.appender.error=org.apache.log4j.RollingFileAppender -log4j.appender.error.File=logs/error.log -log4j.appender.error.layout=org.apache.log4j.PatternLayout -log4j.appender.error.layout.ConversionPattern=%d{MM/dd-HH:mm:ss.SSS}|%X{RequestId}|%X{ServiceInstanceId}|%t|%X{ServiceName}|%X{InstanceUUID}|%p|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ServerFQDN}|%X{RemoteHost}|%X{Timer}|%m%n -log4j.appender.error.MaxFileSize=50MB -log4j.appender.error.MaxBackupIndex=5 -log4j.appender.debug=org.apache.log4j.RollingFileAppender -log4j.appender.debug.File=logs/debug.log -log4j.appender.debug.layout=org.apache.log4j.PatternLayout -log4j.appender.debug.layout.ConversionPattern=%d{MM/dd-HH:mm:ss.SSS}|%X{RequestId}|%X{ServiceInstanceId}|%t|%X{ServiceName}|%X{InstanceUUID}|%p|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ServerFQDN}|%X{RemoteHost}|%X{Timer}|%m%n -log4j.appender.debug.MaxFileSize=50MB -log4j.appender.debug.MaxBackupIndex=5 -EOF_CONFIG - -## Adding configuration file: vm-postgresql-manager.properties -cat > /tmp/vm-postgresql-manager.properties << EOF_CONFIG -server.dir = data/resources -metrics.dir = data/metrics -properties.dir = data/properties -server.port = 9999 -server.user.console = MDBmMzE0NTgyMDU1NmVj -server.user.gui = M2NiOTg1YzNiYTI2NTJh -server.user.client = OTNmMmFkYzkxMzYzNTk0 -EOF_CONFIG - -## Adding configuration file: vm-postgresql-runtime.properties -cat > /tmp/vm-postgresql-runtime.properties << EOF_CONFIG -factory.vm=org.openecomp.dcae.controller.service.servers.vm.DcaeVmFactory -factory.postgres=org.openecomp.dcae.controller.service.storage.postgres.service.impl.ServicePackageImpl -EOF_CONFIG - -## Adding configuration file: vm-postgresql-hosts -cat > /tmp/vm-postgresql-hosts << EOF_CONFIG -EOF_CONFIG - -## Adding configuration file: monitoring-agent-gui.properties -cat > /tmp/monitoring-agent-gui.properties << EOF_CONFIG -EOF_CONFIG - -cat >> /etc/hosts << HOSTS_EOF -HOSTS_EOF - -cat > /tmp/certificate.pkcs12.b64code << EOF_CERT -EOF_CERT - -############################################################## -##################### CLOUDINIT ############################## -############################################################## - -## need to fix cloudinit in Centos. - -CLOUDHOSTCFG=/etc/cloud/cloud.cfg.d/99_hostname.cfg -if [ -f /etc/redhat-release ]; then - # CentOS/RHEL - ( echo "hostname: \$(hostname)"; echo "fqdn: \$(hostname -f)" ) > \$CLOUDHOSTCFG -fi - -mkdir -p ~/.ssh -touch ~/.ssh/authorized_keys - -echo ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCYz++VKcW3Sw0Sh7fFyTIjXED6NUUNYbje7awcnvaHHAC0rUxs7boX6hmWDViXoGZA5xw4Xhk5kIEs+zxMCDlF1q/9rbyq5ndonlBz3aPx7+SBqVR5sPalbSr8dJhGPwpj/0Df+FzqjGVL2p2d4VV7SeT/kKrNcSY6SmYHln6osoGFAHsOZC0d+fiba4zfCI9EI6zHdyCujwayjQ5W5UgA50XQ0KXpI5WtF6MOwO6jPL3SNNDlWobG/nsCAMxTQ04dALpYSoamM12Ps72MfxEwaKkoAcsH6WsFbuvoUSXwNcosmyxYrxNynsUz4C2Tz+PZqelGvm8Y8MtNuhN7oqAD root@ecomp-jumpbox >> /home/ubuntu/.ssh/authorized_keys - -######### step-1 - -cp /tmp/ecomp-nexus.crt /usr/local/share/ca-certificates/ ; update-ca-certificates - -######### step-2 - -echo 162.242.254.138 ecomp-nexus >> /etc/hosts - -######### step-3 - -if [ ! -e /home/dcae ]; then useradd -m -s /bin/bash dcae; fi - -case runtime in - %*) - A1=org.openecomp.dcae.controller:dcae-controller-core-utils:1.0.0:zip - ;; - *) - A1=org.openecomp.dcae.controller:dcae-controller-core-utils:1.0.0:zip:runtime - ;; -esac - -wget https://nexus.onap.org/content/repositories/staging/org/openecomp/dcae/controller/dcae-controller-core-utils/1.0.0/dcae-controller-core-utils-1.0.0-runtime.zip -P /opt/app/dcae-controller-core-utils - -case zip in - jar) - mkdir /opt/app/dcae-controller-core-utils/lib - mv /opt/app/dcae-controller-core-utils/*.jar /opt/app/dcae-controller-core-utils/lib - ;; - zip) - ( cd /opt/app/dcae-controller-core-utils ; unzip -o dcae-controller-core-utils*.zip ) - ;; -esac - -chown -R dcae:dcae /opt/app/dcae-controller-core-utils - -######### step-4 - -/opt/app/dcae-controller-core-utils/bin/fs-init.py - -######### step-5 - -if [ ! -e /home/dcae ]; then useradd -m -s /bin/bash dcae; fi - -case runtime in - %*) - A1=org.openecomp.dcae.controller:dcae-controller-service-common-vm-manager:1.0.0:zip - ;; - *) - A1=org.openecomp.dcae.controller:dcae-controller-service-common-vm-manager:1.0.0:zip:runtime - ;; -esac - -wget https://nexus.onap.org/content/repositories/staging/org/openecomp/dcae/controller/dcae-controller-service-common-vm-manager/1.0.0/dcae-controller-service-common-vm-manager-1.0.0-runtime.zip -P /opt/app/dcae-controller-service-common-vm-manager - -case zip in - jar) - mkdir /opt/app/dcae-controller-service-common-vm-manager/lib - mv /opt/app/dcae-controller-service-common-vm-manager/*.jar /opt/app/dcae-controller-service-common-vm-manager/lib - ;; - zip) - ( cd /opt/app/dcae-controller-service-common-vm-manager ; unzip -o dcae-controller-service-common-vm-manager*.zip ) - ;; -esac - -chown -R dcae:dcae /opt/app/dcae-controller-service-common-vm-manager - -######### step-6 - -if [ ! -e /home/dcae ]; then useradd -m -s /bin/bash dcae; fi - -case %{assemblyId} in - %*) - A1=org.openecomp.dcae.controller:dcae-controller-service-storage-postgres-model:1.0.0:jar - ;; - *) - A1=org.openecomp.dcae.controller:dcae-controller-service-storage-postgres-model:1.0.0:jar:%{assemblyId} - ;; -esac - -wget https://nexus.onap.org/content/repositories/staging/org/openecomp/dcae/controller/dcae-controller-service-storage-postgres-model/1.0.0/dcae-controller-service-storage-postgres-model-1.0.0.jar -P /opt/app/dcae-controller-service-storage-postgres-model - -case jar in - jar) - mkdir /opt/app/dcae-controller-service-storage-postgres-model/lib - mv /opt/app/dcae-controller-service-storage-postgres-model/*.jar /opt/app/dcae-controller-service-storage-postgres-model/lib - ;; - zip) - ( cd /opt/app/dcae-controller-service-storage-postgres-model ; unzip -o dcae-controller-service-storage-postgres-model*.zip ) - ;; -esac - -chown -R dcae:dcae /opt/app/dcae-controller-service-storage-postgres-model - -######### step-7 - -if [ ! -e /home/dcae ]; then useradd -m -s /bin/bash dcae; fi - -OUT=/tmp/`basename https://nexus.onap.org/content/sites/raw/org.openecomp.dcae.pgaas/deb-releases/org.openecomp.dcae.storage.pgaas-cdf_1.0.0.deb` - -case deb in - deb) - dpkg --install \$OUT - ;; - jar) - mkdir -p /opt/app/%{artifactId}/lib - mv \$OUT /opt/app/%{artifactId}/lib - chown -R dcae:dcae /opt/app/%{artifactId} - ;; - zip) - mkdir -p /opt/app/%{artifactId}/lib - ( cd /opt/app/%{artifactId} ; cp -p \$OUT . ; unzip -o \$OUT ) - chown -R dcae:dcae /opt/app/%{artifactId} - ;; -esac - -######### step-8 - -if [ ! -e /home/dcae ]; then useradd -m -s /bin/bash dcae; fi - -OUT=/tmp/`basename https://nexus.onap.org/content/sites/raw/org.openecomp.dcae.pgaas/deb-releases/org.openecomp.dcae.storage.pgaas-postgresql-prep_1.0.0.deb` - -case deb in - deb) - dpkg --install \$OUT - ;; - jar) - mkdir -p /opt/app/%{artifactId}/lib - mv \$OUT /opt/app/%{artifactId}/lib - chown -R dcae:dcae /opt/app/%{artifactId} - ;; - zip) - mkdir -p /opt/app/%{artifactId}/lib - ( cd /opt/app/%{artifactId} ; cp -p \$OUT . ; unzip -o \$OUT ) - chown -R dcae:dcae /opt/app/%{artifactId} - ;; -esac - -######### step-9 - -if [ ! -e /home/dcae ]; then useradd -m -s /bin/bash dcae; fi - -OUT=/tmp/`basename https://nexus.onap.org/content/sites/raw/org.openecomp.dcae.pgaas/deb-releases/org.openecomp.dcae.storage.pgaas-postgresql-config_1.0.0.deb` - -case deb in - deb) - dpkg --install \$OUT - ;; - jar) - mkdir -p /opt/app/%{artifactId}/lib - mv \$OUT /opt/app/%{artifactId}/lib - chown -R dcae:dcae /opt/app/%{artifactId} - ;; - zip) - mkdir -p /opt/app/%{artifactId}/lib - ( cd /opt/app/%{artifactId} ; cp -p \$OUT . ; unzip -o \$OUT ) - chown -R dcae:dcae /opt/app/%{artifactId} - ;; -esac - -######### step-10 - -if [ ! -e /home/dcae ]; then useradd -m -s /bin/bash dcae; fi - -OUT=/tmp/`basename https://nexus.onap.org/content/sites/raw/org.openecomp.dcae.pgaas/deb-releases/org.openecomp.dcae.storage.pgaas-pgaas_1.0.0.deb` - -case deb in - deb) - dpkg --install \$OUT - ;; - jar) - mkdir -p /opt/app/%{artifactId}/lib - mv \$OUT /opt/app/%{artifactId}/lib - chown -R dcae:dcae /opt/app/%{artifactId} - ;; - zip) - mkdir -p /opt/app/%{artifactId}/lib - ( cd /opt/app/%{artifactId} ; cp -p \$OUT . ; unzip -o \$OUT ) - chown -R dcae:dcae /opt/app/%{artifactId} - ;; -esac - -touch /etc/sudoers.d/dcae-postgres -echo "dcae ALL=(postgres) NOPASSWD: ALL" > /etc/sudoers.d/dcae-postgres - -/opt/app/postgresql-prep/bin/iDNS-responder.py & - -/etc/init.d/cron restart - -######### step-11 - -if [ ! -e /home/dcae ]; then useradd -m -s /bin/bash dcae; fi - -OUT=/tmp/`basename https://nexus.onap.org/content/sites/raw/org.openecomp.dcae.pgaas/deb-releases/org.openecomp.dcae.storage.pgaas-pgaas-post_1.0.0.deb` -case deb in - deb) - dpkg --install \$OUT - ;; - jar) - mkdir -p /opt/app/%{artifactId}/lib - mv \$OUT /opt/app/%{artifactId}/lib - chown -R dcae:dcae /opt/app/%{artifactId} - ;; - zip) - mkdir -p /opt/app/%{artifactId}/lib - ( cd /opt/app/%{artifactId} ; cp -p \$OUT . ; unzip -o \$OUT ) - chown -R dcae:dcae /opt/app/%{artifactId} - ;; -esac - -######### step-12 - -find /opt -type f -exec sed -i 's/sudo//g' {} \; -su dcae -c "/opt/app/dcae-controller-service-common-vm-manager/bin/manager.sh config" -su dcae -c "/opt/app/dcae-controller-service-common-vm-manager/bin/manager.sh restart" - -mkdir /home/dcae/.ssh -chmod og-rwx /home/dcae/.ssh -chown -R dcae:dcae /home/dcae/.ssh -touch /home/dcae/.ssh/authorized_keys -chmod og-rwx /home/dcae/.ssh/authorized_keys -chown -R dcae:dcae /home/dcae/.ssh/authorized_keys -echo ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCYz++VKcW3Sw0Sh7fFyTIjXED6NUUNYbje7awcnvaHHAC0rUxs7boX6hmWDViXoGZA5xw4Xhk5kIEs+zxMCDlF1q/9rbyq5ndonlBz3aPx7+SBqVR5sPalbSr8dJhGPwpj/0Df+FzqjGVL2p2d4VV7SeT/kKrNcSY6SmYHln6osoGFAHsOZC0d+fiba4zfCI9EI6zHdyCujwayjQ5W5UgA50XQ0KXpI5WtF6MOwO6jPL3SNNDlWobG/nsCAMxTQ04dALpYSoamM12Ps72MfxEwaKkoAcsH6WsFbuvoUSXwNcosmyxYrxNynsUz4C2Tz+PZqelGvm8Y8MtNuhN7oqAD root@ecomp-jumpbox >> /home/dcae/.ssh/authorized_keys -#no final script: vm-postgresql.userdata -EOF_DCAE_INSTALL -echo null > /tmp/.password -chmod u+x /tmp/dcae_install.sh -/tmp/dcae_install.sh 2>&1 | tee /tmp/dcae_install.log diff --git a/kubernetes/dcae/templates/all-services.yaml b/kubernetes/dcae/templates/all-services.yaml deleted file mode 100644 index 998f97d3bd..0000000000 --- a/kubernetes/dcae/templates/all-services.yaml +++ /dev/null @@ -1,143 +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.disableDcaeZookeeper }} -apiVersion: v1 -kind: Service -metadata: - name: zookeeper - namespace: "{{ .Values.nsPrefix }}" - labels: - app: zookeeper -spec: - ports: - - name: zookeeper1 - port: 2181 - selector: - app: zookeeper - clusterIP: None -#{{ end }} -#{{ if not .Values.disableDcaeKafka }} ---- -apiVersion: v1 -kind: Service -metadata: - name: kafka - namespace: "{{ .Values.nsPrefix }}" - labels: - app: kafka -spec: - ports: - - name: kafka1 - port: 9092 - selector: - app: kafka - clusterIP: None -#{{ end }} -#{{ if not .Values.disableDcaeDmaap }} ---- -apiVersion: v1 -kind: Service -metadata: - name: dmaap - namespace: "{{ .Values.nsPrefix }}" - labels: - app: dmaap - version: 1.1.0 -spec: - ports: - - name: mr1 - port: 3904 - #nodePort: {{ .Values.nodePortPrefix }}27 - - name: mr2 - port: 3905 - #nodePort: {{ .Values.nodePortPrefix }}26 - selector: - app: dmaap - #type: NodePort - clusterIP: None -#{{ end }} -#{{ if not .Values.disableDcaeDcaePgaas }} ---- -apiVersion: v1 -kind: Service -metadata: - name: zldciad4vipstg00 - namespace: "{{ .Values.nsPrefix }}" - labels: - app: dcae-pgaas -spec: - selector: - app: dcae-pgaas - ports: - - port: 5432 - protocol: TCP - targetPort: 5432 - nodePort: {{ .Values.nodePortPrefix }}45 - type: NodePort -#{{ end }} -#{{ if not .Values.disableDcaeDcaeCollectorCommonEvent }} ---- -apiVersion: v1 -kind: Service -metadata: - labels: - app: dcae-collector-common-event - version: latest - name: dcae-collector-common-event - namespace: "{{ .Values.nsPrefix }}" -spec: - ports: - - name: dcae-ce1 - port: 8080 - protocol: TCP - nodePort: {{ .Values.nodePortPrefix }}36 - - name: dcae-ce2 - port: 8443 - protocol: TCP - nodePort: {{ .Values.nodePortPrefix }}37 - - name: dcae-ce3 - port: 9999 - protocol: TCP - nodePort: {{ .Values.nodePortPrefix }}38 - selector: - app: dcae-collector-common-event - type: NodePort -#{{ end }} -#{{ if not .Values.disableDcaeDcaeCollectorDmaapbc }} ---- -apiVersion: v1 -kind: Service -metadata: - labels: - app: dcae-collector-dmaapbc - version: latest - name: dcae-collector-dmaapbc - namespace: "{{ .Values.nsPrefix }}" -spec: - ports: - - name: dcae-bc1 - port: 8080 - protocol: TCP - targetPort: 8080 - nodePort: {{ .Values.nodePortPrefix }}39 - - name: dcae-bc2 - port: 8443 - protocol: TCP - targetPort: 8443 - nodePort: {{ .Values.nodePortPrefix }}40 - selector: - app: dcae-collector-dmaapbc - type: NodePort -#{{ end }}
\ No newline at end of file diff --git a/kubernetes/dcae/templates/cdap0-dep.yaml b/kubernetes/dcae/templates/cdap0-dep.yaml deleted file mode 100644 index 5b0e465ed8..0000000000 --- a/kubernetes/dcae/templates/cdap0-dep.yaml +++ /dev/null @@ -1,93 +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.disableDcaeCdap }} -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - annotations: - deployment.kubernetes.io/revision: "1" - labels: - app: cdap0 - name: cdap0 - namespace: "{{ .Values.nsPrefix }}" -spec: - selector: - matchLabels: - app: cdap0 - strategy: - rollingUpdate: - maxSurge: 1 - maxUnavailable: 1 - type: RollingUpdate - template: - metadata: - labels: - app: cdap0 - name: cdap0 - spec: - initContainers: - - command: ["/bin/bash", "-c", "mkdir -p /cdap/{cdap0-opt-tools,cdap0-opt-data,pod-ip}; grep `hostname` /etc/hosts > /cdap/pod-ip/`hostname`_ip.txt; while [`ls /cdap/pod-ip | wc -l` < 3]; do sleep 1; done"] - name: create-fs - image: {{ .Values.image.cdapfs }} - imagePullPolicy: {{ .Values.pullPolicy }} - volumeMounts: - - mountPath: /cdap - name: cdap-root - hostname: zldcprivatecloudtruecdap00 - containers: - - image: {{ .Values.image.cdap }} - imagePullPolicy: {{ .Values.pullPolicy }} - command: ["/bin/bash"] - args: ["-c", "cat /cdap/pod-ip/* >> /etc/hosts; /usr/local/bin/01-entrypoint.sh; sleep infinity;"] - name: cdap0 - ports: - - containerPort: 8020 - protocol: TCP - - containerPort: 8025 - protocol: TCP - - containerPort: 50070 - protocol: TCP - - containerPort: 50075 - protocol: TCP - - containerPort: 50010 - protocol: TCP - - containerPort: 50020 - protocol: TCP - - containerPort: 3888 - protocol: TCP - - containerPort: 2888 - protocol: TCP - - containerPort: 2181 - protocol: TCP - volumeMounts: - - mountPath: /cdap - name: cdap-root - - mountPath: /opt/tools - name: dcae-cdap0-opt-tools - - mountPath: /opt/data - name: dcae-cdap0-opt-data - volumes: - - name: cdap-root - hostPath: - path: /dockerdata-nfs/{{ .Values.nsPrefix }}/dcae/cdap - - name: dcae-cdap0-opt-tools - hostPath: - path: /dockerdata-nfs/{{ .Values.nsPrefix }}/dcae/cdap/cdap0-opt-tools - - name: dcae-cdap0-opt-data - hostPath: - path: /dockerdata-nfs/{{ .Values.nsPrefix }}/dcae/cdap/cdap0-opt-data - imagePullSecrets: - - name: "{{ .Values.nsPrefix }}-docker-registry-key" -#{{ end }} diff --git a/kubernetes/dcae/templates/cdap1-dep.yaml b/kubernetes/dcae/templates/cdap1-dep.yaml deleted file mode 100644 index 1a954c8632..0000000000 --- a/kubernetes/dcae/templates/cdap1-dep.yaml +++ /dev/null @@ -1,93 +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.disableDcaeCdap }} -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - annotations: - deployment.kubernetes.io/revision: "1" - labels: - app: cdap1 - name: cdap1 - namespace: "{{ .Values.nsPrefix }}" -spec: - selector: - matchLabels: - app: cdap1 - strategy: - rollingUpdate: - maxSurge: 1 - maxUnavailable: 1 - type: RollingUpdate - template: - metadata: - labels: - app: cdap1 - name: cdap1 - spec: - initContainers: - - command: ["/bin/bash", "-c", "mkdir -p /cdap/{cdap1-opt-tools,cdap1-opt-data}; grep `hostname` /etc/hosts > /cdap/pod-ip/`hostname`_ip.txt; while [`ls /cdap/pod-ip | wc -l` < 3]; do sleep 1; done"] - name: create-fs - image: {{ .Values.image.cdapfs }} - imagePullPolicy: {{ .Values.pullPolicy }} - volumeMounts: - - mountPath: /cdap - name: cdap-root - hostname: zldcprivatecloudtruecdap01 - containers: - - image: {{ .Values.image.cdap }} - imagePullPolicy: {{ .Values.pullPolicy }} - command: ["/bin/bash"] - args: ["-c", "cat /cdap/pod-ip/* >> /etc/hosts; /usr/local/bin/01-entrypoint.sh; sleep infinity;"] - name: cdap1 - ports: - - containerPort: 8020 - protocol: TCP - - containerPort: 8025 - protocol: TCP - - containerPort: 50070 - protocol: TCP - - containerPort: 50075 - protocol: TCP - - containerPort: 50010 - protocol: TCP - - containerPort: 50020 - protocol: TCP - - containerPort: 3888 - protocol: TCP - - containerPort: 2888 - protocol: TCP - - containerPort: 2181 - protocol: TCP - volumeMounts: - - mountPath: /cdap - name: cdap-root - - mountPath: /opt/tools - name: dcae-cdap1-opt-tools - - mountPath: /opt/data - name: dcae-cdap1-opt-data - volumes: - - name: cdap-root - hostPath: - path: /dockerdata-nfs/{{ .Values.nsPrefix }}/dcae/cdap - - name: dcae-cdap1-opt-tools - hostPath: - path: /dockerdata-nfs/{{ .Values.nsPrefix }}/dcae/cdap/cdap1-opt-tools - - name: dcae-cdap1-opt-data - hostPath: - path: /dockerdata-nfs/{{ .Values.nsPrefix }}/dcae/cdap/cdap1-opt-data - imagePullSecrets: - - name: "{{ .Values.nsPrefix }}-docker-registry-key" -#{{ end }} diff --git a/kubernetes/dcae/templates/cdap2-dep.yaml b/kubernetes/dcae/templates/cdap2-dep.yaml deleted file mode 100644 index fac825e227..0000000000 --- a/kubernetes/dcae/templates/cdap2-dep.yaml +++ /dev/null @@ -1,93 +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.disableDcaeCdap }} -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - annotations: - deployment.kubernetes.io/revision: "1" - labels: - app: cdap2 - name: cdap2 - namespace: "{{ .Values.nsPrefix }}" -spec: - selector: - matchLabels: - app: cdap2 - strategy: - rollingUpdate: - maxSurge: 1 - maxUnavailable: 1 - type: RollingUpdate - template: - metadata: - labels: - app: cdap2 - name: cdap2 - spec: - initContainers: - - command: ["/bin/bash", "-c", "mkdir -p /cdap/{cdap2-opt-tools,cdap2-opt-data}; grep `hostname` /etc/hosts > /cdap/pod-ip/`hostname`_ip.txt; while [`ls /cdap/pod-ip | wc -l` < 3]; do sleep 1; done"] - name: create-fs - image: {{ .Values.image.cdapfs }} - imagePullPolicy: {{ .Values.pullPolicy }} - volumeMounts: - - mountPath: /cdap - name: cdap-root - hostname: zldcprivatecloudtruecdap02 - containers: - - image: {{ .Values.image.cdap }} - imagePullPolicy: {{ .Values.pullPolicy }} - command: ["/bin/bash"] - args: ["-c", "cat /cdap/pod-ip/* >> /etc/hosts; /usr/local/bin/01-entrypoint.sh; sleep infinity;"] - name: cdap2 - ports: - - containerPort: 8020 - protocol: TCP - - containerPort: 8025 - protocol: TCP - - containerPort: 50070 - protocol: TCP - - containerPort: 50075 - protocol: TCP - - containerPort: 50010 - protocol: TCP - - containerPort: 50020 - protocol: TCP - - containerPort: 3888 - protocol: TCP - - containerPort: 2888 - protocol: TCP - - containerPort: 2181 - protocol: TCP - volumeMounts: - - mountPath: /cdap - name: cdap-root - - mountPath: /opt/tools - name: dcae-cdap2-opt-tools - - mountPath: /opt/data - name: dcae-cdap2-opt-data - volumes: - - name: cdap-root - hostPath: - path: /dockerdata-nfs/{{ .Values.nsPrefix }}/dcae/cdap - - name: dcae-cdap2-opt-tools - hostPath: - path: /dockerdata-nfs/{{ .Values.nsPrefix }}/dcae/cdap/cdap2-opt-tools - - name: dcae-cdap2-opt-data - hostPath: - path: /dockerdata-nfs/{{ .Values.nsPrefix }}/dcae/cdap/cdap2-opt-data - imagePullSecrets: - - name: "{{ .Values.nsPrefix }}-docker-registry-key" -#{{ end }} diff --git a/kubernetes/dcae/templates/dcae-collector-common-event.yaml b/kubernetes/dcae/templates/dcae-collector-common-event.yaml deleted file mode 100644 index b15d34bad0..0000000000 --- a/kubernetes/dcae/templates/dcae-collector-common-event.yaml +++ /dev/null @@ -1,54 +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.disableDcaeDcaeCollectorCommonEvent }} -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: dcae-collector-common-event - namespace: "{{ .Values.nsPrefix }}" -spec: - selector: - matchLabels: - app: dcae-collector-common-event - template: - metadata: - labels: - app: dcae-collector-common-event - name: dcae-collector-common-event - spec: - containers: - - image: {{ .Values.image.commonevent }} - imagePullPolicy: {{ .Values.pullPolicy }} - name: dcae-collector-common-event - ports: - - containerPort: 8080 - - containerPort: 8443 - - containerPort: 9999 - env: -# - name: KAFKA_ZOOKEEPER_CONNECT -# value: "zookeeper:2181" -# command: -# - start-kafka.sh - volumeMounts: - - mountPath: /opt/app/manager/config - name: dcae-collector-common-event-config - restartPolicy: Always - volumes: - - name: dcae-collector-common-event-config - hostPath: - path: /dockerdata-nfs/{{ .Values.nsPrefix }}/dcae/common-event/config - imagePullSecrets: - - name: "{{ .Values.nsPrefix }}-docker-registry-key" -#{{ end }} diff --git a/kubernetes/dcae/templates/dcae-collector-dmaapbc.yaml b/kubernetes/dcae/templates/dcae-collector-dmaapbc.yaml deleted file mode 100644 index 35e913e1bb..0000000000 --- a/kubernetes/dcae/templates/dcae-collector-dmaapbc.yaml +++ /dev/null @@ -1,53 +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.disableDcaeDcaeCollectorDmaapbc }} -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: dcae-collector-dmaapbc - namespace: "{{ .Values.nsPrefix }}" -spec: - selector: - matchLabels: - app: dcae-collector-dmaapbc - template: - metadata: - labels: - app: dcae-collector-dmaapbc - name: dcae-collector-dmaapbc - spec: - containers: - - image: {{ .Values.image.dmaapbc }} - imagePullPolicy: {{ .Values.pullPolicy }} - name: dcae-collector-dmaapbc - ports: - - containerPort: 18080 - - containerPort: 18443 - env: -# - name: KAFKA_ZOOKEEPER_CONNECT -# value: "zookeeper:2181" -# command: -# - start-kafka.sh - volumeMounts: - - mountPath: /opt/app/config - name: dcae-collector-dmaapbc-config - restartPolicy: Always - volumes: - - name: dcae-collector-dmaapbc-config - hostPath: - path: /dockerdata-nfs/{{ .Values.nsPrefix }}/dcae/dmaapbc/config - imagePullSecrets: - - name: "{{ .Values.nsPrefix }}-docker-registry-key" -#{{ end }} diff --git a/kubernetes/dcae/templates/dcae-controller.yaml b/kubernetes/dcae/templates/dcae-controller.yaml deleted file mode 100644 index b7a0e13b88..0000000000 --- a/kubernetes/dcae/templates/dcae-controller.yaml +++ /dev/null @@ -1,77 +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.disableDcaeDcaeController }} -apiVersion: v1 -kind: Service -metadata: - labels: - app: dcae-controller - version: latest - name: dcae-controller - namespace: "{{ .Values.nsPrefix }}" -spec: - ports: - - name: dcae-con1 - port: 8000 - protocol: TCP - targetPort: 8000 - nodePort: {{ .Values.nodePortPrefix }}34 - - name: dcae-con2 - port: 9998 - protocol: TCP - targetPort: 9998 - nodePort: {{ .Values.nodePortPrefix }}35 - selector: - app: dcae-controller - type: NodePort ---- -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: dcae-controller - namespace: "{{ .Values.nsPrefix }}" -spec: - selector: - matchLabels: - app: dcae-controller - template: - metadata: - labels: - app: dcae-controller - name: dcae-controller - spec: - containers: - - image: {{ .Values.image.controller }} - imagePullPolicy: {{ .Values.pullPolicy }} - name: dcae-controller - ports: - - containerPort: 8000 - - containerPort: 9998 - env: -# - name: KAFKA_ZOOKEEPER_CONNECT -# value: "zookeeper:2181" -# command: -# - start-kafka.sh - volumeMounts: - - mountPath: /opt/app/config - name: dcae-controller-config - restartPolicy: Always - volumes: - - name: dcae-controller-config - hostPath: - path: /dockerdata-nfs/{{ .Values.nsPrefix }}/dcae/dcae-controller/config - imagePullSecrets: - - name: "{{ .Values.nsPrefix }}-docker-registry-key" -#{{ end }} diff --git a/kubernetes/dcae/templates/dcae-dmaap.yaml b/kubernetes/dcae/templates/dcae-dmaap.yaml deleted file mode 100644 index 560da5f604..0000000000 --- a/kubernetes/dcae/templates/dcae-dmaap.yaml +++ /dev/null @@ -1,80 +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.disableDcaeDmaap }} -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: dmaap - namespace: "{{ .Values.nsPrefix }}" -spec: - selector: - matchLabels: - app: dmaap - template: - metadata: - labels: - app: dmaap - name: dmaap - spec: - initContainers: - - command: - - /root/ready.py - args: - - --container-name - - kafka - - --container-name - - zookeeper - env: - - name: NAMESPACE - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: metadata.namespace - image: {{ .Values.image.readiness }} - imagePullPolicy: {{ .Values.pullPolicy }} - name: dmaap-readiness - containers: - - image: {{ .Values.image.dmaap }} - imagePullPolicy: {{ .Values.pullPolicy }} - name: dmaap - ports: - - containerPort: 3904 - - containerPort: 3905 - readinessProbe: - tcpSocket: - port: 3904 - initialDelaySeconds: 5 - periodSeconds: 10 - volumeMounts: - - mountPath: /appl/dmaapMR1/bundleconfig/etc/appprops/MsgRtrApi.properties - name: appprops - - mountPath: /appl/dmaapMR1/etc/cadi.properties - name: cadi - - mountPath: /appl/dmaapMR1/etc/keyfile - name: mykey - restartPolicy: Always - volumes: - - name: appprops - hostPath: - path: /dockerdata-nfs/{{ .Values.nsPrefix }}/dcae/message-router/dmaap/MsgRtrApi.properties - - name: cadi - hostPath: - path: /dockerdata-nfs/{{ .Values.nsPrefix }}/dcae/message-router/dmaap/cadi.properties - - name: mykey - hostPath: - path: /dockerdata-nfs/{{ .Values.nsPrefix }}/dcae/message-router/dmaap/mykey - imagePullSecrets: - - name: "{{ .Values.nsPrefix }}-docker-registry-key" -#{{ end }} diff --git a/kubernetes/dcae/templates/dcae-kafka.yaml b/kubernetes/dcae/templates/dcae-kafka.yaml deleted file mode 100644 index 52d0503983..0000000000 --- a/kubernetes/dcae/templates/dcae-kafka.yaml +++ /dev/null @@ -1,88 +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.disableDcaeKafka }} -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: kafka - namespace: "{{ .Values.nsPrefix }}" -spec: - selector: - matchLabels: - app: kafka - template: - metadata: - labels: - app: kafka - name: kafka - spec: - initContainers: - - command: - - /root/ready.py - args: - - --container-name - - zookeeper - env: - - name: NAMESPACE - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: metadata.namespace - image: {{ .Values.image.readiness }} - imagePullPolicy: {{ .Values.pullPolicy }} - name: kafka-readiness - containers: - - image: {{ .Values.image.kafka }} - imagePullPolicy: {{ .Values.pullPolicy }} - name: kafka - ports: - - containerPort: 9092 - readinessProbe: - tcpSocket: - port: 9092 - initialDelaySeconds: 5 - periodSeconds: 10 - env: - - name: KAFKA_ZOOKEEPER_CONNECT - value: "zookeeper.{{ .Values.nsPrefix }}" - - name: KAFKA_ADVERTISED_HOST_NAME - value: "kafka" - - name: KAFKA_BROKER_ID - value: "1" - - name: KAFKA_ADVERTISED_PORT - value: "9092" - - name: KAFKA_PORT - value: "9092" - volumeMounts: - - mountPath: /var/run/docker.sock - name: docker-socket - - mountPath: /kafka - name: kafka-data - - mountPath: /start-kafka.sh - name: start-kafka - restartPolicy: Always - volumes: - - name: docker-socket - hostPath: - path: /var/run/docker.sock - - name: kafka-data - hostPath: - path: /dockerdata-nfs/{{ .Values.nsPrefix }}/dcae/message-router/dcae-startup-vm-message-router/docker_files/data-kafka/ - - name: start-kafka - hostPath: - path: /dockerdata-nfs/{{ .Values.nsPrefix }}/dcae/message-router/dcae-startup-vm-message-router/docker_files/start-kafka.sh - imagePullSecrets: - - name: "{{ .Values.nsPrefix }}-docker-registry-key" -#{{ end }} diff --git a/kubernetes/dcae/templates/dcae-zookeeper.yaml b/kubernetes/dcae/templates/dcae-zookeeper.yaml deleted file mode 100644 index 7203cb92db..0000000000 --- a/kubernetes/dcae/templates/dcae-zookeeper.yaml +++ /dev/null @@ -1,47 +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.disableDcaeZookeeper }} -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: zookeeper - namespace: "{{ .Values.nsPrefix }}" -spec: - selector: - matchLabels: - app: zookeeper - template: - metadata: - labels: - app: zookeeper - name: zookeeper - spec: - containers: - - image: {{ .Values.image.zookeeper }} - imagePullPolicy: {{ .Values.pullPolicy }} - name: zookeeper - ports: - - containerPort: 2181 - volumeMounts: - - mountPath: /opt/zookeeper-3.4.9/data - name: zookeeper-data - restartPolicy: Always - volumes: - - name: zookeeper-data - hostPath: - path: /dockerdata-nfs/{{ .Values.nsPrefix }}/dcae/message-router/dcae-startup-vm-message-router/docker_files/data-zookeeper - imagePullSecrets: - - name: "{{ .Values.nsPrefix }}-docker-registry-key" -#{{ end }} diff --git a/kubernetes/dcae/templates/pgaas.yaml b/kubernetes/dcae/templates/pgaas.yaml deleted file mode 100644 index 61aa93dcb2..0000000000 --- a/kubernetes/dcae/templates/pgaas.yaml +++ /dev/null @@ -1,63 +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.disableDcaeDcaePgaas }} -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - annotations: - deployment.kubernetes.io/revision: "1" - labels: - app: dcae-pgaas - name: dcae-pgaas - namespace: "{{ .Values.nsPrefix }}" -spec: - replicas: 1 - selector: - matchLabels: - app: dcae-pgaas - template: - metadata: - labels: - app: dcae-pgaas - spec: - hostname: zldciad4vipstg00 - containers: - - image: {{ .Values.image.pgaas }} - imagePullPolicy: {{ .Values.pullPolicy }} - command: ["/bin/bash"] - args: ["-c", "/usr/local/bin/entrypoint.sh; sleep infinity;"] - name: dcae-pgaas - ports: - - containerPort: 5432 - volumeMounts: - - mountPath: /dbroot/pgdata - name: dcae-pgaas-pgdata - - mountPath: /dbroot/pglogs - name: dcae-pgaas-pglogs - - mountPath: /opt/tools - name: dcae-pgaas-tools - volumes: - - name: dcae-pgaas-pgdata - hostPath: - path: /dockerdata-nfs/{{ .Values.nsPrefix }}/dcae/pgaas/pgdata - - name: dcae-pgaas-pglogs - hostPath: - path: /dockerdata-nfs/{{ .Values.nsPrefix }}/dcae/pgaas/pglogs - - name: dcae-pgaas-tools - hostPath: - path: /dockerdata-nfs/{{ .Values.nsPrefix }}/dcae/pgaas/tools - imagePullSecrets: - - name: "{{ .Values.nsPrefix }}-docker-registry-key" -#{{ end }} diff --git a/kubernetes/dcae/values.yaml b/kubernetes/dcae/values.yaml deleted file mode 100644 index a65835bb14..0000000000 --- a/kubernetes/dcae/values.yaml +++ /dev/null @@ -1,28 +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. - -nsPrefix: onap -pullPolicy: Always -nodePortPrefix: 302 -image: - readiness: oomk8s/readiness-check:1.1.0 - pgaas: oomk8s/pgaas:1 - cdapfs: oomk8s/cdap-fs:1.0.0 - cdap: oomk8s/cdap:1.0.7 - dmaap: attos/dmaap:latest - kafka: wurstmeister/kafka:latest - zookeeper: wurstmeister/zookeeper:latest - dmaapbc: nexus3.onap.org:10001/openecomp/dcae-dmaapbc:1.1-STAGING-latest - commonevent: nexus3.onap.org:10001/openecomp/dcae-collector-common-event:1.1-STAGING-latest - controller: nexus3.onap.org:10001/openecomp/dcae-controller:1.1-STAGING-latest 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/charts/esr-gui/Chart.yaml b/kubernetes/esr/charts/esr-gui/Chart.yaml new file mode 100644 index 0000000000..ae53f85857 --- /dev/null +++ b/kubernetes/esr/charts/esr-gui/Chart.yaml @@ -0,0 +1,18 @@ +# 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 +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/requirements.yaml b/kubernetes/esr/requirements.yaml new file mode 100644 index 0000000000..f639633537 --- /dev/null +++ b/kubernetes/esr/requirements.yaml @@ -0,0 +1,21 @@ +# 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. + +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/resources/config/log/filebeat/filebeat.yml b/kubernetes/esr/resources/config/log/filebeat/filebeat.yml index 16c7943beb..49197d3b82 100644 --- a/kubernetes/esr/resources/config/log/filebeat/filebeat.yml +++ b/kubernetes/esr/resources/config/log/filebeat/filebeat.yml @@ -22,7 +22,7 @@ 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.{{.Values.nsPrefix}}:5044"] + hosts: ["{{.Values.config.logstashServiceName}}.{{.Release.Namespace}}:{{.Values.config.logstashPort}}"] #If enable will do load balancing among availabe Logstash, automatically. loadbalance: true 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/esr-server-log-configmap.yaml b/kubernetes/esr/templates/configmap.yaml index 5a3ddf2c2a..a0c82bee55 100644 --- a/kubernetes/esr/templates/esr-server-log-configmap.yaml +++ b/kubernetes/esr/templates/configmap.yaml @@ -12,12 +12,19 @@ # 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 }} + 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 }} -#{{ end }} + 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 5253d9a6f8..3af491745e 100644 --- a/kubernetes/esr/values.yaml +++ b/kubernetes/esr/values.yaml @@ -12,17 +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/helm/starters/onap-app/templates/deployment.yaml b/kubernetes/helm/starters/onap-app/templates/deployment.yaml index 01253815a3..8b2bb4e516 100644 --- a/kubernetes/helm/starters/onap-app/templates/deployment.yaml +++ b/kubernetes/helm/starters/onap-app/templates/deployment.yaml @@ -101,4 +101,4 @@ spec: # - key: application.properties # path: application.properties imagePullSecrets: - - name: "{{ include "common.namespace" . }}-docker-registry-key"
\ No newline at end of file + - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/kubernetes/log/.helmignore b/kubernetes/log/.helmignore new file mode 100644 index 0000000000..f0c1319444 --- /dev/null +++ b/kubernetes/log/.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/log/Chart.yaml b/kubernetes/log/Chart.yaml index 96124138b1..9b902e8879 100644 --- a/kubernetes/log/Chart.yaml +++ b/kubernetes/log/Chart.yaml @@ -13,6 +13,6 @@ # limitations under the License. apiVersion: v1 -description: A Helm chart for Kubernetes +description: ONAP Logging ElasticStack name: log -version: 0.1.0 +version: 2.0.0 diff --git a/kubernetes/log/charts/log-elasticsearch/Chart.yaml b/kubernetes/log/charts/log-elasticsearch/Chart.yaml new file mode 100644 index 0000000000..5d233b4645 --- /dev/null +++ b/kubernetes/log/charts/log-elasticsearch/Chart.yaml @@ -0,0 +1,18 @@ +# 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 +description: ONAP Logging Elasticsearch +name: log-elasticsearch +version: 2.0.0 diff --git a/kubernetes/log/charts/log-elasticsearch/requirements.yaml b/kubernetes/log/charts/log-elasticsearch/requirements.yaml new file mode 100644 index 0000000000..1e8f788318 --- /dev/null +++ b/kubernetes/log/charts/log-elasticsearch/requirements.yaml @@ -0,0 +1,18 @@ +# 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. + +dependencies: + - name: common + version: ~2.0.0 + repository: '@local'
\ No newline at end of file diff --git a/kubernetes/log/resources/elasticsearch/conf/elasticsearch.yml b/kubernetes/log/charts/log-elasticsearch/resources/config/elasticsearch.yml index f038a10775..e7933b8570 100644 --- a/kubernetes/log/resources/elasticsearch/conf/elasticsearch.yml +++ b/kubernetes/log/charts/log-elasticsearch/resources/config/elasticsearch.yml @@ -111,12 +111,12 @@ discovery.zen.minimum_master_nodes: 1 #action.destructive_requires_name: true # Set a custom port for HTTP: If required, default is 9200-9300 # This is used for REST APIs -http.port: 9200 +http.port: {{.Values.service.externalPort}} # Port to bind for communication between nodes. Accepts a single value or a range. # If a range is specified, the node will bind to the first available port in the range. # Defaults to 9300-9400. # More info: -transport.tcp.port: 9300 +transport.tcp.port: {{.Values.service.externalPortTcp}} xpack.graph.enabled: false #Set to false to disable X-Pack graph features. diff --git a/kubernetes/log/charts/log-elasticsearch/templates/NOTES.txt b/kubernetes/log/charts/log-elasticsearch/templates/NOTES.txt new file mode 100644 index 0000000000..0878f5c080 --- /dev/null +++ b/kubernetes/log/charts/log-elasticsearch/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 {{ include "common.namespace" . }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "common.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ include "common.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 {{ include "common.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 {{ include "common.namespace" . }} -l "app={{ include "common.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/templates/aai-deployment-configmap.yaml b/kubernetes/log/charts/log-elasticsearch/templates/configmap.yaml index c81fb801c5..4ccc7cc526 100644 --- a/kubernetes/aai/templates/aai-deployment-configmap.yaml +++ b/kubernetes/log/charts/log-elasticsearch/templates/configmap.yaml @@ -12,12 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -#{{ if not .Values.disableAaiAaiService }} apiVersion: v1 kind: ConfigMap metadata: - name: aai-deployment-configmap - namespace: {{ .Values.nsPrefix }} + name: {{ include "common.fullname" . }}-configmap + namespace: {{ include "common.namespace" . }} data: -{{ tpl (.Files.Glob "resources/config/haproxy/*").AsConfig . | indent 2 }} -#{{ end }} +{{ tpl (.Files.Glob "resources/config/*").AsConfig . | indent 2 }}
\ No newline at end of file diff --git a/kubernetes/log/charts/log-elasticsearch/templates/deployment.yaml b/kubernetes/log/charts/log-elasticsearch/templates/deployment.yaml new file mode 100644 index 0000000000..13caa7e866 --- /dev/null +++ b/kubernetes/log/charts/log-elasticsearch/templates/deployment.yaml @@ -0,0 +1,117 @@ +# 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: + initContainers: + - command: + - /bin/sh + - -c + - | + sysctl -w vm.max_map_count=262144 + mkdir -p /logroot/elasticsearch/logs + mkdir -p /logroot/elasticsearch/data + chmod -R 777 /logroot/elasticsearch + chown -R root:root /logroot + env: + - name: NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + securityContext: + privileged: true + image: {{ .Values.global.busyboxRepository | default .Values.busyboxRepository }}/{{ .Values.busyboxImage }} + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + name: init-sysctl + volumeMounts: + - name: {{ include "common.fullname" . }}-logs + mountPath: /logroot/ + containers: + - name: {{ include "common.name" . }} + image: "{{ .Values.global.loggingRepository | default .Values.loggingRepository }}/{{ .Values.image }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + ports: + - containerPort: {{ .Values.service.internalPort }} + name: {{ .Values.service.name }} + - containerPort: {{ .Values.service.internalPortTcp }} + name: {{ .Values.service.name }}-tcp +# 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.internalPortTcp }} + initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} + periodSeconds: {{ .Values.readiness.periodSeconds }} + env: + volumeMounts: + - mountPath: /etc/localtime + name: localtime + readOnly: true + - mountPath: /usr/share/elasticsearch/config/elasticsearch.yml + name: {{ include "common.fullname" . }}-config + subPath: elasticsearch.yml + - mountPath: /usr/share/elasticsearch/data/ + name: {{ include "common.fullname" . }}-data + 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 + - name: {{ include "common.fullname" . }}-config + configMap: + name: {{ include "common.fullname" . }}-configmap + items: + - key: elasticsearch.yml + path: elasticsearch.yml + - name: {{ include "common.fullname" . }}-data + persistentVolumeClaim: + claimName: {{ include "common.fullname" . }} + - name: {{ include "common.fullname" . }}-logs + hostPath: + path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Namespace }}/{{ .Values.persistence.mountSubPathLogs }} + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/kubernetes/log/charts/log-elasticsearch/templates/pv.yaml b/kubernetes/log/charts/log-elasticsearch/templates/pv.yaml new file mode 100644 index 0000000000..dba12d4125 --- /dev/null +++ b/kubernetes/log/charts/log-elasticsearch/templates/pv.yaml @@ -0,0 +1,21 @@ +{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}} +kind: PersistentVolume +apiVersion: v1 +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 }}" + name: {{ include "common.fullname" . }} +spec: + capacity: + storage: {{ .Values.persistence.size}} + accessModes: + - {{ .Values.persistence.accessMode }} + persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }} + hostPath: + path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Namespace }}/{{ .Values.persistence.mountSubPath }} +{{- end -}} diff --git a/kubernetes/log/charts/log-elasticsearch/templates/pvc.yaml b/kubernetes/log/charts/log-elasticsearch/templates/pvc.yaml new file mode 100644 index 0000000000..c046f4604a --- /dev/null +++ b/kubernetes/log/charts/log-elasticsearch/templates/pvc.yaml @@ -0,0 +1,25 @@ +{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}} +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: {{ include "common.fullname" . }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +{{- if .Values.persistence.annotations }} + annotations: +{{ toYaml .Values.persistence.annotations | indent 4 }} +{{- end }} +spec: + selector: + matchLabels: + name: {{ include "common.fullname" . }} + accessModes: + - {{ .Values.persistence.accessMode }} + resources: + requests: + storage: {{ .Values.persistence.size }} +{{- end -}} diff --git a/kubernetes/log/charts/log-elasticsearch/templates/service.yaml b/kubernetes/log/charts/log-elasticsearch/templates/service.yaml new file mode 100644 index 0000000000..72dfc7e817 --- /dev/null +++ b/kubernetes/log/charts/log-elasticsearch/templates/service.yaml @@ -0,0 +1,46 @@ +# 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: +spec: + type: {{ .Values.service.type }} + ports: + {{if eq .Values.service.type "NodePort" -}} + - port: {{ .Values.service.externalPort }} + nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort }} + name: {{ .Values.service.name }} + - port: {{ .Values.service.internalPortTcp }} + nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.externalPortTcp }} + name: {{ .Values.service.name }}-tcp + {{- else -}} + - port: {{ .Values.service.externalPort }} + targetPort: {{ .Values.service.internalPort }} + name: {{ .Values.service.name }} + - port: {{ .Values.service.externalPortTcp }} + targetPort: {{ .Values.service.internalPortTcp }} + name: {{ .Values.service.name }}-tcp + {{- end}} + selector: + app: {{ include "common.name" . }} + release: {{ .Release.Name }} diff --git a/kubernetes/log/charts/log-elasticsearch/values.yaml b/kubernetes/log/charts/log-elasticsearch/values.yaml new file mode 100644 index 0000000000..2e6e08509e --- /dev/null +++ b/kubernetes/log/charts/log-elasticsearch/values.yaml @@ -0,0 +1,114 @@ +# 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. +################################################################# + +# BusyBox image +busyboxRepository: registry.hub.docker.com +busyboxImage: library/busybox:latest + +# application image +loggingRepository: docker.elastic.co +image: elasticsearch/elasticsearch:5.5.0 +pullPolicy: Always + +# flag to enable debugging - application support required +debugEnabled: false + +# application configuration +# Example: +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 + +## Persist data to a persitent volume +persistence: + enabled: true + + ## A manually managed Persistent Volume and Claim + ## Requires persistence.enabled: true + ## If defined, PVC must be created manually before volume will be bound + # existingClaim: + volumeReclaimPolicy: Retain + + ## database data Persistent Volume Storage Class + ## If defined, storageClassName: <storageClass> + ## If set to "-", storageClassName: "", which disables dynamic provisioning + ## If undefined (the default) or set to null, no storageClassName spec is + ## set, choosing the default provisioner. (gp2 on AWS, standard on + ## GKE, AWS & OpenStack) + accessMode: ReadWriteMany + size: 1Gi + mountPath: /dockerdata-nfs + mountSubPath: log/elasticsearch/data + mountSubPathLogs: log + +service: + #Example service definition with external, internal and node ports. + #Services may use any combination of ports depending on the 'type' of + #service being defined. + type: ClusterIP + name: log-es + externalPort: 9200 + internalPort: 9200 + externalPortTcp: 9300 + internalPortTcp: 9300 +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/log/charts/log-kibana/Chart.yaml b/kubernetes/log/charts/log-kibana/Chart.yaml new file mode 100644 index 0000000000..74f2c2b441 --- /dev/null +++ b/kubernetes/log/charts/log-kibana/Chart.yaml @@ -0,0 +1,18 @@ +# 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 +description: ONAP Logging Kibana +name: log-kibana +version: 2.0.0 diff --git a/kubernetes/log/charts/log-kibana/requirements.yaml b/kubernetes/log/charts/log-kibana/requirements.yaml new file mode 100644 index 0000000000..1e8f788318 --- /dev/null +++ b/kubernetes/log/charts/log-kibana/requirements.yaml @@ -0,0 +1,18 @@ +# 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. + +dependencies: + - name: common + version: ~2.0.0 + repository: '@local'
\ No newline at end of file diff --git a/kubernetes/log/resources/kibana/conf/kibana.yml b/kubernetes/log/charts/log-kibana/resources/config/kibana.yml index df0d71abab..5171ad4cdb 100644 --- a/kubernetes/log/resources/kibana/conf/kibana.yml +++ b/kubernetes/log/charts/log-kibana/resources/config/kibana.yml @@ -11,7 +11,7 @@ xpack.security.enabled: false xpack.watcher.enabled: false #Set to false to disable Watcher. # Kibana is served by a back end server. This setting specifies the port to use. -server.port: 5601 +server.port: {{.Values.service.externalPort}} # Specifies the address to which the Kibana server will bind. IP addresses and host names are both valid values. # The default is 'localhost', which usually means remote machines will not be able to connect. @@ -30,10 +30,7 @@ server.host: "0" server.name: "Kibana" # The URL of the Elasticsearch instance to use for all your queries. -# OOM-427, OOM-441 hardcoded onap workspace to avoid helm upgrade past 2.3 -elasticsearch.url: "http://elasticsearch.{{.Values.nsPrefix}}:9200" -#elasticsearch-service.{{.Values.nsPrefix}}:9200" -#elasticsearch.url: "http://10.247.47.3:9200" +elasticsearch.url: "http://{{.Values.config.elasticsearchServiceName}}.{{.Release.Namespace}}:{{.Values.config.elasticsearchPort}}" # When this setting's value is true Kibana uses the hostname specified in the server.host # setting. When the value of this setting is false, Kibana uses the hostname of the host # that connects to this Kibana instance. diff --git a/kubernetes/log/charts/log-kibana/templates/NOTES.txt b/kubernetes/log/charts/log-kibana/templates/NOTES.txt new file mode 100644 index 0000000000..0878f5c080 --- /dev/null +++ b/kubernetes/log/charts/log-kibana/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 {{ include "common.namespace" . }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "common.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ include "common.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 {{ include "common.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 {{ include "common.namespace" . }} -l "app={{ include "common.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/log/charts/log-kibana/templates/configmap.yaml b/kubernetes/log/charts/log-kibana/templates/configmap.yaml new file mode 100644 index 0000000000..fd8934b22c --- /dev/null +++ b/kubernetes/log/charts/log-kibana/templates/configmap.yaml @@ -0,0 +1,21 @@ +# 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" . }} + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/*").AsConfig . | indent 2 }} diff --git a/kubernetes/log/charts/log-kibana/templates/deployment.yaml b/kubernetes/log/charts/log-kibana/templates/deployment.yaml new file mode 100644 index 0000000000..bdd5a447be --- /dev/null +++ b/kubernetes/log/charts/log-kibana/templates/deployment.yaml @@ -0,0 +1,98 @@ +# 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: + initContainers: + - command: + - /root/ready.py + args: + - --container-name + - log-elasticsearch + env: + - name: NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + name: {{ include "common.name" . }}-readiness + containers: + - name: {{ include "common.name" . }} + image: "{{ .Values.global.loggingRepository | default .Values.loggingRepository }}/{{ .Values.image }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + ports: + - containerPort: {{ .Values.service.internalPort }} + name: {{ .Values.service.name }} + readinessProbe: + tcpSocket: + port: {{ .Values.service.internalPort }} + initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} + periodSeconds: {{ .Values.readiness.periodSeconds }} +# 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 -}} + env: + volumeMounts: + - mountPath: /etc/localtime + name: localtime + readOnly: true + - mountPath: /usr/share/kibana/config/kibana.yml + name: {{ include "common.fullname" . }} + subPath: kibana.yml + 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 + - name: {{ include "common.fullname" . }} + configMap: + name: {{ include "common.fullname" . }} + items: + - key: kibana.yml + path: kibana.yml + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/kubernetes/log/charts/log-kibana/templates/service.yaml b/kubernetes/log/charts/log-kibana/templates/service.yaml new file mode 100644 index 0000000000..d758c99d89 --- /dev/null +++ b/kubernetes/log/charts/log-kibana/templates/service.yaml @@ -0,0 +1,40 @@ +# 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: +spec: + type: {{ .Values.service.type }} + ports: + {{if eq .Values.service.type "NodePort" -}} + - port: {{ .Values.service.externalPort }} + 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/log/charts/log-kibana/values.yaml b/kubernetes/log/charts/log-kibana/values.yaml new file mode 100644 index 0000000000..50c6e52ee0 --- /dev/null +++ b/kubernetes/log/charts/log-kibana/values.yaml @@ -0,0 +1,94 @@ +# 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== + readinessRepository: oomk8s + readinessImage: readiness-check:1.1.0 + persistence: {} + +################################################################# +# Application configuration defaults. +################################################################# + +# BusyBox image +busyboxRepository: registry.hub.docker.com +busyboxImage: library/busybox:latest + +# application image +loggingRepository: docker.elastic.co +image: kibana/kibana:5.5.0 +pullPolicy: Always + +# flag to enable debugging - application support required +debugEnabled: false + +# application configuration +config: + elasticsearchServiceName: log-es + elasticsearchPort: 9200 + +# default number of instances +replicaCount: 1 + +nodeSelector: {} + +affinity: {} + +# probe configuration parameters +liveness: + initialDelaySeconds: 120 + 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: + #Example service definition with external, internal and node ports. + #Services may use any combination of ports depending on the 'type' of + #service being defined. + type: NodePort + name: log-kibana + externalPort: 5601 + internalPort: 5601 + nodePort: 53 +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/log/charts/log-logstash/Chart.yaml b/kubernetes/log/charts/log-logstash/Chart.yaml new file mode 100644 index 0000000000..3aab337308 --- /dev/null +++ b/kubernetes/log/charts/log-logstash/Chart.yaml @@ -0,0 +1,18 @@ +# 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 +description: ONAP Logging Logstash +name: log-logstash +version: 2.0.0 diff --git a/kubernetes/log/charts/log-logstash/requirements.yaml b/kubernetes/log/charts/log-logstash/requirements.yaml new file mode 100644 index 0000000000..1e8f788318 --- /dev/null +++ b/kubernetes/log/charts/log-logstash/requirements.yaml @@ -0,0 +1,18 @@ +# 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. + +dependencies: + - name: common + version: ~2.0.0 + repository: '@local'
\ No newline at end of file diff --git a/kubernetes/log/resources/logstash/conf/logstash.yml b/kubernetes/log/charts/log-logstash/resources/config/logstash.yml index f658006503..3ddf63f9cc 100644 --- a/kubernetes/log/resources/logstash/conf/logstash.yml +++ b/kubernetes/log/charts/log-logstash/resources/config/logstash.yml @@ -1,14 +1,14 @@ http.host: "0.0.0.0" ## Path where pipeline configurations reside path.config: /usr/share/logstash/pipeline - + ## Type of queue : memeory based or file based #queue.type: persisted ## Size of queue #queue.max_bytes: 1024mb ## Setting true makes logstash check periodically for change in pipeline configurations config.reload.automatic: true - + ## xpack configurations #xpack.monitoring.elasticsearch.url: ["http://10.247.186.12:9200", "http://10.247.186.13:9200"] #xpack.monitoring.elasticsearch.username: elastic diff --git a/kubernetes/log/resources/logstash/pipeline/onap-pipeline.conf b/kubernetes/log/charts/log-logstash/resources/config/onap-pipeline.conf index 8289b49f6e..3b4fd768c3 100644 --- a/kubernetes/log/resources/logstash/pipeline/onap-pipeline.conf +++ b/kubernetes/log/charts/log-logstash/resources/config/onap-pipeline.conf @@ -7,7 +7,7 @@ input { ######## Connection configurations ######## ## The port to listen on. - port => 5044 + port => {{.Values.service.externalPort}} ## Close Idle clients after the specified time in seconds. Default is 60 seconds #client_inactivity_timeout => 60 @@ -222,10 +222,8 @@ output { ######### Elasticsearchcluster and host configurations ######### -#can specify one or a list of hosts. If sniffing is set, one is enough and others will be auto-discovered -##Also protocol can be specified like ["http://10.247.186.12:9200"] -## OOM-427, OOM-441 hardcoded onap workspace to avoid helm upgrade past 2.3 - hosts => ["http://elasticsearch.{{.Values.nsPrefix}}:9200"] + ##can specify one or a list of hosts. If sniffing is set, one is enough and others will be auto-discovered + hosts => ["http://{{.Values.config.elasticsearchServiceName}}.{{.Release.Namespace}}:{{.Values.config.elasticsearchPort}}"] ## This setting asks Elasticsearch for the list of all cluster nodes and adds them to the hosts list. Default is false. diff --git a/kubernetes/log/charts/log-logstash/templates/NOTES.txt b/kubernetes/log/charts/log-logstash/templates/NOTES.txt new file mode 100644 index 0000000000..0878f5c080 --- /dev/null +++ b/kubernetes/log/charts/log-logstash/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 {{ include "common.namespace" . }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "common.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ include "common.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 {{ include "common.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 {{ include "common.namespace" . }} -l "app={{ include "common.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/log/charts/log-logstash/templates/configmap.yaml b/kubernetes/log/charts/log-logstash/templates/configmap.yaml new file mode 100644 index 0000000000..fd8934b22c --- /dev/null +++ b/kubernetes/log/charts/log-logstash/templates/configmap.yaml @@ -0,0 +1,21 @@ +# 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" . }} + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/*").AsConfig . | indent 2 }} diff --git a/kubernetes/log/charts/log-logstash/templates/deployment.yaml b/kubernetes/log/charts/log-logstash/templates/deployment.yaml new file mode 100644 index 0000000000..682c448da8 --- /dev/null +++ b/kubernetes/log/charts/log-logstash/templates/deployment.yaml @@ -0,0 +1,105 @@ +# 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: + initContainers: + - command: + - /root/ready.py + args: + - --container-name + - log-elasticsearch + env: + - name: NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + name: {{ include "common.name" . }}-readiness + containers: + - name: {{ include "common.name" . }} + image: "{{ .Values.global.loggingRepository| default .Values.loggingRepository }}/{{ .Values.image }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + ports: + - containerPort: {{ .Values.service.internalPort }} + name: {{ .Values.service.name }} + - containerPort: {{ .Values.service.internalPortHttp }} + name: {{ .Values.service.name }}-http + readinessProbe: + tcpSocket: + port: {{ .Values.service.internalPort }} + initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} + periodSeconds: {{ .Values.readiness.periodSeconds }} +# 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 -}} + env: + volumeMounts: + - mountPath: /etc/localtime + name: localtime + readOnly: true + - mountPath: /usr/share/logstash/config/logstash.yml + name: {{ include "common.fullname" . }} + subPath: logstash.yml + - mountPath: /usr/share/logstash/pipeline/onap-pipeline.conf + name: {{ include "common.fullname" . }} + subPath: onap-pipeline.conf + 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 + - name: {{ include "common.fullname" . }} + configMap: + name: {{ include "common.fullname" . }} + items: + - key: logstash.yml + path: logstash.yml + - key: onap-pipeline.conf + path: onap-pipeline.conf + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/kubernetes/log/charts/log-logstash/templates/service.yaml b/kubernetes/log/charts/log-logstash/templates/service.yaml new file mode 100644 index 0000000000..ca71aa2224 --- /dev/null +++ b/kubernetes/log/charts/log-logstash/templates/service.yaml @@ -0,0 +1,46 @@ +# 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: +spec: + type: {{ .Values.service.type }} + ports: + {{if eq .Values.service.type "NodePort" -}} + - port: {{ .Values.service.externalPort }} + nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort }} + name: {{ .Values.service.name }} + - port: {{ .Values.service.internalPortHttp }} + nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.externalPortHttp }} + name: {{ .Values.service.name }}-http + {{- else -}} + - port: {{ .Values.service.externalPort }} + targetPort: {{ .Values.service.internalPort }} + name: {{ .Values.service.name }} + - port: {{ .Values.service.externalPortHttp }} + targetPort: {{ .Values.service.internalPortHttp }} + name: {{ .Values.service.name }}-http + {{- end}} + selector: + app: {{ include "common.name" . }} + release: {{ .Release.Name }} diff --git a/kubernetes/log/charts/log-logstash/values.yaml b/kubernetes/log/charts/log-logstash/values.yaml new file mode 100644 index 0000000000..bfe50b54a8 --- /dev/null +++ b/kubernetes/log/charts/log-logstash/values.yaml @@ -0,0 +1,91 @@ +# 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== + readinessRepository: oomk8s + readinessImage: readiness-check:1.1.0 + persistence: {} + +################################################################# +# Application configuration defaults. +################################################################# + +# application image +loggingRepository: docker.elastic.co +image: logstash/logstash:5.4.3 +pullPolicy: Always + +# flag to enable debugging - application support required +debugEnabled: false + +# application configuration +config: + elasticsearchServiceName: log-es + elasticsearchPort: 9200 + +# default number of instances +replicaCount: 1 + +nodeSelector: {} + +affinity: {} + +# probe configuration parameters +liveness: + initialDelaySeconds: 120 + 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: + #Example service definition with external, internal and node ports. + #Services may use any combination of ports depending on the 'type' of + #service being defined. + type: ClusterIP + name: log-ls + externalPort: 5044 + internalPort: 5044 + externalPortHttp: 9600 + internalPortHttp: 9600 +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/log/requirements.yaml b/kubernetes/log/requirements.yaml new file mode 100644 index 0000000000..acca8ef7e2 --- /dev/null +++ b/kubernetes/log/requirements.yaml @@ -0,0 +1,4 @@ +dependencies: + - name: common + version: ~2.0.0 + repository: '@local'
\ No newline at end of file diff --git a/kubernetes/log/templates/all-services.yaml b/kubernetes/log/templates/all-services.yaml deleted file mode 100644 index 389e7e4caf..0000000000 --- a/kubernetes/log/templates/all-services.yaml +++ /dev/null @@ -1,100 +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.disableLogElasticsearch }} -apiVersion: v1 -kind: Service -metadata: - labels: - app: elasticsearch - name: elasticsearch - namespace: {{ .Values.nsPrefix }} -spec: - ports: - - name: http - port: 9200 - targetPort: 9200 - nodePort: {{ .Values.nodePortPrefix }}54 - selector: - app: elasticsearch - type: NodePort ---- -apiVersion: v1 -kind: Service -metadata: - name: elasticsearchtcp - namespace: {{ .Values.nsPrefix }} - labels: - app: elasticsearch -spec: - ports: - - name: tcp - port: 9300 - targetPort: 9300 - selector: - app: elasticsearch -#{{ end }} -#{{ if not .Values.disableLogLogstash }} ---- -apiVersion: v1 -kind: Service -metadata: - name: logstashinternal - namespace: {{ .Values.nsPrefix }} - labels: - app: logstash -spec: - ports: - - name: http - port: 9600 - targetPort: 9600 - selector: - app: logstash ---- -apiVersion: v1 -kind: Service -metadata: - name: logstash - namespace: {{ .Values.nsPrefix }} - labels: - app: logstash -spec: - ports: - - name: transport - port: 5044 - targetPort: 5044 - nodePort: {{ .Values.nodePortPrefix }}55 - selector: - app: logstash - type: NodePort -#{{ end }} -#{{ if not .Values.disableLogKibana }} ---- -apiVersion: v1 -kind: Service -metadata: - labels: - app: kibana - name: kibana - namespace: {{ .Values.nsPrefix }} -spec: - ports: - - name: tcp-ks - port: 5601 - targetPort: 5601 - nodePort: {{ .Values.nodePortPrefix }}53 - selector: - app: kibana - type: NodePort -#{{ end }} diff --git a/kubernetes/log/templates/elasticsearch-deployment.yaml b/kubernetes/log/templates/elasticsearch-deployment.yaml deleted file mode 100644 index 8c09479b43..0000000000 --- a/kubernetes/log/templates/elasticsearch-deployment.yaml +++ /dev/null @@ -1,101 +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.disableLogElasticsearch }} -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - labels: - app: elasticsearch - name: log-elasticsearch - namespace: {{ .Values.nsPrefix }} -spec: - replicas: {{ .Values.elasticsearchReplicas }} - selector: - matchLabels: - app: elasticsearch - template: - metadata: - labels: - app: elasticsearch - name: log-elasticsearch - spec: - initContainers: - - command: - - /bin/sh - - -c - - | - sysctl -w vm.max_map_count=262144 - mkdir -p /logroot/elasticsearch/logs - mkdir -p /logroot/elasticsearch/data - chmod -R 777 /logroot/elasticsearch - chown -R root:root /logroot - env: - - name: NAMESPACE - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: metadata.namespace - securityContext: - privileged: true - image: {{ .Values.image.es_bb }} - imagePullPolicy: {{ .Values.pullPolicy }} - name: init-sysctl - volumeMounts: - - name: elasticsearch-logs - mountPath: /logroot/ - containers: - - name: elasticsearch - image: {{ .Values.image.elasticsearch}} - ports: - - containerPort: 9200 - name: http - protocol: TCP - - containerPort: 9300 - name: transport - protocol: TCP - readinessProbe: - tcpSocket: - port: 9300 - volumeMounts: - - mountPath: /usr/share/elasticsearch/config/elasticsearch.yml - name: elasticsearch-conf - subPath: elasticsearch.yml - - mountPath: /usr/share/elasticsearch/data/ - name: elasticsearch-data - - mountPath: /usr/share/elasticsearch/logs/ - name: elasticsearch-logs - volumes: - - name: elasticsearch-data - persistentVolumeClaim: - claimName: elasticsearch-db - - name: elasticsearch-logs - hostPath: - path: {{ .Values.dataRootDir }}/{{ .Values.nsPrefix }}/log/ - - name: elasticsearch-conf - configMap: - name: log-elasticsearch-configmap - items: - - key: elasticsearch.yml - path: elasticsearch.yml ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: log-elasticsearch-configmap - namespace: {{ .Values.nsPrefix }} -data: -{{ (.Files.Glob "resources/elasticsearch/conf/elasticsearch.yml").AsConfig | indent 2 }} -#{{ end }} - diff --git a/kubernetes/log/templates/kibana-deployment.yaml b/kubernetes/log/templates/kibana-deployment.yaml deleted file mode 100644 index b60011a1b3..0000000000 --- a/kubernetes/log/templates/kibana-deployment.yaml +++ /dev/null @@ -1,77 +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.disableLogKibana }} -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - labels: - app: kibana - name: log-kibana - namespace: {{ .Values.nsPrefix }} -spec: - replicas: {{ .Values.kibanaReplicas }} - selector: - matchLabels: - app: kibana - template: - metadata: - labels: - app: kibana - name: log-kibana - spec: - initContainers: - - command: - - /root/ready.py - args: - - --container-name - - elasticsearch - env: - - name: NAMESPACE - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: metadata.namespace - image: {{ .Values.image.readiness }} - imagePullPolicy: {{ .Values.pullPolicy }} - name: kibana-readiness - containers: - - name: kibana - image: {{ .Values.image.kibana }} - ports: - - containerPort: 5601 - name: http - protocol: TCP - readinessProbe: - tcpSocket: - port: 5601 - volumeMounts: - - name: kibana-conf - mountPath: /usr/share/kibana/config/ - volumes: - - name: kibana-conf - configMap: - name: log-kibana-configmap - items: - - key: kibana.yml - path: kibana.yml ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: log-kibana-configmap - namespace: {{ .Values.nsPrefix }} -data: -{{ tpl (.Files.Glob "resources/kibana/conf/kibana.yml").AsConfig . | indent 2 }} -#{{ end }} diff --git a/kubernetes/log/templates/log-pv-pvc.yaml b/kubernetes/log/templates/log-pv-pvc.yaml deleted file mode 100644 index 20bcbb15c1..0000000000 --- a/kubernetes/log/templates/log-pv-pvc.yaml +++ /dev/null @@ -1,48 +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.disableLogElasticsearch }} -apiVersion: v1 -kind: PersistentVolume -metadata: - name: {{ .Values.nsPrefix }}-elasticsearch-db - namespace: "{{ .Values.nsPrefix }}" - labels: - name: {{ .Values.nsPrefix }}-elasticsearch-db -spec: - capacity: - storage: 2Gi - accessModes: - - ReadWriteMany - persistentVolumeReclaimPolicy: Retain - hostPath: - path: {{ .Values.dataRootDir }}/{{ .Values.nsPrefix }}/log/elasticsearch/data ---- -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: elasticsearch-db - namespace: "{{ .Values.nsPrefix }}" -spec: - accessModes: - - ReadWriteMany - resources: - requests: - storage: 2Gi - selector: - matchLabels: - name: {{ .Values.nsPrefix }}-elasticsearch-db -#{{ end }} diff --git a/kubernetes/log/templates/logstash-deployment.yaml b/kubernetes/log/templates/logstash-deployment.yaml deleted file mode 100644 index 33bcc2001a..0000000000 --- a/kubernetes/log/templates/logstash-deployment.yaml +++ /dev/null @@ -1,90 +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.disableLogLogstash }} -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - labels: - app: logstash - name: log-logstash - namespace: {{ .Values.nsPrefix }} -spec: - replicas: {{ .Values.logstashReplicas }} - selector: - matchLabels: - app: logstash - template: - metadata: - labels: - app: logstash - name: log-logstash - spec: - initContainers: - - command: - - /root/ready.py - args: - - --container-name - - elasticsearch - env: - - name: NAMESPACE - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: metadata.namespace - image: {{ .Values.image.readiness }} - imagePullPolicy: {{ .Values.pullPolicy }} - name: logstash-readiness - containers: - - name: logstash - image: {{ .Values.image.logstash }} - ports: - - containerPort: 5044 - name: transport - protocol: TCP - - containerPort: 9600 - name: http - protocol: TCP - readinessProbe: - tcpSocket: - port: 5044 - volumeMounts: - - mountPath: /usr/share/logstash/config/ - name: logstash-conf - - mountPath: /usr/share/logstash/pipeline/ - name: logstash-pipeline - volumes: - - name: logstash-conf - configMap: - name: log-logstash-configmap - items: - - key: logstash.yml - path: logstash.yml - - name: logstash-pipeline - configMap: - name: log-logstash-configmap - items: - - key: onap-pipeline.conf - path: onap-pipeline.conf - ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: log-logstash-configmap - namespace: {{ .Values.nsPrefix }} -data: -{{ tpl (.Files.Glob "resources/logstash/conf/logstash.yml").AsConfig . | indent 2 }} -{{ tpl (.Files.Glob "resources/logstash/pipeline/onap-pipeline.conf").AsConfig . | indent 2 }} -#{{ end }} diff --git a/kubernetes/log/values.yaml b/kubernetes/log/values.yaml index 0b8d1fe100..088ad5d0b3 100644 --- a/kubernetes/log/values.yaml +++ b/kubernetes/log/values.yaml @@ -12,16 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -nsPrefix: onap -pullPolicy: Always -nodePortPrefix: 302 -dataRootDir: /dockerdata-nfs -elasticsearchReplicas: 1 -kibanaReplicas: 1 -logstashReplicas: 1 -image: - readiness: oomk8s/readiness-check:1.1.0 - logstash: docker.elastic.co/logstash/logstash:5.4.3 - kibana: docker.elastic.co/kibana/kibana:5.5.0 - elasticsearch: docker.elastic.co/elasticsearch/elasticsearch:5.5.0 - es_bb: busybox +################################################################# +# Global configuration defaults. +################################################################# +global: + nodePortPrefix: 302 + repositorySecret: eyJuZXh1czMub25hcC5vcmc6MTAwMDEiOnsidXNlcm5hbWUiOiJkb2NrZXIiLCJwYXNzd29yZCI6ImRvY2tlciIsImVtYWlsIjoiQCIsImF1dGgiOiJaRzlqYTJWeU9tUnZZMnRsY2c9PSJ9fQ== + readinessRepository: oomk8s diff --git a/kubernetes/msb/.helmignore b/kubernetes/msb/.helmignore new file mode 100644 index 0000000000..f0c1319444 --- /dev/null +++ b/kubernetes/msb/.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/msb/Chart.yaml b/kubernetes/msb/Chart.yaml index e9e202b65b..e517d604b1 100644 --- a/kubernetes/msb/Chart.yaml +++ b/kubernetes/msb/Chart.yaml @@ -13,6 +13,6 @@ # limitations under the License. apiVersion: v1 -description: A Helm chart for Kubernetes +description: ONAP MicroServices Bus name: msb -version: 0.1.0 +version: 2.0.0 diff --git a/kubernetes/msb/charts/kube2msb/.helmignore b/kubernetes/msb/charts/kube2msb/.helmignore new file mode 100644 index 0000000000..f0c1319444 --- /dev/null +++ b/kubernetes/msb/charts/kube2msb/.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/msb/charts/kube2msb/Chart.yaml b/kubernetes/msb/charts/kube2msb/Chart.yaml new file mode 100644 index 0000000000..4ab40e65cf --- /dev/null +++ b/kubernetes/msb/charts/kube2msb/Chart.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +description: ONAP MicroServices Bus Kube2MSB Registrator +name: kube2msb +version: 2.0.0 diff --git a/kubernetes/msb/charts/kube2msb/requirements.yaml b/kubernetes/msb/charts/kube2msb/requirements.yaml new file mode 100644 index 0000000000..8cddd3029f --- /dev/null +++ b/kubernetes/msb/charts/kube2msb/requirements.yaml @@ -0,0 +1,4 @@ +dependencies: + - name: common + version: ~2.0.0 + repository: '@local' diff --git a/kubernetes/msb/charts/kube2msb/templates/deployment.yaml b/kubernetes/msb/charts/kube2msb/templates/deployment.yaml new file mode 100644 index 0000000000..94b25a19bf --- /dev/null +++ b/kubernetes/msb/charts/kube2msb/templates/deployment.yaml @@ -0,0 +1,67 @@ +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: + initContainers: + - command: + - /root/ready.py + args: + - --container-name + - msb-discovery + env: + - name: NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + name: {{ include "common.name" . }}-readiness + containers: + - name: {{ include "common.name" . }} + # TODO: Temporary command: + command: + - /bin/sh + - -c + - export AUTH_TOKEN=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token); /bin/kube2msb --kube_master_url=${KUBE_MASTER_URL} --msb_url=${MSB_URL} + image: "{{ .Values.global.repository | default .Values.repository }}/{{ .Values.image }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + env: + - name: KUBE_MASTER_URL + value: {{ .Values.config.kubeMasterUrl }} + - name: MSB_URL + value: {{tpl $.Values.config.discoveryUrl .}} + volumeMounts: + - mountPath: /etc/localtime + name: localtime + readOnly: true + resources: +{{ toYaml .Values.resources | indent 12 }} + {{- if .Values.nodeSelector }} + nodeSelector: +{{ toYaml .Values.nodeSelector | indent 10 }} + {{- end -}} + {{- if .Values.affinity }} + affinity: +{{ toYaml .Values.affinity | indent 10 }} + {{- end }} + volumes: + - name: localtime + hostPath: + path: /etc/localtime + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/kubernetes/msb/charts/kube2msb/values.yaml b/kubernetes/msb/charts/kube2msb/values.yaml new file mode 100644 index 0000000000..43810a9781 --- /dev/null +++ b/kubernetes/msb/charts/kube2msb/values.yaml @@ -0,0 +1,58 @@ +################################################################# +# Global configuration defaults. +################################################################# +global: + nodePortPrefix: 302 + repositorySecret: eyJuZXh1czMub25hcC5vcmc6MTAwMDEiOnsidXNlcm5hbWUiOiJkb2NrZXIiLCJwYXNzd29yZCI6ImRvY2tlciIsImVtYWlsIjoiQCIsImF1dGgiOiJaRzlqYTJWeU9tUnZZMnRsY2c9PSJ9fQ== + readinessRepository: oomk8s + readinessImage: readiness-check:1.1.0 + +################################################################# +# Application configuration defaults. +################################################################# +# application image +repository: nexus3.onap.org:10001 +image: onap/oom/kube2msb:latest +pullPolicy: Always + +# application configuration +config: + routeLabels: "visualRange:1" + kubeMasterUrl: https://kubernetes.default:443 + discoveryUrl: http://{{.Release.Name}}-msb-discovery.{{include "common.namespace" .}}:10081 + +# default number of instances +replicaCount: 1 + +nodeSelector: {} + +affinity: {} + +# probe configuration parameters +liveness: {} + +readiness: {} + +service: {} + +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/.helmignore b/kubernetes/msb/charts/msb-consul/.helmignore new file mode 100644 index 0000000000..f0c1319444 --- /dev/null +++ b/kubernetes/msb/charts/msb-consul/.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/msb/charts/msb-consul/Chart.yaml b/kubernetes/msb/charts/msb-consul/Chart.yaml new file mode 100644 index 0000000000..3a1d299a6b --- /dev/null +++ b/kubernetes/msb/charts/msb-consul/Chart.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +description: ONAP MicroServices Bus Consul +name: msb-consul +version: 2.0.0 diff --git a/kubernetes/msb/charts/msb-consul/requirements.yaml b/kubernetes/msb/charts/msb-consul/requirements.yaml new file mode 100644 index 0000000000..8cddd3029f --- /dev/null +++ b/kubernetes/msb/charts/msb-consul/requirements.yaml @@ -0,0 +1,4 @@ +dependencies: + - name: common + version: ~2.0.0 + repository: '@local' diff --git a/kubernetes/msb/charts/msb-consul/templates/NOTES.txt b/kubernetes/msb/charts/msb-consul/templates/NOTES.txt new file mode 100644 index 0000000000..2465e03634 --- /dev/null +++ b/kubernetes/msb/charts/msb-consul/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 {{ include "common.namespace" . }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "common.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ include "common.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 {{ include "common.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 {{ include "common.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/msb/charts/msb-consul/templates/deployment.yaml b/kubernetes/msb/charts/msb-consul/templates/deployment.yaml new file mode 100644 index 0000000000..74342e7e0c --- /dev/null +++ b/kubernetes/msb/charts/msb-consul/templates/deployment.yaml @@ -0,0 +1,59 @@ +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.dockerHubRepository | default .Values.dockerHubRepository }}/{{ .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: + volumeMounts: + - mountPath: /etc/localtime + name: localtime + readOnly: true + resources: +{{ toYaml .Values.resources | indent 12 }} + {{- if .Values.nodeSelector }} + nodeSelector: +{{ toYaml .Values.nodeSelector | indent 10 }} + {{- end -}} + {{- if .Values.affinity }} + affinity: +{{ toYaml .Values.affinity | indent 10 }} + {{- end }} + volumes: + - name: localtime + hostPath: + path: /etc/localtime + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/kubernetes/msb/charts/msb-consul/templates/service.yaml b/kubernetes/msb/charts/msb-consul/templates/service.yaml new file mode 100644 index 0000000000..86442a2740 --- /dev/null +++ b/kubernetes/msb/charts/msb-consul/templates/service.yaml @@ -0,0 +1,26 @@ +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: +spec: + type: {{ .Values.service.type }} + ports: + {{if eq .Values.service.type "NodePort" -}} + - port: {{ .Values.service.externalPort }} + 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/msb/charts/msb-consul/values.yaml b/kubernetes/msb/charts/msb-consul/values.yaml new file mode 100644 index 0000000000..28df51a370 --- /dev/null +++ b/kubernetes/msb/charts/msb-consul/values.yaml @@ -0,0 +1,65 @@ +################################################################# +# Global configuration defaults. +################################################################# +global: + nodePortPrefix: 302 + repositorySecret: eyJuZXh1czMub25hcC5vcmc6MTAwMDEiOnsidXNlcm5hbWUiOiJkb2NrZXIiLCJwYXNzd29yZCI6ImRvY2tlciIsImVtYWlsIjoiQCIsImF1dGgiOiJaRzlqYTJWeU9tUnZZMnRsY2c9PSJ9fQ== + +################################################################# +# Application configuration defaults. +################################################################# +# application image +dockerHubRepository: registry.hub.docker.com +image: library/consul:0.9.3 +pullPolicy: 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: msb-consul + externalPort: 8500 + internalPort: 8500 + nodePort: 85 + +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-discovery/.helmignore b/kubernetes/msb/charts/msb-discovery/.helmignore new file mode 100644 index 0000000000..f0c1319444 --- /dev/null +++ b/kubernetes/msb/charts/msb-discovery/.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/msb/charts/msb-discovery/Chart.yaml b/kubernetes/msb/charts/msb-discovery/Chart.yaml new file mode 100644 index 0000000000..4a403ba5b5 --- /dev/null +++ b/kubernetes/msb/charts/msb-discovery/Chart.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +description: ONAP MicroServices Bus Discovery +name: msb-discovery +version: 2.0.0 diff --git a/kubernetes/msb/charts/msb-discovery/requirements.yaml b/kubernetes/msb/charts/msb-discovery/requirements.yaml new file mode 100644 index 0000000000..8cddd3029f --- /dev/null +++ b/kubernetes/msb/charts/msb-discovery/requirements.yaml @@ -0,0 +1,4 @@ +dependencies: + - name: common + version: ~2.0.0 + repository: '@local' diff --git a/kubernetes/msb/charts/msb-discovery/templates/NOTES.txt b/kubernetes/msb/charts/msb-discovery/templates/NOTES.txt new file mode 100644 index 0000000000..2465e03634 --- /dev/null +++ b/kubernetes/msb/charts/msb-discovery/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 {{ include "common.namespace" . }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "common.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ include "common.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 {{ include "common.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 {{ include "common.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/msb/charts/msb-discovery/templates/deployment.yaml b/kubernetes/msb/charts/msb-discovery/templates/deployment.yaml new file mode 100644 index 0000000000..f32a5d1544 --- /dev/null +++ b/kubernetes/msb/charts/msb-discovery/templates/deployment.yaml @@ -0,0 +1,76 @@ +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: + initContainers: + - command: + - /root/ready.py + args: + - --container-name + - msb-consul + env: + - name: NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + name: {{ include "common.name" . }}-readiness + 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: CONSUL_IP + value: {{.Release.Name}}-msb-consul.{{ include "common.namespace" . }} + volumeMounts: + - mountPath: /etc/localtime + name: localtime + readOnly: true + resources: +{{ toYaml .Values.resources | indent 12 }} + {{- if .Values.nodeSelector }} + nodeSelector: +{{ toYaml .Values.nodeSelector | indent 10 }} + {{- end -}} + {{- if .Values.affinity }} + affinity: +{{ toYaml .Values.affinity | indent 10 }} + {{- end }} + volumes: + - name: localtime + hostPath: + path: /etc/localtime + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/kubernetes/msb/charts/msb-discovery/templates/service.yaml b/kubernetes/msb/charts/msb-discovery/templates/service.yaml new file mode 100644 index 0000000000..86442a2740 --- /dev/null +++ b/kubernetes/msb/charts/msb-discovery/templates/service.yaml @@ -0,0 +1,26 @@ +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: +spec: + type: {{ .Values.service.type }} + ports: + {{if eq .Values.service.type "NodePort" -}} + - port: {{ .Values.service.externalPort }} + 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/msb/charts/msb-discovery/values.yaml b/kubernetes/msb/charts/msb-discovery/values.yaml new file mode 100644 index 0000000000..d10ba6032e --- /dev/null +++ b/kubernetes/msb/charts/msb-discovery/values.yaml @@ -0,0 +1,67 @@ +################################################################# +# Global configuration defaults. +################################################################# +global: + nodePortPrefix: 302 + repositorySecret: eyJuZXh1czMub25hcC5vcmc6MTAwMDEiOnsidXNlcm5hbWUiOiJkb2NrZXIiLCJwYXNzd29yZCI6ImRvY2tlciIsImVtYWlsIjoiQCIsImF1dGgiOiJaRzlqYTJWeU9tUnZZMnRsY2c9PSJ9fQ== + readinessRepository: oomk8s + readinessImage: readiness-check:1.1.0 + +################################################################# +# Application configuration defaults. +################################################################# +# application image +repository: nexus3.onap.org:10001 +image: onap/msb/msb_discovery:1.1.0-SNAPSHOT-latest +pullPolicy: 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: msb-discovery + externalPort: 10081 + internalPort: 10081 + nodePort: 81 + +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-eag/.helmignore b/kubernetes/msb/charts/msb-eag/.helmignore new file mode 100644 index 0000000000..f0c1319444 --- /dev/null +++ b/kubernetes/msb/charts/msb-eag/.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/msb/charts/msb-eag/Chart.yaml b/kubernetes/msb/charts/msb-eag/Chart.yaml new file mode 100644 index 0000000000..c86decb97a --- /dev/null +++ b/kubernetes/msb/charts/msb-eag/Chart.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +description: ONAP MicroServices Bus Internal API Gateway +name: msb-eag +version: 2.0.0 diff --git a/kubernetes/msb/charts/msb-eag/requirements.yaml b/kubernetes/msb/charts/msb-eag/requirements.yaml new file mode 100644 index 0000000000..8cddd3029f --- /dev/null +++ b/kubernetes/msb/charts/msb-eag/requirements.yaml @@ -0,0 +1,4 @@ +dependencies: + - name: common + version: ~2.0.0 + repository: '@local' diff --git a/kubernetes/msb/charts/msb-eag/templates/NOTES.txt b/kubernetes/msb/charts/msb-eag/templates/NOTES.txt new file mode 100644 index 0000000000..2465e03634 --- /dev/null +++ b/kubernetes/msb/charts/msb-eag/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 {{ include "common.namespace" . }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "common.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ include "common.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 {{ include "common.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 {{ include "common.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/msb/charts/msb-eag/templates/deployment.yaml b/kubernetes/msb/charts/msb-eag/templates/deployment.yaml new file mode 100644 index 0000000000..d41518d662 --- /dev/null +++ b/kubernetes/msb/charts/msb-eag/templates/deployment.yaml @@ -0,0 +1,83 @@ +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: + initContainers: + - command: + - /root/ready.py + args: + - --container-name + - msb-discovery + env: + - name: NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + name: {{ include "common.name" . }}-readiness + 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 }} + name: {{ .Values.service.name }} + - containerPort: {{ .Values.service.internalPortHttps }} + name: {{ .Values.service.name }}-https + # 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: CONSUL_IP + value: {{.Release.Name}}-msb-consul.{{ include "common.namespace" . }} + - name: SDCLIENT_IP + value: {{.Release.Name}}-msb-discovery.{{ include "common.namespace" . }} + - name: ROUTE_LABELS + value: {{ .Values.config.routeLabels }} + volumeMounts: + - mountPath: /etc/localtime + name: localtime + readOnly: true + resources: +{{ toYaml .Values.resources | indent 12 }} + {{- if .Values.nodeSelector }} + nodeSelector: +{{ toYaml .Values.nodeSelector | indent 10 }} + {{- end -}} + {{- if .Values.affinity }} + affinity: +{{ toYaml .Values.affinity | indent 10 }} + {{- end }} + volumes: + - name: localtime + hostPath: + path: /etc/localtime + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/kubernetes/msb/charts/msb-eag/templates/service.yaml b/kubernetes/msb/charts/msb-eag/templates/service.yaml new file mode 100644 index 0000000000..3e4a786cb8 --- /dev/null +++ b/kubernetes/msb/charts/msb-eag/templates/service.yaml @@ -0,0 +1,32 @@ +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: +spec: + type: {{ .Values.service.type }} + ports: + {{if eq .Values.service.type "NodePort" -}} + - port: {{ .Values.service.externalPort }} + nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort }} + name: {{ .Values.service.name }} + - port: {{ .Values.service.externalPortHttps }} + nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePortHttps }} + name: {{ .Values.service.name }}-https + {{- else -}} + - port: {{ .Values.service.externalPort }} + targetPort: {{ .Values.service.internalPort }} + name: {{ .Values.service.name }} + - port: {{ .Values.service.externalPortHttps }} + targetPort: {{ .Values.service.internalPortHttps }} + name: {{ .Values.service.name }}-https + {{- end}} + selector: + app: {{ include "common.name" . }} + release: {{ .Release.Name }} diff --git a/kubernetes/msb/charts/msb-eag/values.yaml b/kubernetes/msb/charts/msb-eag/values.yaml new file mode 100644 index 0000000000..757b46768b --- /dev/null +++ b/kubernetes/msb/charts/msb-eag/values.yaml @@ -0,0 +1,71 @@ +################################################################# +# Global configuration defaults. +################################################################# +global: + nodePortPrefix: 302 + repositorySecret: eyJuZXh1czMub25hcC5vcmc6MTAwMDEiOnsidXNlcm5hbWUiOiJkb2NrZXIiLCJwYXNzd29yZCI6ImRvY2tlciIsImVtYWlsIjoiQCIsImF1dGgiOiJaRzlqYTJWeU9tUnZZMnRsY2c9PSJ9fQ== + readinessRepository: oomk8s + readinessImage: readiness-check:1.1.0 + +################################################################# +# Application configuration defaults. +################################################################# +# application image +repository: nexus3.onap.org:10001 +image: onap/msb/msb_apigateway:1.1.0-SNAPSHOT-latest +pullPolicy: Always + +# application configuration +config: + routeLabels: "visualRange: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: true + +readiness: + initialDelaySeconds: 10 + periodSeconds: 10 + +service: + type: NodePort + name: msb-eag + externalPort: 80 + internalPort: 80 + nodePort: 82 + externalPortHttps: 443 + internalPortHttps: 443 + nodePortHttps: 84 + +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-iag/.helmignore b/kubernetes/msb/charts/msb-iag/.helmignore new file mode 100644 index 0000000000..f0c1319444 --- /dev/null +++ b/kubernetes/msb/charts/msb-iag/.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/msb/charts/msb-iag/Chart.yaml b/kubernetes/msb/charts/msb-iag/Chart.yaml new file mode 100644 index 0000000000..d546bfacf0 --- /dev/null +++ b/kubernetes/msb/charts/msb-iag/Chart.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +description: ONAP MicroServices Bus Internal API Gateway +name: msb-iag +version: 2.0.0 diff --git a/kubernetes/msb/charts/msb-iag/requirements.yaml b/kubernetes/msb/charts/msb-iag/requirements.yaml new file mode 100644 index 0000000000..8cddd3029f --- /dev/null +++ b/kubernetes/msb/charts/msb-iag/requirements.yaml @@ -0,0 +1,4 @@ +dependencies: + - name: common + version: ~2.0.0 + repository: '@local' diff --git a/kubernetes/msb/charts/msb-iag/templates/NOTES.txt b/kubernetes/msb/charts/msb-iag/templates/NOTES.txt new file mode 100644 index 0000000000..2465e03634 --- /dev/null +++ b/kubernetes/msb/charts/msb-iag/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 {{ include "common.namespace" . }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "common.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ include "common.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 {{ include "common.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 {{ include "common.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/msb/charts/msb-iag/templates/deployment.yaml b/kubernetes/msb/charts/msb-iag/templates/deployment.yaml new file mode 100644 index 0000000000..d41518d662 --- /dev/null +++ b/kubernetes/msb/charts/msb-iag/templates/deployment.yaml @@ -0,0 +1,83 @@ +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: + initContainers: + - command: + - /root/ready.py + args: + - --container-name + - msb-discovery + env: + - name: NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + name: {{ include "common.name" . }}-readiness + 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 }} + name: {{ .Values.service.name }} + - containerPort: {{ .Values.service.internalPortHttps }} + name: {{ .Values.service.name }}-https + # 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: CONSUL_IP + value: {{.Release.Name}}-msb-consul.{{ include "common.namespace" . }} + - name: SDCLIENT_IP + value: {{.Release.Name}}-msb-discovery.{{ include "common.namespace" . }} + - name: ROUTE_LABELS + value: {{ .Values.config.routeLabels }} + volumeMounts: + - mountPath: /etc/localtime + name: localtime + readOnly: true + resources: +{{ toYaml .Values.resources | indent 12 }} + {{- if .Values.nodeSelector }} + nodeSelector: +{{ toYaml .Values.nodeSelector | indent 10 }} + {{- end -}} + {{- if .Values.affinity }} + affinity: +{{ toYaml .Values.affinity | indent 10 }} + {{- end }} + volumes: + - name: localtime + hostPath: + path: /etc/localtime + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/kubernetes/msb/charts/msb-iag/templates/service.yaml b/kubernetes/msb/charts/msb-iag/templates/service.yaml new file mode 100644 index 0000000000..3e4a786cb8 --- /dev/null +++ b/kubernetes/msb/charts/msb-iag/templates/service.yaml @@ -0,0 +1,32 @@ +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: +spec: + type: {{ .Values.service.type }} + ports: + {{if eq .Values.service.type "NodePort" -}} + - port: {{ .Values.service.externalPort }} + nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort }} + name: {{ .Values.service.name }} + - port: {{ .Values.service.externalPortHttps }} + nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePortHttps }} + name: {{ .Values.service.name }}-https + {{- else -}} + - port: {{ .Values.service.externalPort }} + targetPort: {{ .Values.service.internalPort }} + name: {{ .Values.service.name }} + - port: {{ .Values.service.externalPortHttps }} + targetPort: {{ .Values.service.internalPortHttps }} + name: {{ .Values.service.name }}-https + {{- end}} + selector: + app: {{ include "common.name" . }} + release: {{ .Release.Name }} diff --git a/kubernetes/msb/charts/msb-iag/values.yaml b/kubernetes/msb/charts/msb-iag/values.yaml new file mode 100644 index 0000000000..6e4877b084 --- /dev/null +++ b/kubernetes/msb/charts/msb-iag/values.yaml @@ -0,0 +1,71 @@ +################################################################# +# Global configuration defaults. +################################################################# +global: + nodePortPrefix: 302 + repositorySecret: eyJuZXh1czMub25hcC5vcmc6MTAwMDEiOnsidXNlcm5hbWUiOiJkb2NrZXIiLCJwYXNzd29yZCI6ImRvY2tlciIsImVtYWlsIjoiQCIsImF1dGgiOiJaRzlqYTJWeU9tUnZZMnRsY2c9PSJ9fQ== + readinessRepository: oomk8s + readinessImage: readiness-check:1.1.0 + +################################################################# +# Application configuration defaults. +################################################################# +# application image +repository: nexus3.onap.org:10001 +image: onap/msb/msb_apigateway:1.1.0-SNAPSHOT-latest +pullPolicy: Always + +# application configuration +config: + routeLabels: "visualRange:1" + +# 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: msb-iag + externalPort: 80 + internalPort: 80 + nodePort: 80 + externalPortHttps: 443 + internalPortHttps: 443 + nodePortHttps: 83 + +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/requirements.yaml b/kubernetes/msb/requirements.yaml new file mode 100644 index 0000000000..acca8ef7e2 --- /dev/null +++ b/kubernetes/msb/requirements.yaml @@ -0,0 +1,4 @@ +dependencies: + - name: common + version: ~2.0.0 + repository: '@local'
\ No newline at end of file diff --git a/kubernetes/msb/templates/all-services.yaml b/kubernetes/msb/templates/all-services.yaml deleted file mode 100644 index 572a78dd2d..0000000000 --- a/kubernetes/msb/templates/all-services.yaml +++ /dev/null @@ -1,90 +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.disableMsbMsbConsul }} -apiVersion: v1 -kind: Service -metadata: - name: msb-consul - namespace: "{{ .Values.nsPrefix }}" - labels: - app: msb-consul -spec: - ports: - - port: {{ .Values.consulPort }} - nodePort: {{ .Values.consulNodePort }} - selector: - app: msb-consul - type: NodePort -#{{ end }} -#{{ if not .Values.disableMsbMsbDiscovery }} ---- -apiVersion: v1 -kind: Service -metadata: - name: msb-discovery - namespace: "{{ .Values.nsPrefix }}" - labels: - app: msb-discovery -spec: - clusterIP: "{{ .Values.discoveryClusterIP }}" - ports: - - port: {{ .Values.discoveryPort }} - nodePort: {{ .Values.discoveryNodePort }} - selector: - app: msb-discovery - type: NodePort -#{{ end }} -#{{ if not .Values.disableMsbMsbIag }} ---- -apiVersion: v1 -kind: Service -metadata: - name: msb-iag - namespace: "{{ .Values.nsPrefix }}" - labels: - app: msb-iag -spec: - ports: - - name: http - port: {{ .Values.iagPort }} - nodePort: {{ .Values.iagNodePort }} - - name: https - port: {{ .Values.iagPort_https }} - nodePort: {{ .Values.iagNodePort_https }} - selector: - app: msb-iag - type: NodePort -#{{ end }} -#{{ if not .Values.disableMsbMsbEag }} ---- -apiVersion: v1 -kind: Service -metadata: - name: msb-eag - namespace: "{{ .Values.nsPrefix }}" - labels: - app: msb-eag -spec: - ports: - - name: http - port: {{ .Values.eagPort }} - nodePort: {{ .Values.eagNodePort }} - - name: https - port: {{ .Values.eagPort_https }} - nodePort: {{ .Values.eagNodePort_https }} - selector: - app: msb-eag - type: NodePort -#{{ end }} diff --git a/kubernetes/msb/templates/kube2msb-registrator-deployment.yaml b/kubernetes/msb/templates/kube2msb-registrator-deployment.yaml deleted file mode 100644 index 97e7d5f319..0000000000 --- a/kubernetes/msb/templates/kube2msb-registrator-deployment.yaml +++ /dev/null @@ -1,60 +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.disableKube2MsbKube2MsbRegistrator }} -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: kube2msb-registrator - namespace: "{{ .Values.nsPrefix }}" -spec: - replicas: 1 - selector: - matchLabels: - app: kube2msb-registrator - template: - metadata: - labels: - app: kube2msb-registrator - name: kube2msb-registrator - spec: - hostname: kube2msb-registrator - initContainers: - - command: - - /root/ready.py - args: - - --container-name - - msb-discovery - env: - - name: NAMESPACE - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: metadata.namespace - image: {{ .Values.image.readiness }} - imagePullPolicy: {{ .Values.pullPolicy }} - name: kube2msb-registrator-readiness - containers: - - args: - image: {{ .Values.image.kube2msb }} - name: kube2msb-registrator - env: - - name: KUBE_MASTER_URL - value: {{ .Values.kubeMasterUrl }} - - name: MSB_URL - value: {{tpl $.Values.discoveryUrl .}} - imagePullPolicy: {{ .Values.pullPolicy }} - imagePullSecrets: - - name: "{{ .Values.nsPrefix }}-docker-registry-key" -#{{ end }} diff --git a/kubernetes/msb/templates/msb-consul-deployment.yaml b/kubernetes/msb/templates/msb-consul-deployment.yaml deleted file mode 100644 index ee5120d42f..0000000000 --- a/kubernetes/msb/templates/msb-consul-deployment.yaml +++ /dev/null @@ -1,46 +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.disableMsbMsbConsul }} -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: msb-consul - namespace: "{{ .Values.nsPrefix }}" -spec: - replicas: {{ .Values.msbConsulReplicas }} - selector: - matchLabels: - app: msb-consul - template: - metadata: - labels: - app: msb-consul - name: msb-consul - spec: - hostname: msb-consul - containers: - - args: - image: {{ .Values.image.consul }} - name: msb-consul - ports: - - containerPort: {{ .Values.consulPort }} - name: msb-consul - readinessProbe: - tcpSocket: - port: {{ .Values.consulPort }} - initialDelaySeconds: 5 - periodSeconds: 10 - imagePullPolicy: {{ .Values.pullPolicy }} -#{{ end }} diff --git a/kubernetes/msb/templates/msb-discovery-deployment.yaml b/kubernetes/msb/templates/msb-discovery-deployment.yaml deleted file mode 100644 index 583a00f22a..0000000000 --- a/kubernetes/msb/templates/msb-discovery-deployment.yaml +++ /dev/null @@ -1,66 +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.disableMsbMsbDiscovery }} -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: msb-discovery - namespace: "{{ .Values.nsPrefix }}" -spec: - replicas: {{ .Values.discoveryReplicas }} - selector: - matchLabels: - app: msb-discovery - template: - metadata: - labels: - app: msb-discovery - name: msb-discovery - spec: - hostname: msb-discovery - initContainers: - - command: - - /root/ready.py - args: - - --container-name - - msb-consul - env: - - name: NAMESPACE - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: metadata.namespace - image: {{ .Values.image.readiness }} - imagePullPolicy: {{ .Values.pullPolicy }} - name: msb-discovery-readiness - containers: - - args: - image: {{ .Values.image.discovery }} - name: "msb-discovery" - env: - - name: CONSUL_IP - value: msb-consul.{{ .Values.nsPrefix }} - ports: - - containerPort: {{ .Values.discoveryPort }} - name: msb-discovery - readinessProbe: - tcpSocket: - port: {{ .Values.discoveryPort }} - initialDelaySeconds: 5 - periodSeconds: 10 - imagePullPolicy: {{ .Values.pullPolicy }} - imagePullSecrets: - - name: "{{ .Values.nsPrefix }}-docker-registry-key" -#{{ end }} diff --git a/kubernetes/msb/templates/msb-eag-deployment.yaml b/kubernetes/msb/templates/msb-eag-deployment.yaml deleted file mode 100644 index dd253fce4d..0000000000 --- a/kubernetes/msb/templates/msb-eag-deployment.yaml +++ /dev/null @@ -1,70 +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.disableMsbMsbEag }} -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: msb-eag - namespace: "{{ .Values.nsPrefix }}" -spec: - replicas: {{ .Values.eagReplicas }} - selector: - matchLabels: - app: msb-eag - template: - metadata: - labels: - app: msb-eag - name: msb-eag - spec: - hostname: msb-eag - initContainers: - - command: - - /root/ready.py - args: - - --container-name - - msb-discovery - env: - - name: NAMESPACE - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: metadata.namespace - image: {{ .Values.image.readiness }} - imagePullPolicy: {{ .Values.pullPolicy }} - name: msb-eag-readiness - containers: - - args: - image: {{ .Values.image.apigateway }} - name: "msb-eag" - env: - - name: CONSUL_IP - value: msb-consul.{{ .Values.nsPrefix }} - - name: SDCLIENT_IP - value: msb-discovery.{{ .Values.nsPrefix }} - - name: ROUTE_LABELS - value: "visualRange:0" - ports: - - containerPort: {{ .Values.eagPort }} - name: msb-eag - readinessProbe: - tcpSocket: - port: {{ .Values.eagPort }} - initialDelaySeconds: 5 - periodSeconds: 10 - imagePullPolicy: {{ .Values.pullPolicy}} - imagePullSecrets: - - name: "{{ .Values.nsPrefix }}-docker-registry-key" -#{{ end }} diff --git a/kubernetes/msb/templates/msb-iag-deployment.yaml b/kubernetes/msb/templates/msb-iag-deployment.yaml deleted file mode 100644 index 9fc5c7b4dd..0000000000 --- a/kubernetes/msb/templates/msb-iag-deployment.yaml +++ /dev/null @@ -1,70 +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.disableMsbMsbIag }} -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: msb-iag - namespace: "{{ .Values.nsPrefix }}" -spec: - replicas: {{ .Values.iagReplicas }} - selector: - matchLabels: - app: msb-iag - template: - metadata: - labels: - app: msb-iag - name: msb-iag - spec: - hostname: msb-iag - initContainers: - - command: - - /root/ready.py - args: - - --container-name - - msb-discovery - env: - - name: NAMESPACE - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: metadata.namespace - image: {{ .Values.image.readiness }} - imagePullPolicy: {{ .Values.pullPolicy }} - name: msb-iag-readiness - containers: - - args: - image: {{ .Values.image.apigateway }} - name: "msb-iag" - env: - - name: CONSUL_IP - value: msb-consul.{{ .Values.nsPrefix }} - - name: SDCLIENT_IP - value: msb-discovery.{{ .Values.nsPrefix }} - - name: ROUTE_LABELS - value: "visualRange:1" - ports: - - containerPort: {{ .Values.iagPort }} - name: msb-iag - readinessProbe: - tcpSocket: - port: {{ .Values.iagPort }} - initialDelaySeconds: 5 - periodSeconds: 10 - imagePullPolicy: "{{ .Values.pullPolicy}}" - imagePullSecrets: - - name: "{{ .Values.nsPrefix }}-docker-registry-key" -#{{ end }} diff --git a/kubernetes/msb/values.yaml b/kubernetes/msb/values.yaml index bf42455586..49e5196e41 100644 --- a/kubernetes/msb/values.yaml +++ b/kubernetes/msb/values.yaml @@ -12,34 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -nsPrefix: onap -pullPolicy: IfNotPresent -image: - readiness: oomk8s/readiness-check:1.1.0 - consul: consul:0.9.3 - discovery: nexus3.onap.org:10001/onap/msb/msb_discovery:1.1.0-SNAPSHOT-latest - apigateway: nexus3.onap.org:10001/onap/msb/msb_apigateway:1.1.0-SNAPSHOT-latest - kube2msb: nexus3.onap.org:10001/onap/oom/kube2msb - -consulPort: 8500 -consulNodePort: 30500 -msbConsulReplicas: 1 - -discoveryPort: 10081 -discoveryNodePort: 30081 -discoveryReplicas: 1 - -iagPort: 80 -iagPort_https: 443 -iagNodePort: 30080 -iagNodePort_https: 30443 -iagReplicas: 2 - -eagPort: 80 -eagPort_https: 443 -eagNodePort: 30082 -eagNodePort_https: 30446 -eagReplicas: 2 - -kubeMasterUrl: https://kubernetes.default.svc.cluster.local:443 -discoveryUrl: http://msb-discovery.{{ .Values.nsPrefix }}:10081 +################################################################# +# Global configuration defaults. +################################################################# +global: + nodePortPrefix: 302 + repositorySecret: eyJuZXh1czMub25hcC5vcmc6MTAwMDEiOnsidXNlcm5hbWUiOiJkb2NrZXIiLCJwYXNzd29yZCI6ImRvY2tlciIsImVtYWlsIjoiQCIsImF1dGgiOiJaRzlqYTJWeU9tUnZZMnRsY2c9PSJ9fQ== diff --git a/kubernetes/mso/resources/config/log/filebeat/filebeat.yml b/kubernetes/mso/resources/config/log/filebeat/filebeat.yml index 89c6932577..b0d4690754 100644 --- a/kubernetes/mso/resources/config/log/filebeat/filebeat.yml +++ b/kubernetes/mso/resources/config/log/filebeat/filebeat.yml @@ -21,7 +21,7 @@ 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.{{.Values.nsPrefix}}:5044"] + hosts: ["{{.Values.config.logstashServiceName}}.{{.Release.Namespace}}:{{.Values.config.logstashPort}}"] #If enable will do load balancing among availabe Logstash, automatically. loadbalance: true diff --git a/kubernetes/mso/values.yaml b/kubernetes/mso/values.yaml index 8b2e18567a..410246fcbc 100644 --- a/kubernetes/mso/values.yaml +++ b/kubernetes/mso/values.yaml @@ -29,3 +29,7 @@ image: mso: nexus3.onap.org:10001/openecomp/mso:v1.1.2 mariadb: nexus3.onap.org:10001/mariadb:10.1.11 filebeat: docker.elastic.co/beats/filebeat:5.5.0 + +config: + logstashServiceName: log-ls + logstashPort: 5044 diff --git a/kubernetes/multicloud/resources/config/log/filebeat/filebeat.yml b/kubernetes/multicloud/resources/config/log/filebeat/filebeat.yml index 706f24d693..a6dd579b4b 100644 --- a/kubernetes/multicloud/resources/config/log/filebeat/filebeat.yml +++ b/kubernetes/multicloud/resources/config/log/filebeat/filebeat.yml @@ -21,7 +21,7 @@ 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.{{.Values.nsPrefix}}:5044"] + hosts: ["{{.Values.config.logstashServiceName}}.{{.Release.Namespace}}:{{.Values.config.logstashPort}}"] #If enable will do load balancing among availabe Logstash, automatically. loadbalance: true diff --git a/kubernetes/multicloud/templates/multicloud-windriver-deployment.yaml b/kubernetes/multicloud/templates/multicloud-windriver-deployment.yaml index 8d9ec35571..c1b385865b 100644 --- a/kubernetes/multicloud/templates/multicloud-windriver-deployment.yaml +++ b/kubernetes/multicloud/templates/multicloud-windriver-deployment.yaml @@ -66,7 +66,7 @@ spec: timeoutSeconds: 10 successThreshold: 1 failureThreshold: 5 - - image: {{ .Values.image.filebeat }} + - image: {{ .Values.image.filebeat }} imagePullPolicy: {{ .Values.pullPolicy }} name: filebeat-onap volumeMounts: diff --git a/kubernetes/multicloud/values.yaml b/kubernetes/multicloud/values.yaml index 2f76d6a688..d43ee61343 100644 --- a/kubernetes/multicloud/values.yaml +++ b/kubernetes/multicloud/values.yaml @@ -30,3 +30,7 @@ image: # domain name of msb gateway msbgateway: msb-iag.{{ .Values.nsPrefix }} msbPort: 80 + +config: + logstashServiceName: log-ls + logstashPort: 5044 diff --git a/kubernetes/onap/requirements.yaml b/kubernetes/onap/requirements.yaml index 0b511503b9..d440b68b58 100644 --- a/kubernetes/onap/requirements.yaml +++ b/kubernetes/onap/requirements.yaml @@ -18,11 +18,11 @@ # > helm repo add local http://127.0.0.1:8879 dependencies: - name: aaf - version: ~1.1.0 + version: ~2.0.0 repository: '@local' condition: aaf.enabled - name: aai - version: ~0.1.0 + version: ~2.0.0 repository: '@local' condition: aai.enabled - name: appc @@ -49,11 +49,11 @@ dependencies: repository: '@local' condition: dcaegen2.enabled - name: esr - version: ~1.0.0 + version: ~2.0.0 repository: '@local' condition: esr.enabled - name: log - version: ~0.1.0 + version: ~2.0.0 repository: '@local' condition: log.enabled - name: message-router @@ -65,7 +65,7 @@ dependencies: repository: '@local' condition: mock.enabled - name: msb - version: ~0.1.0 + version: ~2.0.0 repository: '@local' condition: msb.enabled - name: multicloud @@ -105,7 +105,7 @@ dependencies: repository: '@local' condition: vfc.enabled - name: vid - version: ~0.1.0 + version: ~2.0.0 repository: '@local' condition: vid.enabled - name: vnfsdk diff --git a/kubernetes/onap/values.yaml b/kubernetes/onap/values.yaml index 0c3ff8526d..ee7d00b441 100644 --- a/kubernetes/onap/values.yaml +++ b/kubernetes/onap/values.yaml @@ -63,7 +63,7 @@ dcaegen2: enabled: true esr: enabled: true -log: +log: # ONAP Logging ElasticStack enabled: true message-router: enabled: true diff --git a/kubernetes/oneclick/createAll.bash b/kubernetes/oneclick/createAll.bash deleted file mode 100755 index ded7c392ed..0000000000 --- a/kubernetes/oneclick/createAll.bash +++ /dev/null @@ -1,189 +0,0 @@ -#!/bin/bash - -. $(dirname "$0")/setenv.bash - - -usage() { - cat <<EOF -Usage: $0 [PARAMs] --u : Display usage --n [NAMESPACE] : Kubernetes namespace (required) --v [VALUES] : HELM values filepath (usefull when deploying one component at a time) --l [LOCATION] : Location of oom project --i [INSTANCE] : ONAP deployment instance # (default: 1) --a [APP] : Specify a specific ONAP component (default: all) - from the following choices: - sdc, aai ,mso, message-router, robot, vid, aaf, uui - sdnc, portal, policy, appc, multicloud, clamp, consul, vnfsdk -EOF -} - -check_return_code(){ - ret=$? - if [ $ret -ne 0 ]; then - printf "The command $1 returned with error code $ret \n" 1>&2 - exit $ret - fi -} - -create_service_account() { - cmd=`echo kubectl create clusterrolebinding $1-admin-binding --clusterrole=cluster-admin --serviceaccount=$1:default` - eval ${cmd} - check_return_code $cmd -} - -create_namespace() { - cmd=`echo kubectl create namespace $1` - eval ${cmd} -} - -create_registry_key() { -cmd=`echo kubectl --namespace $1 create secret docker-registry $2 --docker-server=$3 --docker-username=$4 --docker-password=$5 --docker-email=$6` - eval ${cmd} - check_return_code $cmd -} - -configure_dcaegen2() { - if [ ! -s "$OPENSTACK_PRIVATE_KEY_PATH" ] - then - echo "ERROR: $OPENSTACK_PRIVATE_KEY_PATH does not exist or is empty. Cannot launch dcae gen2." - return 1 - fi - - cmd=`echo kubectl --namespace $1-$2 create secret generic $2-openstack-ssh-private-key --from-file=key=${OPENSTACK_PRIVATE_KEY_PATH}` - eval ${cmd} - check_return_code $cmd - - if [ ! -s "$DCAEGEN2_CONFIG_INPUT_FILE_PATH" ] - then - echo "ERROR: $DCAEGEN2_CONFIG_INPUT_FILE_PATH does not exist or is empty. Cannot launch dcae gen2." - return 1 - fi - - cmd=`echo kubectl --namespace $1-$2 create configmap $2-config-inputs --from-file=inputs.yaml=${DCAEGEN2_CONFIG_INPUT_FILE_PATH}` - eval ${cmd} - check_return_code $cmd -} - -create_onap_helm() { - HELM_VALUES_ADDITION="" - if [[ ! -z $HELM_VALUES_FILEPATH ]]; then - HELM_VALUES_ADDITION="--values=$HELM_VALUES_FILEPATH" - fi - # Have to put a check for dcaegen2 because it requires external files to helm - # which should not be part of the Chart. - if [ "$2" = "dcaegen2" ]; - then - configure_dcaegen2 $1 $2 - local result=$? - if [ $result -ne 0 ] - then - echo "ERROR: dcaegen2 failed to configure: Pre-requisites not met. Skipping deploying it and continue" - return - fi - fi - - cmd=`echo helm install $LOCATION/$2/ --name $1-$2 --namespace $1 --set nsPrefix=$1,nodePortPrefix=$3 ${HELM_VALUES_ADDITION}` - eval ${cmd} - check_return_code $cmd -} - -#MAINs -NS= -HELM_VALUES_FILEPATH="" -LOCATION="../" -INCL_SVC=true -APP= -INSTANCE=1 -MAX_INSTANCE=5 -DU=$ONAP_DOCKER_USER -DP=$ONAP_DOCKER_PASS - -SINGLE_COMPONENT=false - -while getopts ":n:u:s:i:a:du:dp:l:v:" PARAM; do - case $PARAM in - u) - usage - exit 1 - ;; - n) - NS=${OPTARG} - ;; - v) - HELM_VALUES_FILEPATH=${OPTARG} - ;; - i) - INSTANCE=${OPTARG} - ;; - l) - LOCATION=${OPTARG} - ;; - a) - SINGLE_COMPONENT=true - APP=${OPTARG} - if [[ -z $APP ]]; then - usage - exit 1 - fi - ;; - du) - DU=${OPTARG} - ;; - dp) - DP=${OPTARG} - ;; - ?) - usage - exit - ;; - esac -done - -if [[ -z $NS ]]; then - usage - exit 1 -fi - -if [[ ! -z "$APP" ]]; then - HELM_APPS=($APP) -fi - - -if [ "$INSTANCE" -gt "$MAX_INSTANCE" ];then - printf "\n********** You choose to create ${INSTANCE}th instance of ONAP \n" - printf "\n********** Due to port allocation only ${MAX_INSTANCE} instances of ONAP is allowed per kubernetes deployment\n" - exit 1 -fi - -start=$((300+2*INSTANCE)) -end=$((start+1)) - -printf "\n********** Creating instance ${INSTANCE} of ONAP with port range ${start}00 and ${end}99\n" - - -printf "\n********** Creating ONAP: ${ONAP_APPS[*]}\n" - -if [ "$SINGLE_COMPONENT" == "false" ] -then - printf "\nCreating namespace **********\n" - create_namespace $NS - - printf "\nCreating registry secret **********\n" - create_registry_key $NS ${NS}-docker-registry-key $ONAP_DOCKER_REGISTRY $DU $DP $ONAP_DOCKER_MAIL - - printf "\nCreating service account **********\n" - create_service_account $NS -fi - -printf "\n\n********** Creating deployments for ${HELM_APPS[*]} ********** \n" - -for i in ${HELM_APPS[@]}; do - - printf "\nCreating deployments and services **********\n" - create_onap_helm $NS $i $start - - printf "\n" -done - -printf "\n**** Done ****\n" diff --git a/kubernetes/oneclick/deleteAll.bash b/kubernetes/oneclick/deleteAll.bash deleted file mode 100755 index 9833af7909..0000000000 --- a/kubernetes/oneclick/deleteAll.bash +++ /dev/null @@ -1,150 +0,0 @@ -#!/bin/bash - -. $(dirname "$0")/setenv.bash - -delete_namespace() { - kubectl delete namespace $1 -} - -delete_service_account() { - kubectl delete clusterrolebinding $1-admin-binding -} - -delete_registry_key() { - kubectl --namespace $1 delete secret ${1}-docker-registry-key -} - -delete_app_helm() { - helm delete $1-$2 --purge -} - -wait_terminate() { - printf "Waiting for namespaces termination...\n" - while true; do - declare -i _STATUS=0 - for i in ${HELM_APPS[@]}; do - kubectl get pods --namespace $1 | grep -w " $i" > /dev/null 2>&1 - if [ "$?" -ne "0" ]; then - _STATUS=1 - break - fi - done - - if [ "$SINGLE_COMPONENT" == "false" ]; then - kubectl get namespaces $1 > /dev/null 2>&1 - _STATUS=$? - fi - if [ "$_STATUS" -ne "0" ]; then - break - fi - sleep 2 - done -} - -usage() { - cat <<EOF -Usage: $0 [PARAMs] --u : Display usage --n [NAMESPACE] : Kubernetes namespace (required) --c : kubectl context (default: current context) --y : Skip interactive confirmation (default: no) --a [APP] : Specify a specific ONAP component (default: all) - from the following choices: - sdc, aai ,mso, message-router, robot, vid, aaf, uui - sdnc, portal, policy, appc, multicloud, clamp, consul, vnfsdk --N : Do not wait for deletion of namespace and its objects -EOF -} - -#MAINs -NS= -INCL_SVC=false -APP= -WAIT_TERMINATE=true -SKIP_INTERACTIVE_CONFIRMATION=no -KUBECTL_CONTEXT= -SINGLE_COMPONENT=false -while getopts ":c:n:u:s:a:yN" PARAM; do - case $PARAM in - u) - usage - exit 1 - ;; - n) - NS=${OPTARG} - ;; - a) - APP=${OPTARG} - if [[ -z $APP ]]; then - usage - exit 1 - fi - SINGLE_COMPONENT=true - ;; - N) - WAIT_TERMINATE=false - ;; - y) - SKIP_INTERACTIVE_CONFIRMATION=yes - ;; - c) - KUBECTL_CONTEXT=${OPTARG} - ;; - ?) - usage - exit - ;; - esac -done - -if [[ -z $NS ]]; then - usage - exit 1 -fi - -if [[ "$SKIP_INTERACTIVE_CONFIRMATION" != yes ]]; then - current_kubectl_context=$(kubectl config get-contexts |grep "*" |awk '{print $2}') - if test "$KUBECTL_CONTEXT" != "$current_kubectl_context"; then - printf "Current kubectl context does not match context specified:\x1b[31m $current_kubectl_context\x1b[0m\n" - if [ ! -z "$KUBECTL_CONTEXT" -a "$KUBECTL_CONTEXT" != " " ]; then - read -p "Do you wish to switch context to $KUBECTL_CONTEXT and continue?" yn - case $yn in - [Yy]* ) kubectl config use-context $KUBECTL_CONTEXT;; - * ) printf "Skipping delete...\n"; exit;; - esac - else - printf "You are about to delete deployment from:\x1b[31m $current_kubectl_context\x1b[0m\n" - read -p "To continue enter context name: " response - - if test "$response" != "$current_kubectl_context" - then - printf "Your response does not match current context! Skipping delete ...\n" - exit 1 - fi - fi - fi -fi - -if [[ ! -z "$APP" ]]; then - HELM_APPS=($APP) -fi - -printf "\n********** Cleaning up ONAP: ${ONAP_APPS[*]}\n" - -for i in ${HELM_APPS[@]}; do - delete_app_helm $NS $i -done - -if [ "$SINGLE_COMPONENT" == "false" ] -then - delete_app_helm $NS "config" - delete_namespace $NS - delete_registry_key $NS - delete_service_account $NS -fi - -if $WAIT_TERMINATE; then - wait_terminate $NS -fi - -printf "\n********** Gone **********\n" diff --git a/kubernetes/oneclick/setenv.bash b/kubernetes/oneclick/setenv.bash deleted file mode 100644 index 716b76c410..0000000000 --- a/kubernetes/oneclick/setenv.bash +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# Deploying MSB first so the started ONAP services can be registered to MSB -HELM_APPS=('consul' 'msb' 'mso' 'message-router' 'sdnc' 'vid' 'robot' 'portal' 'policy' 'aai' 'sdc' 'dcaegen2' 'log' 'cli' 'multicloud' 'clamp' 'vnfsdk' 'uui' 'aaf' 'vfc' 'esr') -ONAP_DOCKER_REGISTRY=${ONAP_DOCKER_REGISTRY:-nexus3.onap.org:10001} -ONAP_DOCKER_USER=${ONAP_DOCKER_USER:-docker} -ONAP_DOCKER_PASS=${ONAP_DOCKER_PASS:-docker} -ONAP_DOCKER_MAIL=${ONAP_DOCKER_MAIL:-$USERNAME@$USERDOMAIN} -# Openstack key pair private key file location required to enable dcaegen2 installer CRUD operations in your Openstack -# Ensure you set the name of your keypair in the dcae-parameters.yaml entry "keypair: "dcae-g2" -# example: export OPENSTACK_PRIVATE_KEY_PATH=/home/user/Downloads/dcae-g2.pem -OPENSTACK_PRIVATE_KEY_PATH=${OPENSTACK_PRIVATE_KEY_PATH:-~/.ssh/onap_rsa} -# dcaegen2 bootstrap configuration input yaml file. Start from the sample, and set your environments real values: -# example: export DCAEGEN2_CONFIG_INPUT_FILE_PATH=/tmp/dcae-parameters.yaml -DCAEGEN2_CONFIG_INPUT_FILE_PATH=${DCAEGEN2_CONFIG_INPUT_FILE_PATH:-../dcaegen2/dcae-parameters-sample.yaml} diff --git a/kubernetes/oneclick/tools/autoCleanConfig.bash b/kubernetes/oneclick/tools/autoCleanConfig.bash deleted file mode 100644 index e274e0d0c5..0000000000 --- a/kubernetes/oneclick/tools/autoCleanConfig.bash +++ /dev/null @@ -1,54 +0,0 @@ -######################################################################################## -# This script wraps {$OOM}/kubernetes/oneclick/deleteAll.sh script along with # -# the following steps to clean up ONAP configure for specified namespace: # -# - remove namespace # -# - remove release # -# - remove shared directory # -# # -# To run it, just enter the following command: # -# ./autoCleanConfig.bash <namespace, default is "onap"> # -######################################################################################## -#!/bin/bash - - -NS=$1 -if [[ -z $NS ]] -then - echo "Namespace is not specified, use onap namespace." - NS="onap" -fi - -echo "Clean up $NS configuration" -cd .. -./deleteAll.bash -n $NS -y -cd - - -echo "---------------------------------------------- -Force remove namespace..." -kubectl delete namespace $NS -echo "...done : kubectl get namespace ------------------------------------------------ ->>>>>>>>>>>>>> k8s namespace" -kubectl get namespace -while [[ ! -z `kubectl get namespace|grep $NS` ]] -do - echo "Wait for namespace $NS to be deleted ------------------------------------------------ ->>>>>>>>>>>>>> k8s namespace" - kubectl get namespace - sleep 2 -done - -echo "Force delete helm process ..." -helm delete $NS-config --purge --debug -echo "...done : helm ls --all - ----------------------------------------------- ->>>>>>>>>>>>>> helm" -helm ls --all - -echo "Remove $NS dockerdata..." -sudo rm -rf /dockerdata-nfs/onap -echo "...done : ls -altr /dockerdata-nfs - ----------------------------------------------- ->>>>>>>>>>>>>> /dockerdata-nfs directory" -ls -altr /dockerdata-nfs diff --git a/kubernetes/oneclick/tools/autoCreateConfig.bash b/kubernetes/oneclick/tools/autoCreateConfig.bash deleted file mode 100644 index 99ea03e1bb..0000000000 --- a/kubernetes/oneclick/tools/autoCreateConfig.bash +++ /dev/null @@ -1,65 +0,0 @@ -######################################################################################## -# This script wraps {$OOM}/kubernetes/config/createConfig.sh script # -# and will only terminated when the configuration is Completed or failed # -# # -# To run it, just enter the following command: # -# ./autoCreateConfig.bash <namespace, default is "onap"> # -######################################################################################## -#!/bin/bash - - -NS=$1 -if [[ -z $NS ]] -then - echo "Namespace is not specified, use onap namespace." - NS="onap" -fi - -echo "Create $NS config under config directory..." -cd ../../config -./createConfig.sh -n $NS -cd - - - -echo "...done : kubectl get namespace ------------------------------------------------ ->>>>>>>>>>>>>> k8s namespace" -kubectl get namespace - - -echo " ------------------------------------------------ ->>>>>>>>>>>>>> helm : helm ls --all" -helm ls --all - - -echo " ------------------------------------------------ ->>>>>>>>>>>>>> pod : kubectl get pods -n $NS -a" -kubectl get pods -n $NS -a - - -while true -do - echo "wait for $NS config pod reach to Completed STATUS" - sleep 5 - echo "-----------------------------------------------" - kubectl get pods -n $NS -a - - status=`kubectl get pods -n $NS -a |grep config |xargs echo | cut -d' ' -f3` - - if [ "$status" = "Completed" ] - then - echo "$NS config is Completed!!!" - break - fi - - if [ "$status" = "Error" ] - then - echo " -$NS config is failed with Error!!! -Logs are:" - kubectl logs config -n $NS -f - break - fi -done diff --git a/kubernetes/oneclick/tools/collectInfo.bash b/kubernetes/oneclick/tools/collectInfo.bash deleted file mode 100644 index 734c5a6c62..0000000000 --- a/kubernetes/oneclick/tools/collectInfo.bash +++ /dev/null @@ -1,171 +0,0 @@ -#!/bin/bash - -NS= -OUT_NAME=onap_info_$(date +%y.%m.%d_%H.%M.%S.%N) -OUT_FILE= -OUT_DIR=$(dirname "$0") -TMP_DIR=$(dirname $(mktemp -u)) -CONTAINER_LOGS_PATH=/var/log/onap -CP_CONTAINER_LOGS=false - -if [ ! -z "$DEBUG" ]; then - set -x -fi - -usage() { - cat <<EOF -Utility script collecting various information about ONAP deployment on kubernetes. - -Usage: $0 [PARAMs] --u : Display usage --n [NAMESPACE] : Kubernetes namespace (required) --a [APP] : Specify a specific ONAP component (default: all) --d [OUT_DIR] : Specify output folder for the collected info pack file - (default: current dir) --f [OUT_FILE] : Specify output file for the collected info - (default: file name with timestamp) --c : Collect log files from containers, from path ${CONTAINER_LOGS_PATH} -EOF -} - -call_with_log() { - local _cmd=$1 - local _log=$2 - # Make sure otput dir exists - mkdir -p "$(dirname "$_log")" - printf "Command: ${_cmd}\n" >> ${_log} - printf "================================================================================\n" >> ${_log} - eval "${_cmd}" >> ${_log} 2>&1 - printf "================================================================================\n" >> ${_log} -} - -collect_pod_info() { - local _ns=$1 - local _id=$2 - local _log_dir=$3 - local _cp_logs=$4 - declare -i _i=0 - kubectl -n $_ns get pods $_id -o=jsonpath='{range .spec.containers[*]}{.name}{"\n"}{end}' | while read c; do - call_with_log "kubectl -n $_ns logs $_id -c $c" "$_log_dir/$_id-$c.log" - if [ "$_i" -eq "0" ] && [ "$_cp_logs" == "true" ]; then - # copy logs from 1st container only as logs dir is shared between the containers - local _cmd="kubectl cp $_ns/$_id:${CONTAINER_LOGS_PATH} $_log_dir/$_id-$c -c $c" - if [ -z "$DEBUG" ]; then - _cmd+=" > /dev/null 2>&1" - fi - eval "${_cmd}" - fi - ((_i++)) - done -} - -collect_ns_info() { - local _ns=$1 - local _log_dir=$2/$_ns - call_with_log "kubectl -n $NS-$i get services -o=wide" "$_log_dir/list_services.log" - kubectl -n "$_ns" get services | while read i; do - local _id=`echo -n $i | tr -s ' ' | cut -d' ' -n -f1` - if [ "$_id" == "NAME" ]; then - continue - fi - call_with_log "kubectl -n $_ns describe services $_id" "$_log_dir/describe_services/$_id.log" - done - call_with_log "kubectl -n $NS-$i get pods -o=wide" "$_log_dir/list_pods.log" - kubectl -n "$_ns" get pods | while read i; do - local _id=`echo -n $i | tr -s ' ' | cut -d' ' -n -f1` - if [ "$_id" == "NAME" ]; then - continue - fi - call_with_log "kubectl -n $_ns describe pods $_id" "$_log_dir/describe_pods/$_id.log" - collect_pod_info "$_ns" "$_id" "$_log_dir/logs" "${CP_CONTAINER_LOGS}" - done -} - -while getopts ":un:a:d:f:c" PARAM; do - case $PARAM in - u) - usage - exit 1 - ;; - n) - NS=${OPTARG} - ;; - a) - APP=${OPTARG} - if [[ -z $APP ]]; then - usage - exit 1 - fi - ;; - d) - OUT_DIR=${OPTARG} - if [[ -z $OUT_DIR ]]; then - usage - exit 1 - fi - ;; - f) - OUT_FILE=${OPTARG} - if [[ -z $OUT_FILE ]]; then - usage - exit 1 - fi - ;; - c) - CP_CONTAINER_LOGS=true - ;; - ?) - usage - exit - ;; - esac -done - -if [ -z "$NS" ]; then - usage - exit 1 -fi - -if [[ -z $OUT_FILE ]]; then - OUT_FILE=$OUT_NAME.tgz -fi - -if [ ! -z "$APP" ]; then - _APPS=($APP) -else - _APPS=(`kubectl get namespaces | grep "^$NS-" | tr -s ' ' | cut -d' ' -n -f1 | sed -e "s/^$NS-//"`) -fi - -printf "Collecting information about ONAP deployment...\n" -printf "Components: %s\n" "${_APPS[*]}" - -# Collect common info -mkdir -p ${TMP_DIR}/${OUT_NAME}/ -echo "${_APPS[*]}" > ${TMP_DIR}/${OUT_NAME}/component-list.log -printf "Collecting Helm info\n" -call_with_log "helm version" "${TMP_DIR}/${OUT_NAME}/helm-version.log" -call_with_log "helm list" "${TMP_DIR}/${OUT_NAME}/helm-list.log" - -printf "Collecting Kubernetes info\n" -call_with_log "kubectl version" "${TMP_DIR}/${OUT_NAME}/k8s-version.log" -call_with_log "kubectl get nodes -o=wide" "${TMP_DIR}/${OUT_NAME}/k8s-nodes.log" -call_with_log "kubectl cluster-info" "${TMP_DIR}/${OUT_NAME}/k8s-cluster-info.log" -call_with_log "kubectl cluster-info dump" "${TMP_DIR}/${OUT_NAME}/k8s-cluster-info-dump.log" -call_with_log "kubectl top node" "${TMP_DIR}/${OUT_NAME}/k8s-top-node.log" - -# Collect per-component info -for i in ${_APPS[@]}; do - printf "Writing Kubernetes info of component $i\n" - collect_ns_info "$NS-$i" "${TMP_DIR}/${OUT_NAME}" -done - -# Pack and cleanup -mkdir -p ${OUT_DIR} -_OUT_DIR=`readlink -e ${OUT_DIR}` -printf "Packing output to ${_OUT_DIR}/${OUT_FILE}...\n" -cd ${TMP_DIR} -tar cfz ${_OUT_DIR}/${OUT_FILE} ${OUT_NAME} -cd - -printf "Cleaning up...\n" -rm -rf ${TMP_DIR}/${OUT_NAME} -printf "Done\n" diff --git a/kubernetes/policy/resources/config/log/filebeat/filebeat.yml b/kubernetes/policy/resources/config/log/filebeat/filebeat.yml index 89c6932577..b0d4690754 100644 --- a/kubernetes/policy/resources/config/log/filebeat/filebeat.yml +++ b/kubernetes/policy/resources/config/log/filebeat/filebeat.yml @@ -21,7 +21,7 @@ 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.{{.Values.nsPrefix}}:5044"] + hosts: ["{{.Values.config.logstashServiceName}}.{{.Release.Namespace}}:{{.Values.config.logstashPort}}"] #If enable will do load balancing among availabe Logstash, automatically. loadbalance: true diff --git a/kubernetes/policy/values.yaml b/kubernetes/policy/values.yaml index 5a04070da3..49ad89225d 100644 --- a/kubernetes/policy/values.yaml +++ b/kubernetes/policy/values.yaml @@ -38,3 +38,7 @@ image: policyNexusVersion: v1.1.1 ubuntu: ubuntu:16.04 filebeat: docker.elastic.co/beats/filebeat:5.5.0 + +config: + logstashServiceName: log-ls + logstashPort: 5044 diff --git a/kubernetes/portal/resources/config/log/filebeat/filebeat.yml b/kubernetes/portal/resources/config/log/filebeat/filebeat.yml index 89c6932577..b0d4690754 100644 --- a/kubernetes/portal/resources/config/log/filebeat/filebeat.yml +++ b/kubernetes/portal/resources/config/log/filebeat/filebeat.yml @@ -21,7 +21,7 @@ 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.{{.Values.nsPrefix}}:5044"] + hosts: ["{{.Values.config.logstashServiceName}}.{{.Release.Namespace}}:{{.Values.config.logstashPort}}"] #If enable will do load balancing among availabe Logstash, automatically. loadbalance: true diff --git a/kubernetes/portal/values.yaml b/kubernetes/portal/values.yaml index ed520d6cf6..89c2dbcd96 100644 --- a/kubernetes/portal/values.yaml +++ b/kubernetes/portal/values.yaml @@ -31,3 +31,6 @@ image: ubuntuInit: oomk8s/ubuntu-init:1.0.0 onapPortal: webappsDir: "/opt/apache-tomcat-8.0.37/webapps" +config: + logstashServiceName: log-ls + logstashPort: 5044 diff --git a/kubernetes/readiness/docker/init/Dockerfile b/kubernetes/readiness/docker/init/Dockerfile index 20f2268975..7214e04174 100644 --- a/kubernetes/readiness/docker/init/Dockerfile +++ b/kubernetes/readiness/docker/init/Dockerfile @@ -17,4 +17,8 @@ ENV TOKEN="/var/run/secrets/kubernetes.io/serviceaccount/token" COPY ready.py /root/ready.py RUN chmod a+x /root/ready.py + +COPY job_complete.py /root/job_complete.py +RUN chmod a+x /root/job_complete.py + ENTRYPOINT /root/ready.py diff --git a/kubernetes/readiness/docker/init/job_complete.py b/kubernetes/readiness/docker/init/job_complete.py new file mode 100644 index 0000000000..97d22da6c1 --- /dev/null +++ b/kubernetes/readiness/docker/init/job_complete.py @@ -0,0 +1,97 @@ +#!/usr/bin/python +import getopt +import logging +import os +import sys +import time + +from kubernetes import client + +# extract env variables. +namespace = os.environ['NAMESPACE'] +cert = os.environ['CERT'] +host = os.environ['KUBERNETES_SERVICE_HOST'] +token_path = os.environ['TOKEN'] + +with open(token_path, 'r') as token_file: + token = token_file.read().replace('\n', '') + +# setup logging +log = logging.getLogger(__name__) +handler = logging.StreamHandler(sys.stdout) +handler.setFormatter(logging.Formatter('%(asctime)s - %(levelname)s - %(message)s')) +handler.setLevel(logging.INFO) +log.addHandler(handler) +log.setLevel(logging.INFO) + +configuration = client.Configuration() +configuration.host = "https://" + host +configuration.ssl_ca_cert = cert +configuration.api_key['authorization'] = token +configuration.api_key_prefix['authorization'] = 'Bearer' +batchV1Api = client.BatchV1Api(client.ApiClient(configuration)) + + +def is_job_complete(job_name): + complete = False + log.info("Checking if " + job_name + " is complete") + response = "" + try: + response = batchV1Api.read_namespaced_job_status(job_name, namespace) + if response.status.succeeded == 1: + job_status_type = response.status.conditions[0].type + if job_status_type == "Complete": + complete = True + else: + log.info(job_name + " is not complete") + else: + log.info(job_name + " has not succeeded yet") + return complete + except Exception as e: + log.error("Exception when calling read_namespaced_job_status: %s\n" % e) + + +DEF_TIMEOUT = 10 +DESCRIPTION = "Kubernetes container job complete check utility" +USAGE = "Usage: job_complete.py [-t <timeout>] -j <job_name> [-j <job_name> ...]\n" \ + "where\n" \ + "<timeout> - wait for container job complete timeout in min, default is " + str(DEF_TIMEOUT) + "\n" \ + "<job_name> - name of the job to wait for\n" + +def main(argv): + # args are a list of job names + job_names = [] + timeout = DEF_TIMEOUT + try: + opts, args = getopt.getopt(argv, "hj:t:", ["job-name=", "timeout=", "help"]) + for opt, arg in opts: + if opt in ("-h", "--help"): + print("%s\n\n%s" % (DESCRIPTION, USAGE)) + sys.exit() + elif opt in ("-j", "--job-name"): + job_names.append(arg) + elif opt in ("-t", "--timeout"): + timeout = float(arg) + except (getopt.GetoptError, ValueError) as e: + print("Error parsing input parameters: %s\n" % e) + print(USAGE) + sys.exit(2) + if job_names.__len__() == 0: + print("Missing required input parameter(s)\n") + print(USAGE) + sys.exit(2) + + for job_name in job_names: + timeout = time.time() + timeout * 60 + while True: + complete = is_job_complete(job_name) + if complete is True: + break + elif time.time() > timeout: + log.warning("timed out waiting for '" + job_name + "' to be completed") + exit(1) + else: + time.sleep(5) + +if __name__ == "__main__": + main(sys.argv[1:])
\ No newline at end of file diff --git a/kubernetes/robot/resources/config/eteshare/config/vm_properties.py b/kubernetes/robot/resources/config/eteshare/config/vm_properties.py index 41db84d2b9..cd1ce14dc8 100755 --- a/kubernetes/robot/resources/config/eteshare/config/vm_properties.py +++ b/kubernetes/robot/resources/config/eteshare/config/vm_properties.py @@ -1,4 +1,4 @@ -# File generated from /opt/config +#file generated from /opt/config # GLOBAL_INJECTED_AAI1_IP_ADDR = "{{.Release.Name}}-aai.{{include "common.namespace" .}}" GLOBAL_INJECTED_AAI2_IP_ADDR = "N/A" @@ -38,6 +38,7 @@ GLOBAL_INJECTED_VID_IP_ADDR = "{{.Release.Name}}-vid-server.{{include "common.na GLOBAL_INJECTED_VM_FLAVOR = "{{ .Values.openStackFlavourMedium }}" GLOBAL_INJECTED_VM_IMAGE_NAME = "{{ .Values.ubuntuImage }}" GLOBAL_INJECTED_PUBLIC_NET_ID = "{{ .Values.openStackPublicNetId }}" +GLOBAL_INJECTED_SCRIPT_VERSION = "{{ .Values.scriptVersion }}" GLOBAL_INJECTED_PROPERTIES = { "GLOBAL_INJECTED_AAI1_IP_ADDR" : "{{.Release.Name}}-aai.{{include "common.namespace" .}}", "GLOBAL_INJECTED_APPC_IP_ADDR" : "{{.Release.Name}}-appc-sdnhost.{{include "common.namespace" .}}", @@ -73,5 +74,6 @@ GLOBAL_INJECTED_PROPERTIES = { "GLOBAL_INJECTED_VID_IP_ADDR" : "{{.Release.Name}}-vid-server.{{include "common.namespace" .}}", "GLOBAL_INJECTED_VM_FLAVOR" : "{{ .Values.openStackFlavourMedium }}", "GLOBAL_INJECTED_VM_IMAGE_NAME" : "{{ .Values.ubuntuImage }}", - "GLOBAL_INJECTED_PUBLIC_NET_ID" : "{{ .Values.openStackPublicNetId }}" + "GLOBAL_INJECTED_PUBLIC_NET_ID" : "{{ .Values.openStackPublicNetId }}", + "GLOBAL_INJECTED_SCRIPT_VERSION" : "{{ .Values.scriptVersion }}" } diff --git a/kubernetes/robot/values.yaml b/kubernetes/robot/values.yaml index 9057a86aff..6ef3a21d89 100644 --- a/kubernetes/robot/values.yaml +++ b/kubernetes/robot/values.yaml @@ -46,6 +46,7 @@ openStackPrivateSubnetId: "e8f51956-00dd-4425-af36-045716781ffc" openStackTenantId: "47899782ed714295b1151681fdfd51f5" openStackUserName: "vnf_user" ubuntuImage: "Ubuntu_14.04.5_LTS" +scriptVersion: "1.1.1" # default number of instances robotReplicas: 1 diff --git a/kubernetes/sdc/resources/config/log/filebeat/filebeat.yml b/kubernetes/sdc/resources/config/log/filebeat/filebeat.yml index 89c6932577..b0d4690754 100644 --- a/kubernetes/sdc/resources/config/log/filebeat/filebeat.yml +++ b/kubernetes/sdc/resources/config/log/filebeat/filebeat.yml @@ -21,7 +21,7 @@ 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.{{.Values.nsPrefix}}:5044"] + hosts: ["{{.Values.config.logstashServiceName}}.{{.Release.Namespace}}:{{.Values.config.logstashPort}}"] #If enable will do load balancing among availabe Logstash, automatically. loadbalance: true diff --git a/kubernetes/sdc/values.yaml b/kubernetes/sdc/values.yaml index 13f41aa0ea..40b3ec3f23 100644 --- a/kubernetes/sdc/values.yaml +++ b/kubernetes/sdc/values.yaml @@ -25,3 +25,6 @@ image: sdcBackend: nexus3.onap.org:10001/openecomp/sdc-backend:v1.1.0 filebeat: docker.elastic.co/beats/filebeat:5.5.0 ubuntuInit: oomk8s/ubuntu-init:1.0.0 +config: + logstashServiceName: log-ls + logstashPort: 5044 diff --git a/kubernetes/sdnc/resources/config/log/filebeat/log4j/filebeat.yml b/kubernetes/sdnc/resources/config/log/filebeat/log4j/filebeat.yml index 2cd63e1d98..49d818a807 100644 --- a/kubernetes/sdnc/resources/config/log/filebeat/log4j/filebeat.yml +++ b/kubernetes/sdnc/resources/config/log/filebeat/log4j/filebeat.yml @@ -29,7 +29,7 @@ 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.{{.Values.nsPrefix}}:5044"] + hosts: ["{{.Values.config.logstashServiceName}}.{{.Release.Namespace}}:{{.Values.config.logstashPort}}"] #If enable will do load balancing among availabe Logstash, automatically. loadbalance: true diff --git a/kubernetes/sdnc/values.yaml b/kubernetes/sdnc/values.yaml index 9c706b8310..94029179db 100644 --- a/kubernetes/sdnc/values.yaml +++ b/kubernetes/sdnc/values.yaml @@ -37,4 +37,6 @@ portalReplicas: 1 disableSdncSdncDgbuilder: false disableSdncSdncPortal: false disableNfsProvisioner: false - +config: + logstashServiceName: log-ls + logstashPort: 5044 diff --git a/kubernetes/so/resources/config/log/filebeat/filebeat.yml b/kubernetes/so/resources/config/log/filebeat/filebeat.yml index 9ad559c027..b0d4690754 100644 --- a/kubernetes/so/resources/config/log/filebeat/filebeat.yml +++ b/kubernetes/so/resources/config/log/filebeat/filebeat.yml @@ -21,7 +21,7 @@ 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"] + hosts: ["{{.Values.config.logstashServiceName}}.{{.Release.Namespace}}:{{.Values.config.logstashPort}}"] #If enable will do load balancing among availabe Logstash, automatically. loadbalance: true diff --git a/kubernetes/so/values.yaml b/kubernetes/so/values.yaml index d62465d665..3ca60b0395 100644 --- a/kubernetes/so/values.yaml +++ b/kubernetes/so/values.yaml @@ -44,7 +44,8 @@ config: openStackKeyStoneUrl: "http://1.2.3.4:5000" openStackServiceTenantName: "service" openStackEncryptedPasswordHere: "c124921a3a0efbe579782cde8227681e" - + logstashServiceName: log-ls + logstashPort: 5044 # default number of instances replicaCount: 1 diff --git a/kubernetes/vid/.helmignore b/kubernetes/vid/.helmignore new file mode 100644 index 0000000000..f0c1319444 --- /dev/null +++ b/kubernetes/vid/.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/vid/Chart.yaml b/kubernetes/vid/Chart.yaml index 9c924bbc81..4df4dae10c 100644 --- a/kubernetes/vid/Chart.yaml +++ b/kubernetes/vid/Chart.yaml @@ -13,6 +13,6 @@ # limitations under the License. apiVersion: v1 -description: A Helm chart for Kubernetes +description: ONAP Virtual Infrastructure Deployment name: vid -version: 0.1.0 +version: 2.0.0 diff --git a/kubernetes/vid/charts/mariadb/.helmignore b/kubernetes/vid/charts/mariadb/.helmignore new file mode 100644 index 0000000000..f0c1319444 --- /dev/null +++ b/kubernetes/vid/charts/mariadb/.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/dcae/Chart.yaml b/kubernetes/vid/charts/mariadb/Chart.yaml index d4e06cadd1..1f7de32fdf 100644 --- a/kubernetes/dcae/Chart.yaml +++ b/kubernetes/vid/charts/mariadb/Chart.yaml @@ -13,6 +13,6 @@ # limitations under the License. apiVersion: v1 -description: DCAE Gen 1 -name: DCAE -version: 1.1.0 +description: VID MariaDB Service +name: mariadb +version: 2.0.0 diff --git a/kubernetes/vid/resources/config/lf_config/vid-my.cnf b/kubernetes/vid/charts/mariadb/resources/config/lf_config/vid-my.cnf index 472bf4698e..472bf4698e 100755..100644 --- a/kubernetes/vid/resources/config/lf_config/vid-my.cnf +++ b/kubernetes/vid/charts/mariadb/resources/config/lf_config/vid-my.cnf diff --git a/kubernetes/vid/resources/config/lf_config/vid-pre-init.sql b/kubernetes/vid/charts/mariadb/resources/config/lf_config/vid-pre-init.sql index 57b797d03c..57b797d03c 100755..100644 --- a/kubernetes/vid/resources/config/lf_config/vid-pre-init.sql +++ b/kubernetes/vid/charts/mariadb/resources/config/lf_config/vid-pre-init.sql diff --git a/kubernetes/vid/charts/mariadb/templates/NOTES.txt b/kubernetes/vid/charts/mariadb/templates/NOTES.txt new file mode 100644 index 0000000000..75f0a7a6b3 --- /dev/null +++ b/kubernetes/vid/charts/mariadb/templates/NOTES.txt @@ -0,0 +1,11 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range .Values.ingress.hosts }} + http://{{ . }} +{{- end }} + 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/vid/templates/vid-lfconfig-configmap.yaml b/kubernetes/vid/charts/mariadb/templates/configmap.yaml index 2809705de9..8a35df3f30 100644 --- a/kubernetes/vid/templates/vid-lfconfig-configmap.yaml +++ b/kubernetes/vid/charts/mariadb/templates/configmap.yaml @@ -12,12 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -#{{ if not .Values.disableVidVidMariadb }} apiVersion: v1 kind: ConfigMap metadata: - name: vid-lfconfig-configmap - namespace: {{ .Values.nsPrefix }} + name: {{ include "common.fullname" . }}-lfconfig + namespace: {{ include "common.namespace" . }} data: {{ tpl (.Files.Glob "resources/config/lf_config/*").AsConfig . | indent 2 }} -#{{ end }} diff --git a/kubernetes/vid/charts/mariadb/templates/deployment.yaml b/kubernetes/vid/charts/mariadb/templates/deployment.yaml new file mode 100644 index 0000000000..cafab0c17e --- /dev/null +++ b/kubernetes/vid/charts/mariadb/templates/deployment.yaml @@ -0,0 +1,109 @@ +# 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 }} + {{- 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: MYSQL_DATABASE + value: "{{ .Values.config.mysqldb }}" + - name: MYSQL_USER + value: "{{ .Values.config.mysqluser }}" + - name: MYSQL_PASSWORD + valueFrom: + secretKeyRef: + name: {{ template "common.fullname" . }} + key: db-password + - name: MYSQL_ROOT_PASSWORD + valueFrom: + secretKeyRef: + name: {{ template "common.fullname" . }} + key: db-root-password + volumeMounts: + - mountPath: /etc/localtime + name: localtime + readOnly: true + - mountPath: /var/lib/mysql + name: mariadb-data + - mountPath: /docker-entrypoint-initdb.d/vid-pre-init.sql + name: lfconfig + subPath: vid-pre-init.sql + - mountPath: /etc/mysql/my.cnf + name: lfconfig + subPath: my.cnf + 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: mariadb-data + {{- if .Values.persistence.enabled }} + persistentVolumeClaim: + claimName: {{ include "common.fullname" . }} + {{- else }} + emptyDir: {} + {{- end }} + - name: localtime + hostPath: + path: /etc/localtime + - name: lfconfig + configMap: + name: {{ include "common.fullname" . }}-lfconfig + defaultMode: 0755 + items: + - key: vid-my.cnf + path: my.cnf + - key: vid-pre-init.sql + path: vid-pre-init.sql + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/kubernetes/vid/charts/mariadb/templates/pv.yaml b/kubernetes/vid/charts/mariadb/templates/pv.yaml new file mode 100644 index 0000000000..184728f8ad --- /dev/null +++ b/kubernetes/vid/charts/mariadb/templates/pv.yaml @@ -0,0 +1,37 @@ +{{/* +# 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 and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}} +kind: PersistentVolume +apiVersion: v1 +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 }}" + name: {{ include "common.fullname" . }} +spec: + capacity: + storage: {{ .Values.persistence.size}} + accessModes: + - {{ .Values.persistence.accessMode }} + persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }} + hostPath: + path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }} +{{- end -}} diff --git a/kubernetes/vid/charts/mariadb/templates/pvc.yaml b/kubernetes/vid/charts/mariadb/templates/pvc.yaml new file mode 100644 index 0000000000..e27c3311e9 --- /dev/null +++ b/kubernetes/vid/charts/mariadb/templates/pvc.yaml @@ -0,0 +1,48 @@ +{{/* +# 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 and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}} +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: {{ include "common.fullname" . }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +{{- if .Values.persistence.annotations }} + annotations: +{{ toYaml .Values.persistence.annotations | indent 4 }} +{{- end }} +spec: + selector: + matchLabels: + name: {{ include "common.fullname" . }} + accessModes: + - {{ .Values.persistence.accessMode }} + resources: + requests: + storage: {{ .Values.persistence.size }} +{{- if .Values.persistence.storageClass }} +{{- if (eq "-" .Values.persistence.storageClass) }} + storageClassName: "" +{{- else }} + storageClassName: "{{ .Values.persistence.storageClass }}" +{{- end }} +{{- end }} +{{- end -}} diff --git a/kubernetes/vid/charts/mariadb/templates/secrets.yaml b/kubernetes/vid/charts/mariadb/templates/secrets.yaml new file mode 100644 index 0000000000..36096925f5 --- /dev/null +++ b/kubernetes/vid/charts/mariadb/templates/secrets.yaml @@ -0,0 +1,28 @@ +# 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: Secret +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 }} +type: Opaque +data: + db-root-password: {{ .Values.config.mariadbRootPassword | b64enc | quote }} + db-password: {{ .Values.config.mariadbPassword | b64enc | quote }} diff --git a/kubernetes/vid/templates/all-services.yaml b/kubernetes/vid/charts/mariadb/templates/service.yaml index a946a2ab54..88ed09bb45 100644 --- a/kubernetes/vid/templates/all-services.yaml +++ b/kubernetes/vid/charts/mariadb/templates/service.yaml @@ -12,35 +12,20 @@ # See the License for the specific language governing permissions and # limitations under the License. -#{{ if not .Values.disableVidVidMariadb }} -apiVersion: v1 -kind: Service -metadata: - name: vid-mariadb - namespace: "{{ .Values.nsPrefix }}" -spec: - ports: - - name: vid-mariadb - port: 3306 - selector: - app: vid-mariadb - clusterIP: None -#{{ end }} -#{{ if not .Values.disableVidVidServer }} ---- apiVersion: v1 kind: Service metadata: + name: {{ include "common.fullname" . }} + namespace: {{ include "common.namespace" . }} labels: - app: vid-server - name: vid-server - namespace: "{{ .Values.nsPrefix }}" + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} spec: ports: - - name: vid-server - nodePort: {{ .Values.nodePortPrefix }}00 - port: 8080 + - port: {{ .Values.service.internalPort }} + name: {{ .Values.service.name }} selector: - app: vid-server - type: NodePort -#{{ end }}
\ No newline at end of file + app: {{ include "common.name" . }} + release: {{ .Release.Name }} diff --git a/kubernetes/vid/charts/mariadb/values.yaml b/kubernetes/vid/charts/mariadb/values.yaml new file mode 100644 index 0000000000..567109c6d4 --- /dev/null +++ b/kubernetes/vid/charts/mariadb/values.yaml @@ -0,0 +1,102 @@ +# 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. + +# Default values for mariadb. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. +global: # global defaults + nodePortPrefix: 302 + repositorySecret: eyJuZXh1czMub25hcC5vcmc6MTAwMDEiOnsidXNlcm5hbWUiOiJkb2NrZXIiLCJwYXNzd29yZCI6ImRvY2tlciIsImVtYWlsIjoiQCIsImF1dGgiOiJaRzlqYTJWeU9tUnZZMnRsY2c9PSJ9fQ== + persistence: {} + + +# application image +repository: nexus3.onap.org:10001 +image: library/mariadb:10 +pullPolicy: Always + +# application configuration +config: + mysqldb: vid_openecomp_epsdk + mysqluser: vidadmin + mariadbRootPassword: LF+tp_1WqgSY + mariadbPassword: Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U + +# 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 + +## Persist data to a persitent volume +persistence: + enabled: true + + ## A manually managed Persistent Volume and Claim + ## Requires persistence.enabled: true + ## If defined, PVC must be created manually before volume will be bound + # existingClaim: + volumeReclaimPolicy: Retain + + ## database data Persistent Volume Storage Class + ## If defined, storageClassName: <storageClass> + ## If set to "-", storageClassName: "", which disables dynamic provisioning + ## If undefined (the default) or set to null, no storageClassName spec is + ## set, choosing the default provisioner. (gp2 on AWS, standard on + ## GKE, AWS & OpenStack) + ## + # storageClass: "-" + accessMode: ReadWriteMany + size: 2Gi + mountPath: /dockerdata-nfs + mountSubPath: vid/mariadb/data + +service: + name: mariadb + internalPort: 3306 + +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/vid/requirements.yaml b/kubernetes/vid/requirements.yaml new file mode 100644 index 0000000000..f639633537 --- /dev/null +++ b/kubernetes/vid/requirements.yaml @@ -0,0 +1,21 @@ +# 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. + +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/vid/resources/config/log/filebeat/filebeat.yml b/kubernetes/vid/resources/config/log/filebeat/filebeat.yml index 89c6932577..b0d4690754 100644 --- a/kubernetes/vid/resources/config/log/filebeat/filebeat.yml +++ b/kubernetes/vid/resources/config/log/filebeat/filebeat.yml @@ -21,7 +21,7 @@ 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.{{.Values.nsPrefix}}:5044"] + hosts: ["{{.Values.config.logstashServiceName}}.{{.Release.Namespace}}:{{.Values.config.logstashPort}}"] #If enable will do load balancing among availabe Logstash, automatically. loadbalance: true diff --git a/kubernetes/vid/templates/NOTES.txt b/kubernetes/vid/templates/NOTES.txt new file mode 100644 index 0000000000..6e0b9fc06d --- /dev/null +++ b/kubernetes/vid/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 {{ 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 +{{- 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.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 }} +{{- else if contains "ClusterIP" .Values.service.type }} + 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/vid/templates/vid-log-configmap.yaml b/kubernetes/vid/templates/configmap.yaml index 3a72866e0d..f7dbf07645 100644 --- a/kubernetes/vid/templates/vid-log-configmap.yaml +++ b/kubernetes/vid/templates/configmap.yaml @@ -12,20 +12,18 @@ # See the License for the specific language governing permissions and # limitations under the License. -#{{ if not .Values.disableVidVidServer }} apiVersion: v1 kind: ConfigMap metadata: - name: vid-log-configmap - namespace: {{ .Values.nsPrefix }} + name: {{ include "common.fullname" . }}-log-configmap + namespace: {{ include "common.namespace" . }} data: {{ tpl (.Files.Glob "resources/config/log/vid/*").AsConfig . | indent 2 }} --- apiVersion: v1 kind: ConfigMap metadata: - name: vid-filebeat-configmap - namespace: {{ .Values.nsPrefix }} + name: {{ include "common.fullname" . }}-filebeat-configmap + namespace: {{ include "common.namespace" . }} data: {{ tpl (.Files.Glob "resources/config/log/filebeat/*").AsConfig . | indent 2 }} -#{{ end }} diff --git a/kubernetes/vid/templates/deployment.yaml b/kubernetes/vid/templates/deployment.yaml new file mode 100644 index 0000000000..89ed734dfb --- /dev/null +++ b/kubernetes/vid/templates/deployment.yaml @@ -0,0 +1,162 @@ +# 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: + initContainers: + - command: + - /root/ready.py + args: + - --container-name + - {{ .Values.mariadb.nameOverride }} + env: + - name: NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + name: {{ include "common.name" . }}-readiness + containers: + - name: {{ include "common.name" . }} + image: "{{ .Values.global.repository | default .Values.repository }}/{{ .Values.image }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + lifecycle: + postStart: + exec: + command: ["/bin/sh", "-c", "export LOG=wait_logback.log; touch $LOG; export SRC=/tmp/logback.xml; export DST=/usr/local/tomcat/webapps/vid/WEB-INF/classes/; while [ ! -e $DST ]; do echo 'Waiting for $DST...' >> $LOG; sleep 5; done; sleep 2; /bin/cp -f $SRC $DST; echo 'Done' >> $LOG"] + 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: ASDC_CLIENT_REST_HOST + value: sdc-be.{{ include "common.namespace" . }}-sdc + - name: ASDC_CLIENT_REST_AUTH + value: "{{ .Values.config.asdcclientrestauth }}" + - name: ASDC_CLIENT_REST_PORT + value: "{{ .Values.config.asdcclientrestport }}" + - name: VID_AAI_HOST + value: aai-service.{{ include "common.namespace" . }}-aai + - name: VID_AAI_PORT + value: "{{ .Values.config.vidaaiport }}" + - name: VID_ECOMP_SHARED_CONTEXT_REST_URL + value: http://portalapps.{{ include "common.namespace" . }}-portal:"{{ .Values.config.onapport }}"/ONAPPORTAL/context + - name: VID_MSO_SERVER_URL + value: http://mso.{{ include "common.namespace" . }}-mso:"{{ .Values.config.msoport }}" + - name: VID_MSO_PASS + value: "{{ .Values.config.vidmsopass }}" + - name: MSO_DME2_SERVER_URL + value: "{{ .Values.config.msodme2serverurl }}" + - name: MSO_DME2_ENABLED + value: {{ .Values.global.debugEnabled | default .Values.debugEnabled | quote }} + - name: VID_ECOMP_REDIRECT_URL + value: http://portalapps.{{ include "common.namespace" . }}-portal:"{{ .Values.config.onapport }}"/ONAPPORTAL/login.h\tm + - name: VID_ECOMP_REST_URL + value: http://portalapps.{{ include "common.namespace" . }}-portal:"{{ .Values.config.onapport }}"/ONAPPORTAL/auxapi + - name: VID_CONTACT_US_LINK + value: "{{ .Values.config.vidcontactuslink }}" + - name: VID_UEB_URL_LIST + value: dmaap.{{ include "common.namespace" . }}-message-router + - name: VID_MYSQL_HOST + value: "{{ .Values.config.vidmysqlhost }}" + - name: VID_MYSQL_PORT + value: "{{ .Values.config.vidmysqlport }}" + - name: VID_MYSQL_DBNAME + value: "{{ .Values.config.vidmysqldbname }}" + - name: VID_MYSQL_USER + value: "{{ .Values.config.vidmysqluser }}" + - name: VID_MYSQL_PASS + valueFrom: + secretKeyRef: + name: {{ template "common.fullname" . }} + key: vid-password + - name: VID_MYSQL_MAXCONNECTIONS + value: "{{ .Values.config.vidmysqlmaxconnections }}" + volumeMounts: + - mountPath: /etc/localtime + name: localtime + readOnly: true + - mountPath: /var/log/onap + name: vid-logs + - mountPath: /tmp/logback.xml + name: vid-logback + 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 }} + # 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: /var/log/onap + name: vid-logs + - mountPath: /usr/share/filebeat/data + name: vid-data-filebeat + volumes: + - name: localtime + hostPath: + path: /etc/localtime + - name: filebeat-conf + configMap: + name: {{ include "common.fullname" . }}-filebeat-configmap + - name: vid-logs + emptyDir: {} + - name: vid-data-filebeat + emptyDir: {} + - name: vid-logback + configMap: + name: {{ include "common.fullname" . }}-log-configmap + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/kubernetes/aai/templates/aai-filebeat-configmap.yaml b/kubernetes/vid/templates/secrets.yaml index 74039e8592..729e0b17c0 100644 --- a/kubernetes/aai/templates/aai-filebeat-configmap.yaml +++ b/kubernetes/vid/templates/secrets.yaml @@ -12,12 +12,16 @@ # See the License for the specific language governing permissions and # limitations under the License. -#{{ if not .Values.disableAaiAaiResources }} apiVersion: v1 -kind: ConfigMap +kind: Secret metadata: - name: aai-filebeat-configmap - namespace: {{ .Values.nsPrefix }} + 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 }} +type: Opaque data: -{{ tpl (.Files.Glob "resources/config/log/filebeat/*").AsConfig . | indent 2 }} -#{{ end }} + vid-password: {{ .Values.config.vidmysqlpassword | b64enc | quote }} diff --git a/kubernetes/vid/templates/service.yaml b/kubernetes/vid/templates/service.yaml new file mode 100644 index 0000000000..3969d2184b --- /dev/null +++ b/kubernetes/vid/templates/service.yaml @@ -0,0 +1,39 @@ +# 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: {{ 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/vid/templates/vid-mariadb-deployment.yaml b/kubernetes/vid/templates/vid-mariadb-deployment.yaml deleted file mode 100644 index 4eb46c2c02..0000000000 --- a/kubernetes/vid/templates/vid-mariadb-deployment.yaml +++ /dev/null @@ -1,84 +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.disableVidVidMariadb }} -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - labels: - app: vid-mariadb - name: vid-mariadb - namespace: "{{ .Values.nsPrefix }}" -spec: - replicas: {{ .Values.vidMariaDbReplicas }} - selector: - matchLabels: - app: vid-mariadb - template: - metadata: - labels: - app: vid-mariadb - name: vid-mariadb - spec: - containers: - - image: {{ .Values.image.mariadb }} - imagePullPolicy: {{ .Values.pullPolicy }} - name: vid-mariadb - env: - - name: MYSQL_DATABASE - value: vid_openecomp_epsdk - - name: MYSQL_USER - value: vidadmin - - name: MYSQL_PASSWORD - value: Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U - - name: MYSQL_ROOT_PASSWORD - value: LF+tp_1WqgSY - volumeMounts: - - mountPath: /etc/localtime - name: localtime - readOnly: true - - mountPath: /var/lib/mysql - name: vid-mariadb-data - - mountPath: /docker-entrypoint-initdb.d/vid-pre-init.sql - name: vid-lfconfig - subPath: vid-pre-init.sql - - mountPath: /etc/mysql/my.cnf - name: vid-lfconfig - subPath: my.cnf - ports: - - containerPort: 3306 - readinessProbe: - tcpSocket: - port: 3306 - initialDelaySeconds: 5 - periodSeconds: 10 - volumes: - - name: localtime - hostPath: - path: /etc/localtime - - name: vid-mariadb-data - persistentVolumeClaim: - claimName: vid-db - - name: vid-lfconfig - configMap: - name: vid-lfconfig-configmap - defaultMode: 0755 - items: - - key: vid-my.cnf - path: my.cnf - - key: vid-pre-init.sql - path: vid-pre-init.sql - imagePullSecrets: - - name: "{{ .Values.nsPrefix }}-docker-registry-key" -#{{ end }} diff --git a/kubernetes/vid/templates/vid-pv-pvc.yaml b/kubernetes/vid/templates/vid-pv-pvc.yaml deleted file mode 100644 index 4d8db678e9..0000000000 --- a/kubernetes/vid/templates/vid-pv-pvc.yaml +++ /dev/null @@ -1,48 +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.disableVidVidMariadb }} -apiVersion: v1 -kind: PersistentVolume -metadata: - name: "{{ .Values.nsPrefix }}-vid" - namespace: "{{ .Values.nsPrefix }}" - labels: - name: "{{ .Values.nsPrefix }}-vid" -spec: - capacity: - storage: 2Gi - accessModes: - - ReadWriteMany - persistentVolumeReclaimPolicy: Retain - hostPath: - path: {{ .Values.dataRootDir }}/{{ .Values.nsPrefix }}/vid/mariadb/data ---- -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: vid-db - namespace: "{{ .Values.nsPrefix }}" -spec: - accessModes: - - ReadWriteMany - resources: - requests: - storage: 2Gi - selector: - matchLabels: - name: "{{ .Values.nsPrefix }}-vid" -#{{ end }} diff --git a/kubernetes/vid/templates/vid-server-deployment.yaml b/kubernetes/vid/templates/vid-server-deployment.yaml deleted file mode 100644 index 7903fb02b1..0000000000 --- a/kubernetes/vid/templates/vid-server-deployment.yaml +++ /dev/null @@ -1,141 +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.disableVidVidServer }} -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - labels: - app: vid-server - name: vid-server - namespace: "{{ .Values.nsPrefix }}" -spec: - replicas: {{ .Values.vidServerReplicas }} - selector: - matchLabels: - app: vid-server - template: - metadata: - labels: - app: vid-server - name: vid-server - spec: - initContainers: - - command: - - /root/ready.py - args: - - --container-name - - vid-mariadb - env: - - name: NAMESPACE - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: metadata.namespace - image: {{ .Values.image.readiness }} - imagePullPolicy: {{ .Values.pullPolicy }} - name: vid-server-readiness - containers: - - env: - - name: ASDC_CLIENT_REST_HOST - value: sdc-be.{{ .Values.nsPrefix }} - - name: ASDC_CLIENT_REST_AUTH - value: Basic dmlkOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU= - - name: ASDC_CLIENT_REST_PORT - value: "8080" - - name: VID_AAI_HOST - value: aai-service.{{ .Values.nsPrefix }} - - name: VID_AAI_PORT - value: "8443" - - name: VID_ECOMP_SHARED_CONTEXT_REST_URL - value: http://portalapps.{{ .Values.nsPrefix }}:8989/ONAPPORTAL/context - - name: VID_MSO_SERVER_URL - value: http://mso.{{ .Values.nsPrefix }}:8080 - - name: VID_MSO_PASS - value: OBF:1ih71i271vny1yf41ymf1ylz1yf21vn41hzj1icz - - name: MSO_DME2_SERVER_URL - value: http://localhost:8081 - - name: MSO_DME2_ENABLED - value: "false" - - name: VID_ECOMP_REDIRECT_URL - value: http://portalapps.{{ .Values.nsPrefix }}:8989/ONAPPORTAL/login.htm - - name: VID_ECOMP_REST_URL - value: http://portalapps.{{ .Values.nsPrefix }}:8989/ONAPPORTAL/auxapi - - name: VID_CONTACT_US_LINK - value: https://todo_contact_us_link.com - - name: VID_UEB_URL_LIST - value: dmaap.{{ .Values.nsPrefix }} - - name: VID_MYSQL_HOST - value: vid-mariadb - - name: VID_MYSQL_PORT - value: "3306" - - name: VID_MYSQL_DBNAME - value: vid_openecomp_epsdk - - name: VID_MYSQL_USER - value: vidadmin - - name: VID_MYSQL_PASS - value: Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U - - name: VID_MYSQL_MAXCONNECTIONS - value: "5" - image: {{ .Values.image.vid }} - imagePullPolicy: {{ .Values.pullPolicy }} - name: vid-server - lifecycle: - postStart: - exec: - command: ["/bin/sh", "-c", "export LOG=wait_logback.log; touch $LOG; export SRC=/tmp/logback.xml; export DST=/usr/local/tomcat/webapps/vid/WEB-INF/classes/; while [ ! -e $DST ]; do echo 'Waiting for $DST...' >> $LOG; sleep 5; done; sleep 2; /bin/cp -f $SRC $DST; echo 'Done' >> $LOG"] - ports: - - containerPort: 8080 - volumeMounts: - - mountPath: /etc/localtime - name: localtime - readOnly: true - - mountPath: /var/log/onap - name: vid-logs - - mountPath: /tmp/logback.xml - name: vid-logback - subPath: logback.xml - readinessProbe: - tcpSocket: - port: 8080 - initialDelaySeconds: 5 - periodSeconds: 10 - - image: {{ .Values.image.filebeat }} - imagePullPolicy: {{ .Values.pullPolicy }} - name: filebeat-onap - volumeMounts: - - mountPath: /usr/share/filebeat/filebeat.yml - name: filebeat-conf - subPath: filebeat.yml - - mountPath: /var/log/onap - name: vid-logs - - mountPath: /usr/share/filebeat/data - name: vid-data-filebeat - volumes: - - name: localtime - hostPath: - path: /etc/localtime - - name: filebeat-conf - configMap: - name: vid-filebeat-configmap - - name: vid-logs - emptyDir: {} - - name: vid-data-filebeat - emptyDir: {} - - name: vid-logback - configMap: - name: vid-log-configmap - imagePullSecrets: - - name: "{{ .Values.nsPrefix }}-docker-registry-key" -#{{ end }} diff --git a/kubernetes/vid/values.yaml b/kubernetes/vid/values.yaml index 258177b079..b42bceb093 100644 --- a/kubernetes/vid/values.yaml +++ b/kubernetes/vid/values.yaml @@ -12,14 +12,96 @@ # See the License for the specific language governing permissions and # limitations under the License. -nsPrefix: onap +# Default values for vid. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. +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: openecomp/vid:v1.1.1 pullPolicy: Always -nodePortPrefix: 302 -dataRootDir: /dockerdata-nfs -vidMariaDbReplicas: 1 -vidServerReplicas: 1 -image: - readiness: oomk8s/readiness-check:1.1.0 - mariadb: nexus3.onap.org:10001/library/mariadb:10 - vid: nexus3.onap.org:10001/openecomp/vid:v1.1.1 - filebeat: docker.elastic.co/beats/filebeat:5.5.0 + +# flag to enable debugging - application support required +debugEnabled: false + +# application configuration +config: + vidmysqlpassword: Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U + asdcclientrestauth: "Basic dmlkOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU=" + asdcclientrestport: "8080" + vidaaiport: "8443" + onapport: "8989" + msoport: "8080" + vidmsopass: OBF:1ih71i271vny1yf41ymf1ylz1yf21vn41hzj1icz + msodme2serverurl: http://localhost:8081 + vidcontactuslink: https://todo_contact_us_link.com + vidmysqlhost: vid-mariadb + vidmysqlport: "3306" + vidmysqldbname: vid_openecomp_epsdk + vidmysqluser: vidadmin + vidmysqlmaxconnections: "5" + logstashServiceName: log-ls + logstashPort: 5044 + + +# subchart configuration +mariadb: + nameOverride: vid-db + +# 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: vid + externalPort: "00" + nodePort: "00" + 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 |