From ad6382f57e802ced0892ea103bf880e11050590b Mon Sep 17 00:00:00 2001 From: pramod Date: Wed, 28 Mar 2018 22:32:00 +0000 Subject: Message Router Helm Chart Standardization Issue-ID: OOM-731 Change-Id: I2137b9dbe7c7a320094c13779e8e43dadef964c7 Signed-off-by: pramod Signed-off-by: Mike Elliott --- kubernetes/message-router/.helmignore | 21 ++++ kubernetes/message-router/Chart.yaml | 5 +- kubernetes/message-router/charts/kafka/.helmignore | 21 ++++ kubernetes/message-router/charts/kafka/Chart.yaml | 19 ++++ .../charts/kafka/templates/NOTES.txt | 19 ++++ .../charts/kafka/templates/deployment.yaml | 109 +++++++++++++++++++ .../message-router/charts/kafka/templates/pv.yaml | 37 +++++++ .../message-router/charts/kafka/templates/pvc.yaml | 48 +++++++++ .../charts/kafka/templates/service.yaml | 32 ++++++ kubernetes/message-router/charts/kafka/values.yaml | 115 +++++++++++++++++++++ .../message-router/charts/zookeeper/.helmignore | 21 ++++ .../message-router/charts/zookeeper/Chart.yaml | 19 ++++ .../charts/zookeeper/templates/NOTES.txt | 19 ++++ .../charts/zookeeper/templates/deployment.yaml | 79 ++++++++++++++ .../charts/zookeeper/templates/pv.yaml | 37 +++++++ .../charts/zookeeper/templates/pvc.yaml | 48 +++++++++ .../charts/zookeeper/templates/service.yaml | 32 ++++++ .../message-router/charts/zookeeper/values.yaml | 110 ++++++++++++++++++++ kubernetes/message-router/requirements.yaml | 22 ++++ .../resources/config/dmaap/MsgRtrApi.properties | 25 +++-- .../resources/config/dmaap/cadi.properties | 14 +++ kubernetes/message-router/templates/NOTES.txt | 19 ++++ .../message-router/templates/all-services.yaml | 80 -------------- kubernetes/message-router/templates/configmap.yaml | 15 +++ .../message-router/templates/deployment.yaml | 95 +++++++++++++++++ .../message-router/templates/dmaap-configmap.yaml | 23 ----- .../templates/message-router-dmaap.yaml | 91 ---------------- .../templates/message-router-kafka.yaml | 102 ------------------ .../templates/message-router-pv-pvc.yaml | 81 --------------- .../templates/message-router-zookeeper.yaml | 72 ------------- kubernetes/message-router/templates/secrets.yaml | 27 +++++ kubernetes/message-router/templates/service.yaml | 54 ++++++++++ kubernetes/message-router/values.yaml | 92 ++++++++++++++--- 33 files changed, 1134 insertions(+), 469 deletions(-) create mode 100644 kubernetes/message-router/.helmignore create mode 100644 kubernetes/message-router/charts/kafka/.helmignore create mode 100644 kubernetes/message-router/charts/kafka/Chart.yaml create mode 100644 kubernetes/message-router/charts/kafka/templates/NOTES.txt create mode 100644 kubernetes/message-router/charts/kafka/templates/deployment.yaml create mode 100644 kubernetes/message-router/charts/kafka/templates/pv.yaml create mode 100644 kubernetes/message-router/charts/kafka/templates/pvc.yaml create mode 100644 kubernetes/message-router/charts/kafka/templates/service.yaml create mode 100644 kubernetes/message-router/charts/kafka/values.yaml create mode 100644 kubernetes/message-router/charts/zookeeper/.helmignore create mode 100644 kubernetes/message-router/charts/zookeeper/Chart.yaml create mode 100644 kubernetes/message-router/charts/zookeeper/templates/NOTES.txt create mode 100644 kubernetes/message-router/charts/zookeeper/templates/deployment.yaml create mode 100644 kubernetes/message-router/charts/zookeeper/templates/pv.yaml create mode 100644 kubernetes/message-router/charts/zookeeper/templates/pvc.yaml create mode 100644 kubernetes/message-router/charts/zookeeper/templates/service.yaml create mode 100644 kubernetes/message-router/charts/zookeeper/values.yaml create mode 100644 kubernetes/message-router/requirements.yaml create mode 100644 kubernetes/message-router/templates/NOTES.txt delete mode 100644 kubernetes/message-router/templates/all-services.yaml create mode 100644 kubernetes/message-router/templates/configmap.yaml create mode 100644 kubernetes/message-router/templates/deployment.yaml delete mode 100644 kubernetes/message-router/templates/dmaap-configmap.yaml delete mode 100644 kubernetes/message-router/templates/message-router-dmaap.yaml delete mode 100644 kubernetes/message-router/templates/message-router-kafka.yaml delete mode 100644 kubernetes/message-router/templates/message-router-pv-pvc.yaml delete mode 100644 kubernetes/message-router/templates/message-router-zookeeper.yaml create mode 100644 kubernetes/message-router/templates/secrets.yaml create mode 100644 kubernetes/message-router/templates/service.yaml (limited to 'kubernetes/message-router') diff --git a/kubernetes/message-router/.helmignore b/kubernetes/message-router/.helmignore new file mode 100644 index 0000000000..f0c1319444 --- /dev/null +++ b/kubernetes/message-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/message-router/Chart.yaml b/kubernetes/message-router/Chart.yaml index 109cce20fe..b3a7491d78 100644 --- a/kubernetes/message-router/Chart.yaml +++ b/kubernetes/message-router/Chart.yaml @@ -13,6 +13,7 @@ # limitations under the License. apiVersion: v1 -description: A Helm chart for Kubernetes +appVersion: "1.0" +description: ONAP Message Router name: message-router -version: 0.1.0 +version: 2.0.0 diff --git a/kubernetes/message-router/charts/kafka/.helmignore b/kubernetes/message-router/charts/kafka/.helmignore new file mode 100644 index 0000000000..f0c1319444 --- /dev/null +++ b/kubernetes/message-router/charts/kafka/.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/message-router/charts/kafka/Chart.yaml b/kubernetes/message-router/charts/kafka/Chart.yaml new file mode 100644 index 0000000000..b26f91a04e --- /dev/null +++ b/kubernetes/message-router/charts/kafka/Chart.yaml @@ -0,0 +1,19 @@ +# 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 Global Kafka Service +name: kafka +version: 2.0.0 + diff --git a/kubernetes/message-router/charts/kafka/templates/NOTES.txt b/kubernetes/message-router/charts/kafka/templates/NOTES.txt new file mode 100644 index 0000000000..c60c745ca3 --- /dev/null +++ b/kubernetes/message-router/charts/kafka/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={{ 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/message-router/charts/kafka/templates/deployment.yaml b/kubernetes/message-router/charts/kafka/templates/deployment.yaml new file mode 100644 index 0000000000..cc3ae59e40 --- /dev/null +++ b/kubernetes/message-router/charts/kafka/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: + initContainers: + - command: + - bash + args: + - -c + - "if [ -d /var/tmp/SDC-DISTR-NOTIF-TOPIC-SDC-OPENSOURCE-ENV1-0 ]; then echo nothing to do; else cp -a /opt/config/src/message-router/dcae-startup-vm-message-router/docker_files/data-kafka/* /var/tmp/; fi" + image: "{{ .Values.global.configRepository }}/{{ .Values.global.configImage }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + volumeMounts: + - mountPath: /var/tmp + name: kafka-data + name: kafka-primer + - command: + - /root/ready.py + args: + - --container-name + - {{ .Values.zookeeper.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: "{{ include "common.repository" . }}/{{ .Values.image }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + ports: + - containerPort: {{ .Values.service.internalPort }} + # disable liveness probe when breakpoints set in debugger + # so K8s doesn't restart unresponsive container + {{- if 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: KAFKA_ZOOKEEPER_CONNECT + value: "{{.Values.zookeeper.nameOverride}}:{{.Values.config.zookeeperPort}}" + - name: KAFKA_ADVERTISED_HOST_NAME + value: "{{ include "common.fullname" . }}" + - name: KAFKA_BROKER_ID + value: "1" + - name: KAFKA_ADVERTISED_PORT + value: "{{.Values.service.internalPort}}" + - name: KAFKA_PORT + value: "{{.Values.service.internalPort}}" + volumeMounts: + - mountPath: /etc/localtime + name: localtime + readOnly: true + - mountPath: /var/run/docker.sock + name: docker-socket + - mountPath: /kafka + name: kafka-data + volumes: + - name: localtime + hostPath: + path: /etc/localtime + - name: docker-socket + hostPath: + path: /var/run/docker.sock + - name: kafka-data + persistentVolumeClaim: + claimName: {{ include "common.fullname" . }} + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/kubernetes/message-router/charts/kafka/templates/pv.yaml b/kubernetes/message-router/charts/kafka/templates/pv.yaml new file mode 100644 index 0000000000..8be3d4c9cb --- /dev/null +++ b/kubernetes/message-router/charts/kafka/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.Namespace }}/{{ .Values.persistence.mountSubPath }} +{{- end -}} diff --git a/kubernetes/message-router/charts/kafka/templates/pvc.yaml b/kubernetes/message-router/charts/kafka/templates/pvc.yaml new file mode 100644 index 0000000000..e27c3311e9 --- /dev/null +++ b/kubernetes/message-router/charts/kafka/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/message-router/charts/kafka/templates/service.yaml b/kubernetes/message-router/charts/kafka/templates/service.yaml new file mode 100644 index 0000000000..c57d190bb9 --- /dev/null +++ b/kubernetes/message-router/charts/kafka/templates/service.yaml @@ -0,0 +1,32 @@ +# 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 }} +spec: + ports: + - port: {{ .Values.service.externalPort }} + targetPort: {{ .Values.service.internalPort }} + name: {{ .Values.service.name }} + selector: + app: {{ include "common.name" . }} + release: {{ .Release.Name }} diff --git a/kubernetes/message-router/charts/kafka/values.yaml b/kubernetes/message-router/charts/kafka/values.yaml new file mode 100644 index 0000000000..ff05104599 --- /dev/null +++ b/kubernetes/message-router/charts/kafka/values.yaml @@ -0,0 +1,115 @@ +# 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 + loggingRepository: docker.elastic.co + loggingImage: beats/filebeat:5.5.0 + configRepository: oomk8s + configImage: config-init:2.0.0-SNAPSHOT + persistence: {} + +################################################################# +# Application configuration defaults. +################################################################# +# application image +repository: wurstmeister +image: kafka:latest +pullPolicy: Always + +zookeeper: + nameOverride: zookeeper + +# flag to enable debugging - application support required +debugEnabled: false + +# application configuration +config: + zookeeperPort: 2181 + +# 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: + ## 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: message-router/data-kafka + +service: + type: NodePort + name: global-kafka + internalPort: 9092 + externalPort: 9092 + +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/message-router/charts/zookeeper/.helmignore b/kubernetes/message-router/charts/zookeeper/.helmignore new file mode 100644 index 0000000000..f0c1319444 --- /dev/null +++ b/kubernetes/message-router/charts/zookeeper/.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/message-router/charts/zookeeper/Chart.yaml b/kubernetes/message-router/charts/zookeeper/Chart.yaml new file mode 100644 index 0000000000..dd999e5314 --- /dev/null +++ b/kubernetes/message-router/charts/zookeeper/Chart.yaml @@ -0,0 +1,19 @@ +# 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 Dmaap Zookeeper Service +name: zookeeper +version: 2.0.0 + diff --git a/kubernetes/message-router/charts/zookeeper/templates/NOTES.txt b/kubernetes/message-router/charts/zookeeper/templates/NOTES.txt new file mode 100644 index 0000000000..c60c745ca3 --- /dev/null +++ b/kubernetes/message-router/charts/zookeeper/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={{ 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/message-router/charts/zookeeper/templates/deployment.yaml b/kubernetes/message-router/charts/zookeeper/templates/deployment.yaml new file mode 100644 index 0000000000..678b83e3bd --- /dev/null +++ b/kubernetes/message-router/charts/zookeeper/templates/deployment.yaml @@ -0,0 +1,79 @@ +# 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: + - bash + args: + - -c + - "if [ -d /var/tmp/version-2 ]; then echo nothing to do; else cp -a /opt/config/src/message-router/dcae-startup-vm-message-router/docker_files/data-zookeeper/* /var/tmp/; fi" + image: "{{ .Values.global.configRepository }}/{{ .Values.global.configImage }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + volumeMounts: + - mountPath: /var/tmp + name: zookeeper-data + name: zookeeper-primer + containers: + - name: {{ include "common.name" . }} + image: "{{ include "common.repository" . }}/{{ .Values.image }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + ports: + - containerPort: {{ .Values.service.internalPort }} + # disable liveness probe when breakpoints set in debugger + # so K8s doesn't restart unresponsive container + {{- if 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: + - mountPath: /etc/localtime + name: localtime + readOnly: true + - mountPath: /opt/zookeeper-3.4.9/data + name: zookeeper-data + volumes: + - name: localtime + hostPath: + path: /etc/localtime + - name: zookeeper-data + persistentVolumeClaim: + claimName: {{ include "common.fullname" . }} + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/kubernetes/message-router/charts/zookeeper/templates/pv.yaml b/kubernetes/message-router/charts/zookeeper/templates/pv.yaml new file mode 100644 index 0000000000..8be3d4c9cb --- /dev/null +++ b/kubernetes/message-router/charts/zookeeper/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.Namespace }}/{{ .Values.persistence.mountSubPath }} +{{- end -}} diff --git a/kubernetes/message-router/charts/zookeeper/templates/pvc.yaml b/kubernetes/message-router/charts/zookeeper/templates/pvc.yaml new file mode 100644 index 0000000000..e27c3311e9 --- /dev/null +++ b/kubernetes/message-router/charts/zookeeper/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/message-router/charts/zookeeper/templates/service.yaml b/kubernetes/message-router/charts/zookeeper/templates/service.yaml new file mode 100644 index 0000000000..2386125587 --- /dev/null +++ b/kubernetes/message-router/charts/zookeeper/templates/service.yaml @@ -0,0 +1,32 @@ +# 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 }} +spec: + ports: + - port: {{ .Values.service.internalPort }} + name: {{ .Values.service.name }} + selector: + app: {{ include "common.name" . }} + release: {{ .Release.Name }} + clusterIP: None diff --git a/kubernetes/message-router/charts/zookeeper/values.yaml b/kubernetes/message-router/charts/zookeeper/values.yaml new file mode 100644 index 0000000000..66dc67e831 --- /dev/null +++ b/kubernetes/message-router/charts/zookeeper/values.yaml @@ -0,0 +1,110 @@ +# 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 + loggingRepository: docker.elastic.co + loggingImage: beats/filebeat:5.5.0 + configRepository: oomk8s + configImage: config-init:2.0.0-SNAPSHOT + persistence: {} + +################################################################# +# Application configuration defaults. +################################################################# +# application image +repository: wurstmeister +image: zookeeper:latest +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 + +## 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: + ## 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: message-router/data-zookeeper/ + +service: + type: NodePort + name: zookeeper + internalPort: 2181 + +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/message-router/requirements.yaml b/kubernetes/message-router/requirements.yaml new file mode 100644 index 0000000000..7beecb385c --- /dev/null +++ b/kubernetes/message-router/requirements.yaml @@ -0,0 +1,22 @@ +# 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/message-router/resources/config/dmaap/MsgRtrApi.properties b/kubernetes/message-router/resources/config/dmaap/MsgRtrApi.properties index 568d0d4ce0..ed3999d36e 100755 --- a/kubernetes/message-router/resources/config/dmaap/MsgRtrApi.properties +++ b/kubernetes/message-router/resources/config/dmaap/MsgRtrApi.properties @@ -1,3 +1,17 @@ +# Copyright © 2017 Amdocs, Bell Canada, 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. + ############################################################################### ## ## Cambria API Server config @@ -5,7 +19,7 @@ ## - Default values are shown as commented settings. ## -############################################################################### +############################################################################## ## ## HTTP service ## @@ -15,10 +29,9 @@ ## ## Both Cambria and Kafka make use of Zookeeper. ## -# config.zk.servers=zookeeper.namespace-placeholder:2181 -config.zk.servers=zookeeper:2181 +config.zk.servers={{.Values.zookeeper.nameOverride}}:{{.Values.config.zookeeperPort}} #config.zk.servers=172.17.0.1:2181 -#dmaap.namespace-placeholder:2181 +#dmaap.onap-message-router:2181 #10.208.128.229:2181 #config.zk.root=/fe3c/cambria/config @@ -31,9 +44,9 @@ config.zk.servers=zookeeper:2181 ## configurations (after removing "kafka.") ## if you want to change request.required.acks it can take this one value #kafka.metadata.broker.list=localhost:9092,localhost:9093 -kafka.metadata.broker.list=global-kafka:9092 +kafka.metadata.broker.list={{.Values.kafka.nameOverride}}:{{.Values.config.kafkaPort}} #kafka.metadata.broker.list=172.17.0.1:9092 -#dmaap.namespace-placeholder:9092 +#dmaap.onap-message-router:9092 #10.208.128.229:9092 ##kafka.request.required.acks=-1 #kafka.client.zookeeper=${config.zk.servers} diff --git a/kubernetes/message-router/resources/config/dmaap/cadi.properties b/kubernetes/message-router/resources/config/dmaap/cadi.properties index 1cb00a5cda..9079794517 100755 --- a/kubernetes/message-router/resources/config/dmaap/cadi.properties +++ b/kubernetes/message-router/resources/config/dmaap/cadi.properties @@ -1,3 +1,17 @@ +# Copyright © 2017 Amdocs, Bell Canada, 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. + basic_realm=openecomp.org basic_warn=TRUE diff --git a/kubernetes/message-router/templates/NOTES.txt b/kubernetes/message-router/templates/NOTES.txt new file mode 100644 index 0000000000..c60c745ca3 --- /dev/null +++ b/kubernetes/message-router/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={{ 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/message-router/templates/all-services.yaml b/kubernetes/message-router/templates/all-services.yaml deleted file mode 100644 index da6fee117d..0000000000 --- a/kubernetes/message-router/templates/all-services.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.disableMessageRouterZookeeper }} -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.disableMessageRouterGlobalKafka }} ---- -apiVersion: v1 -kind: Service -metadata: - name: global-kafka - namespace: "{{ .Values.nsPrefix }}" - labels: - app: global-kafka -spec: - ports: - - name: kafka1 - port: 9092 - selector: - app: global-kafka - clusterIP: None -#{{ end }} -#{{ if not .Values.disableMessageRouterDmaap }} ---- -apiVersion: v1 -kind: Service -metadata: - name: dmaap - namespace: "{{ .Values.nsPrefix }}" - labels: - app: dmaap - version: 1.0.0 - annotations: - msb.onap.org/service-info: '[ - { - "serviceName": "message-router", - "version": "v1", - "url": "/", - "protocol": "REST", - "port": "3904", - "visualRange":"1" - } - ]' -spec: - ports: - - name: mr1 - port: 3904 - nodePort: {{ .Values.nodePortPrefix }}27 - - name: mr2 - port: 3905 - nodePort: {{ .Values.nodePortPrefix }}26 - selector: - app: dmaap - type: NodePort -#{{ end }} \ No newline at end of file diff --git a/kubernetes/message-router/templates/configmap.yaml b/kubernetes/message-router/templates/configmap.yaml new file mode 100644 index 0000000000..911d2e9c0e --- /dev/null +++ b/kubernetes/message-router/templates/configmap.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }}-msgrtrapi-prop-configmap + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/dmaap/MsgRtrApi.properties").AsConfig . | indent 2 }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }}-cadi-prop-configmap + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/dmaap/cadi.properties").AsConfig . | indent 2 }} diff --git a/kubernetes/message-router/templates/deployment.yaml b/kubernetes/message-router/templates/deployment.yaml new file mode 100644 index 0000000000..ed3c4ebb7a --- /dev/null +++ b/kubernetes/message-router/templates/deployment.yaml @@ -0,0 +1,95 @@ +# 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.kafka.nameOverride }} + - --container-name + - {{ .Values.zookeeper.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: "{{ include "common.repository" . }}/{{ .Values.image }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + ports: + - containerPort: {{ .Values.service.externalPort }} + - containerPort: {{ .Values.service.externalPort2 }} + {{- if eq .Values.liveness.enabled true }} + livenessProbe: + tcpSocket: + port: {{ .Values.service.externalPort }} + initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} + periodSeconds: {{ .Values.liveness.periodSeconds }} + {{ end -}} + readinessProbe: + tcpSocket: + port: {{ .Values.service.externalPort }} + initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} + periodSeconds: {{ .Values.readiness.periodSeconds }} + volumeMounts: + - mountPath: /etc/localtime + name: localtime + readOnly: true + - mountPath: /appl/dmaapMR1/bundleconfig/etc/appprops/MsgRtrApi.properties + subPath: MsgRtrApi.properties + name: appprops + - mountPath: /appl/dmaapMR1/etc/cadi.properties + subPath: cadi.properties + name: cadi + - mountPath: /appl/dmaapMR1/etc/keyfile + subPath: mykey + name: mykey + volumes: + - name: localtime + hostPath: + path: /etc/localtime + - name: appprops + configMap: + name: {{ include "common.fullname" . }}-msgrtrapi-prop-configmap + - name: cadi + configMap: + name: {{ include "common.fullname" . }}-cadi-prop-configmap + - name: mykey + secret: + secretName: {{ include "common.fullname" . }}-secret + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/kubernetes/message-router/templates/dmaap-configmap.yaml b/kubernetes/message-router/templates/dmaap-configmap.yaml deleted file mode 100644 index bd1e629b21..0000000000 --- a/kubernetes/message-router/templates/dmaap-configmap.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: mr-dmaap-cadi-prop-configmap - namespace: {{ .Values.nsPrefix }} -data: -{{ tpl (.Files.Glob "resources/config/dmaap/cadi.properties").AsConfig . | indent 2 }} ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: mr-dmaap-msgrtrapi-prop-configmap - namespace: {{ .Values.nsPrefix }} -data: -{{ tpl (.Files.Glob "resources/config/dmaap/MsgRtrApi.properties").AsConfig . | indent 2 }} ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: mr-dmaap-mykey-configmap - namespace: {{ .Values.nsPrefix }} -data: -{{ tpl (.Files.Glob "resources/config/dmaap/mykey").AsConfig . | indent 2 }} diff --git a/kubernetes/message-router/templates/message-router-dmaap.yaml b/kubernetes/message-router/templates/message-router-dmaap.yaml deleted file mode 100644 index a0c13802bb..0000000000 --- a/kubernetes/message-router/templates/message-router-dmaap.yaml +++ /dev/null @@ -1,91 +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.disableMessageRouterDmaap }} -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: message-router-dmaap - namespace: "{{ .Values.nsPrefix }}" -spec: - replicas: {{ .Values.dmaapReplicas }} - selector: - matchLabels: - app: dmaap - template: - metadata: - labels: - app: dmaap - name: message-router-dmaap - spec: - initContainers: - - command: - - /root/ready.py - args: - - --container-name - - global-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: /etc/localtime - name: localtime - readOnly: true - - mountPath: /appl/dmaapMR1/bundleconfig/etc/appprops/MsgRtrApi.properties - subPath: MsgRtrApi.properties - name: appprops - - mountPath: /appl/dmaapMR1/etc/cadi.properties - subPath: cadi.properties - name: cadi - - mountPath: /appl/dmaapMR1/etc/keyfile - subPath: mykey - name: mykey - restartPolicy: Always - volumes: - - name: localtime - hostPath: - path: /etc/localtime - - name: appprops - configMap: - name: mr-dmaap-msgrtrapi-prop-configmap - - name: cadi - configMap: - name: mr-dmaap-cadi-prop-configmap - - name: mykey - configMap: - name: mr-dmaap-mykey-configmap - imagePullSecrets: - - name: "{{ .Values.nsPrefix }}-docker-registry-key" -{{ end }} - diff --git a/kubernetes/message-router/templates/message-router-kafka.yaml b/kubernetes/message-router/templates/message-router-kafka.yaml deleted file mode 100644 index 844de040d4..0000000000 --- a/kubernetes/message-router/templates/message-router-kafka.yaml +++ /dev/null @@ -1,102 +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.disableMessageRouterGlobalKafka }} -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: message-router-global-kafka - namespace: "{{ .Values.nsPrefix }}" -spec: - replicas: {{ .Values.kafkaReplicas }} - selector: - matchLabels: - app: global-kafka - template: - metadata: - labels: - app: global-kafka - name: message-router-global-kafka - spec: - initContainers: - - command: - - bash - args: - - -c - - "if [ -d /var/tmp/SDC-DISTR-NOTIF-TOPIC-SDC-OPENSOURCE-ENV1-0 ]; then echo nothing to do; else cp -a /opt/config/src/message-router/dcae-startup-vm-message-router/docker_files/data-kafka/* /var/tmp/; fi" - image: {{ .Values.image.config }} - imagePullPolicy: {{ .Values.pullPolicy }} - volumeMounts: - - mountPath: /var/tmp - name: kafka-data - name: kafka-primer - - 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: global-kafka - ports: - - containerPort: 9092 - readinessProbe: - tcpSocket: - port: 9092 - initialDelaySeconds: 5 - periodSeconds: 10 - env: - - name: KAFKA_ZOOKEEPER_CONNECT - value: "zookeeper.{{ .Values.nsPrefix }}:2181" - - name: KAFKA_ADVERTISED_HOST_NAME - value: "global-kafka" - - name: KAFKA_BROKER_ID - value: "1" - - name: KAFKA_ADVERTISED_PORT - value: "9092" - - name: KAFKA_PORT - value: "9092" - volumeMounts: - - mountPath: /etc/localtime - name: localtime - readOnly: true - - mountPath: /var/run/docker.sock - name: docker-socket - - mountPath: /kafka - name: kafka-data - restartPolicy: Always - volumes: - - name: localtime - hostPath: - path: /etc/localtime - - name: docker-socket - hostPath: - path: /var/run/docker.sock - - name: kafka-data - persistentVolumeClaim: - claimName: message-router-kafka - imagePullSecrets: - - name: "{{ .Values.nsPrefix }}-docker-registry-key" -#{{ end }} - diff --git a/kubernetes/message-router/templates/message-router-pv-pvc.yaml b/kubernetes/message-router/templates/message-router-pv-pvc.yaml deleted file mode 100644 index a39a975f33..0000000000 --- a/kubernetes/message-router/templates/message-router-pv-pvc.yaml +++ /dev/null @@ -1,81 +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.disableMessageRouterGlobalKafka }} -apiVersion: v1 -kind: PersistentVolume -metadata: - name: "{{ .Values.nsPrefix }}-message-router-kafka" - namespace: "{{ .Values.nsPrefix }}" - labels: - name: "{{ .Values.nsPrefix }}-message-router-kafka" -spec: - capacity: - storage: 2Gi - accessModes: - - ReadWriteMany - persistentVolumeReclaimPolicy: Retain - hostPath: - path: {{ .Values.dataRootDir }}/{{ .Values.nsPrefix }}/message-router/dcae-startup-vm-message-router/docker_files/data-kafka/ ---- -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: message-router-kafka - namespace: "{{ .Values.nsPrefix }}" -spec: - accessModes: - - ReadWriteMany - resources: - requests: - storage: 2Gi - selector: - matchLabels: - name: "{{ .Values.nsPrefix }}-message-router-kafka" -#{{ end }} -#{{ if not .Values.disableMessageRouterZookeeper }} ---- -apiVersion: v1 -kind: PersistentVolume -metadata: - name: "{{ .Values.nsPrefix }}-message-router-zookeeper" - namespace: "{{ .Values.nsPrefix }}" - labels: - name: "{{ .Values.nsPrefix }}-message-router-zookeeper" -spec: - capacity: - storage: 2Gi - accessModes: - - ReadWriteMany - persistentVolumeReclaimPolicy: Retain - hostPath: - path: {{ .Values.dataRootDir }}/{{ .Values.nsPrefix }}/message-router/dcae-startup-vm-message-router/docker_files/data-zookeeper ---- -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: message-router-zookeeper - namespace: "{{ .Values.nsPrefix }}" -spec: - accessModes: - - ReadWriteMany - resources: - requests: - storage: 2Gi - selector: - matchLabels: - name: "{{ .Values.nsPrefix }}-message-router-zookeeper" -#{{ end }} diff --git a/kubernetes/message-router/templates/message-router-zookeeper.yaml b/kubernetes/message-router/templates/message-router-zookeeper.yaml deleted file mode 100644 index 1b3e8f8ed9..0000000000 --- a/kubernetes/message-router/templates/message-router-zookeeper.yaml +++ /dev/null @@ -1,72 +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.disableMessageRouterZookeeper }} -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: message-router-zookeeper - namespace: "{{ .Values.nsPrefix }}" -spec: - replicas: {{ .Values.zookeeperReplicas }} - selector: - matchLabels: - app: zookeeper - template: - metadata: - labels: - app: zookeeper - name: message-router-zookeeper - spec: - initContainers: - - command: - - bash - args: - - -c - - "if [ -d /var/tmp/version-2 ]; then echo nothing to do; else cp -a /opt/config/src/message-router/dcae-startup-vm-message-router/docker_files/data-zookeeper/* /var/tmp/; fi" - image: {{ .Values.image.config }} - imagePullPolicy: {{ .Values.pullPolicy }} - volumeMounts: - - mountPath: /var/tmp - name: zookeeper-data - name: zookeeper-primer - containers: - - image: {{ .Values.image.zookeeper }} - imagePullPolicy: {{ .Values.pullPolicy }} - name: zookeeper - ports: - - containerPort: 2181 - readinessProbe: - tcpSocket: - port: 2181 - initialDelaySeconds: 5 - periodSeconds: 10 - volumeMounts: - - mountPath: /etc/localtime - name: localtime - readOnly: true - - mountPath: /opt/zookeeper-3.4.9/data - name: zookeeper-data - restartPolicy: Always - volumes: - - name: localtime - hostPath: - path: /etc/localtime - - name: zookeeper-data - persistentVolumeClaim: - claimName: message-router-zookeeper - imagePullSecrets: - - name: "{{ .Values.nsPrefix }}-docker-registry-key" -#{{ end }} - diff --git a/kubernetes/message-router/templates/secrets.yaml b/kubernetes/message-router/templates/secrets.yaml new file mode 100644 index 0000000000..a7f6e18b39 --- /dev/null +++ b/kubernetes/message-router/templates/secrets.yaml @@ -0,0 +1,27 @@ +# 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" . }}-secret + 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/dmaap/mykey").AsSecrets | indent 2 }} +type: Opaque diff --git a/kubernetes/message-router/templates/service.yaml b/kubernetes/message-router/templates/service.yaml new file mode 100644 index 0000000000..7265ecb544 --- /dev/null +++ b/kubernetes/message-router/templates/service.yaml @@ -0,0 +1,54 @@ +# 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": "{{ include "common.fullname" . }}", + "version": "v1", + "url": "/", + "protocol": "REST", + "port": "{{.Values.service.internalPort}}", + "visualRange":"1" + } + ]' + +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 }}-{{ .Values.service.externalPort }} + - port: {{ .Values.service.externalPort2 }} + nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort2 }} + name: {{ .Values.service.name }}-{{ .Values.service.externalPort2 }} + {{- 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/message-router/values.yaml b/kubernetes/message-router/values.yaml index 68251471e6..df3cefae2a 100644 --- a/kubernetes/message-router/values.yaml +++ b/kubernetes/message-router/values.yaml @@ -12,17 +12,85 @@ # 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 + +################################################################# +# Application configuration defaults. +################################################################# +# application image +repository: nexus3.onap.org:10001 +image: onap/dmaap/dmaap-mr:latest pullPolicy: Always -nodePortPrefix: 302 -dmaapReplicas: 1 -kafkaReplicas: 1 -zookeeperReplicas: 1 -dataRootDir: /dockerdata-nfs -image: - readiness: oomk8s/readiness-check:1.1.0 - dmaap: attos/dmaap:latest - kafka: wurstmeister/kafka:latest - zookeeper: wurstmeister/zookeeper:latest - config: oomk8s/config-init:2.0.0-SNAPSHOT +nameOverride: dmaap + +kafka: + nameOverride: global-kafka +zookeeper: + nameOverride: zookeeper + +# flag to enable debugging - application support required +debugEnabled: false + +# application configuration +config: + zookeeperPort: 2181 + kafkaPort: 9092 + +# 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: message-router + externalPort: 3904 + nodePort: 27 + externalPort2: 3905 + nodePort2: 26 + +ingress: + enabled: false + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # + # Example: + # Configure resource requests and limits + # ref: http://kubernetes.io/docs/user-guide/compute-resources/ + # Minimum memory for development is 2 CPU cores and 4GB memory + # Minimum memory for production is 4 CPU cores and 8GB memory +#resources: +# limits: +# cpu: 2 +# memory: 4Gi +# requests: +# cpu: 2 +# memory: 4Gi -- cgit 1.2.3-korg