From 9e77b21fc896b5018af2bfb27053a3273bfae31c Mon Sep 17 00:00:00 2001 From: kerenj Date: Wed, 23 Aug 2017 08:40:41 +0000 Subject: message-router K8S-Helm Parameterization changed message-router k8s deployment to support helm parameterization Issue-ID: OOM-52 Change-Id: I6a46293e4b38d7c7ed91a5642de6c169193f14d5 Signed-off-by: kerenj --- kubernetes/message-router/Chart.yaml | 4 ++ kubernetes/message-router/all-services.yaml | 46 ------------ .../message-router/message-router-dmaap.yaml | 74 ------------------- .../message-router/message-router-kafka.yaml | 82 --------------------- .../message-router/message-router-zookeeper.yaml | 35 --------- .../message-router/templates/all-services.yaml | 49 +++++++++++++ .../templates/message-router-dmaap.yaml | 75 +++++++++++++++++++ .../templates/message-router-kafka.yaml | 83 ++++++++++++++++++++++ .../templates/message-router-zookeeper.yaml | 35 +++++++++ kubernetes/message-router/values.yaml | 7 ++ kubernetes/oneclick/setenv.bash | 4 +- 11 files changed, 255 insertions(+), 239 deletions(-) create mode 100644 kubernetes/message-router/Chart.yaml delete mode 100644 kubernetes/message-router/all-services.yaml delete mode 100644 kubernetes/message-router/message-router-dmaap.yaml delete mode 100644 kubernetes/message-router/message-router-kafka.yaml delete mode 100644 kubernetes/message-router/message-router-zookeeper.yaml create mode 100644 kubernetes/message-router/templates/all-services.yaml create mode 100644 kubernetes/message-router/templates/message-router-dmaap.yaml create mode 100644 kubernetes/message-router/templates/message-router-kafka.yaml create mode 100644 kubernetes/message-router/templates/message-router-zookeeper.yaml create mode 100644 kubernetes/message-router/values.yaml (limited to 'kubernetes') diff --git a/kubernetes/message-router/Chart.yaml b/kubernetes/message-router/Chart.yaml new file mode 100644 index 0000000000..6341c5ca40 --- /dev/null +++ b/kubernetes/message-router/Chart.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +description: A Helm chart for Kubernetes +name: message-router +version: 0.1.0 diff --git a/kubernetes/message-router/all-services.yaml b/kubernetes/message-router/all-services.yaml deleted file mode 100644 index ef13b8e321..0000000000 --- a/kubernetes/message-router/all-services.yaml +++ /dev/null @@ -1,46 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: zookeeper - labels: - app: zookeeper -spec: - ports: - - name: zookeeper1 - port: 2181 - selector: - app: zookeeper - clusterIP: None ---- -apiVersion: v1 -kind: Service -metadata: - name: global-kafka - labels: - app: global-kafka -spec: - ports: - - name: kafka1 - port: 9092 - selector: - app: global-kafka - clusterIP: None ---- -apiVersion: v1 -kind: Service -metadata: - name: dmaap - labels: - app: dmaap - version: 1.0.0 -spec: - ports: - - name: mr1 - port: 3904 - nodePort: 30227 - - name: mr2 - port: 3905 - nodePort: 30226 - selector: - app: dmaap - type: NodePort diff --git a/kubernetes/message-router/message-router-dmaap.yaml b/kubernetes/message-router/message-router-dmaap.yaml deleted file mode 100644 index 8d85b8f929..0000000000 --- a/kubernetes/message-router/message-router-dmaap.yaml +++ /dev/null @@ -1,74 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: dmaap -spec: - selector: - matchLabels: - app: dmaap - template: - metadata: - labels: - app: dmaap - name: dmaap - annotations: - pod.beta.kubernetes.io/init-containers: '[ - { - "args": [ - "--container-name", - "global-kafka", - "--container-name", - "zookeeper" - ], - "command": [ - "/root/ready.py" - ], - "env": [ - { - "name": "NAMESPACE", - "valueFrom": { - "fieldRef": { - "apiVersion": "v1", - "fieldPath": "metadata.namespace" - } - } - } - ], - "image": "oomk8s/readiness-check:1.0.0", - "imagePullPolicy": "Always", - "name": "dmaap-readiness" - } - ]' - spec: - containers: - - image: attos/dmaap:latest - imagePullPolicy: Always - 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/onapdemo/message-router/dmaap/MsgRtrApi.properties - - name: cadi - hostPath: - path: /dockerdata-nfs/onapdemo/message-router/dmaap/cadi.properties - - name: mykey - hostPath: - path: /dockerdata-nfs/onapdemo/message-router/dmaap/mykey - imagePullSecrets: - - name: onap-docker-registry-key diff --git a/kubernetes/message-router/message-router-kafka.yaml b/kubernetes/message-router/message-router-kafka.yaml deleted file mode 100644 index 91b6e29f45..0000000000 --- a/kubernetes/message-router/message-router-kafka.yaml +++ /dev/null @@ -1,82 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: global-kafka -spec: - selector: - matchLabels: - app: global-kafka - template: - metadata: - labels: - app: global-kafka - name: global-kafka - annotations: - pod.beta.kubernetes.io/init-containers: '[ - { - "args": [ - "--container-name", - "zookeeper" - ], - "command": [ - "/root/ready.py" - ], - "env": [ - { - "name": "NAMESPACE", - "valueFrom": { - "fieldRef": { - "apiVersion": "v1", - "fieldPath": "metadata.namespace" - } - } - } - ], - "image": "oomk8s/readiness-check:1.0.0", - "imagePullPolicy": "Always", - "name": "kafka-readiness" - } - ]' - spec: - containers: - - image: wurstmeister/kafka:latest - imagePullPolicy: Always - name: global-kafka - ports: - - containerPort: 9092 - readinessProbe: - tcpSocket: - port: 9092 - initialDelaySeconds: 5 - periodSeconds: 10 - env: - - name: KAFKA_ZOOKEEPER_CONNECT - value: "zookeeper.onap-message-router: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: /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/onapdemo/message-router/dcae-startup-vm-message-router/docker_files/data-kafka/ - - name: start-kafka - hostPath: - path: /dockerdata-nfs/onapdemo/message-router/dcae-startup-vm-message-router/docker_files/start-kafka.sh - imagePullSecrets: - - name: onap-docker-registry-key diff --git a/kubernetes/message-router/message-router-zookeeper.yaml b/kubernetes/message-router/message-router-zookeeper.yaml deleted file mode 100644 index c1f9f07fac..0000000000 --- a/kubernetes/message-router/message-router-zookeeper.yaml +++ /dev/null @@ -1,35 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: zookeeper -spec: - selector: - matchLabels: - app: zookeeper - template: - metadata: - labels: - app: zookeeper - name: zookeeper - spec: - containers: - - image: wurstmeister/zookeeper:latest - imagePullPolicy: Always - name: zookeeper - ports: - - containerPort: 2181 - readinessProbe: - tcpSocket: - port: 2181 - initialDelaySeconds: 5 - periodSeconds: 10 - volumeMounts: - - mountPath: /opt/zookeeper-3.4.9/data - name: zookeeper-data - restartPolicy: Always - volumes: - - name: zookeeper-data - hostPath: - path: /dockerdata-nfs/onapdemo/message-router/dcae-startup-vm-message-router/docker_files/data-zookeeper - imagePullSecrets: - - name: onap-docker-registry-key diff --git a/kubernetes/message-router/templates/all-services.yaml b/kubernetes/message-router/templates/all-services.yaml new file mode 100644 index 0000000000..38fee01b22 --- /dev/null +++ b/kubernetes/message-router/templates/all-services.yaml @@ -0,0 +1,49 @@ +apiVersion: v1 +kind: Service +metadata: + name: zookeeper + namespace: {{ .Values.NS }} + labels: + app: zookeeper +spec: + ports: + - name: zookeeper1 + port: 2181 + selector: + app: zookeeper + clusterIP: None +--- +apiVersion: v1 +kind: Service +metadata: + name: global-kafka + namespace: {{ .Values.NS }} + labels: + app: global-kafka +spec: + ports: + - name: kafka1 + port: 9092 + selector: + app: global-kafka + clusterIP: None +--- +apiVersion: v1 +kind: Service +metadata: + name: dmaap + namespace: {{ .Values.NS }} + labels: + app: dmaap + version: 1.0.0 +spec: + ports: + - name: mr1 + port: 3904 + nodePort: 30227 + - name: mr2 + port: 3905 + nodePort: 30226 + selector: + app: dmaap + type: NodePort diff --git a/kubernetes/message-router/templates/message-router-dmaap.yaml b/kubernetes/message-router/templates/message-router-dmaap.yaml new file mode 100644 index 0000000000..eda5093178 --- /dev/null +++ b/kubernetes/message-router/templates/message-router-dmaap.yaml @@ -0,0 +1,75 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: dmaap + namespace: {{ .Values.NS }} +spec: + selector: + matchLabels: + app: dmaap + template: + metadata: + labels: + app: dmaap + name: dmaap + annotations: + pod.beta.kubernetes.io/init-containers: '[ + { + "args": [ + "--container-name", + "global-kafka", + "--container-name", + "zookeeper" + ], + "command": [ + "/root/ready.py" + ], + "env": [ + { + "name": "NAMESPACE", + "valueFrom": { + "fieldRef": { + "apiVersion": "v1", + "fieldPath": "metadata.namespace" + } + } + } + ], + "image": "{{ .Values.image.readiness }}", + "imagePullPolicy": "{{ .Values.pullPolicy }}", + "name": "dmaap-readiness" + } + ]' + spec: + 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/onap/message-router/dmaap/MsgRtrApi.properties + - name: cadi + hostPath: + path: /dockerdata-nfs/onap/message-router/dmaap/cadi.properties + - name: mykey + hostPath: + path: /dockerdata-nfs/onap/message-router/dmaap/mykey + imagePullSecrets: + - name: onap-docker-registry-key diff --git a/kubernetes/message-router/templates/message-router-kafka.yaml b/kubernetes/message-router/templates/message-router-kafka.yaml new file mode 100644 index 0000000000..cb2f3e97bf --- /dev/null +++ b/kubernetes/message-router/templates/message-router-kafka.yaml @@ -0,0 +1,83 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: global-kafka + namespace: {{ .Values.NS }} +spec: + selector: + matchLabels: + app: global-kafka + template: + metadata: + labels: + app: global-kafka + name: global-kafka + annotations: + pod.beta.kubernetes.io/init-containers: '[ + { + "args": [ + "--container-name", + "zookeeper" + ], + "command": [ + "/root/ready.py" + ], + "env": [ + { + "name": "NAMESPACE", + "valueFrom": { + "fieldRef": { + "apiVersion": "v1", + "fieldPath": "metadata.namespace" + } + } + } + ], + "image": "{{ .Values.image.readiness }}", + "imagePullPolicy": "{{ .Values.pullPolicy }}", + "name": "kafka-readiness" + } + ]' + spec: + 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.onap-message-router: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: /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/onap/message-router/dcae-startup-vm-message-router/docker_files/data-kafka/ + - name: start-kafka + hostPath: + path: /dockerdata-nfs/onap/message-router/dcae-startup-vm-message-router/docker_files/start-kafka.sh + imagePullSecrets: + - name: onap-docker-registry-key diff --git a/kubernetes/message-router/templates/message-router-zookeeper.yaml b/kubernetes/message-router/templates/message-router-zookeeper.yaml new file mode 100644 index 0000000000..795227b821 --- /dev/null +++ b/kubernetes/message-router/templates/message-router-zookeeper.yaml @@ -0,0 +1,35 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: zookeeper +spec: + selector: + matchLabels: + app: zookeeper + template: + metadata: + labels: + app: zookeeper + name: zookeeper + spec: + containers: + - image: wurstmeister/zookeeper:latest + imagePullPolicy: Always + name: zookeeper + ports: + - containerPort: 2181 + readinessProbe: + tcpSocket: + port: 2181 + initialDelaySeconds: 5 + periodSeconds: 10 + volumeMounts: + - mountPath: /opt/zookeeper-3.4.9/data + name: zookeeper-data + restartPolicy: Always + volumes: + - name: zookeeper-data + hostPath: + path: /dockerdata-nfs/onap/message-router/dcae-startup-vm-message-router/docker_files/data-zookeeper + imagePullSecrets: + - name: onap-docker-registry-key diff --git a/kubernetes/message-router/values.yaml b/kubernetes/message-router/values.yaml new file mode 100644 index 0000000000..b69aa0081a --- /dev/null +++ b/kubernetes/message-router/values.yaml @@ -0,0 +1,7 @@ +NS: onap-message-router +pullPolicy: Always +image: + readiness: oomk8s/readiness-check:1.0.0 + dmaap: attos/dmaap:latest + kafka: wurstmeister/kafka:latest + zookeeper: wurstmeister/zookeeper:latest diff --git a/kubernetes/oneclick/setenv.bash b/kubernetes/oneclick/setenv.bash index eb9bdb206c..aaaffeaa91 100644 --- a/kubernetes/oneclick/setenv.bash +++ b/kubernetes/oneclick/setenv.bash @@ -1,7 +1,7 @@ #!/bin/bash -HELM_APPS=('mso') -ONAP_APPS=('sdc' 'aai' 'message-router' 'robot' 'vid' 'sdnc' 'portal' 'policy' 'appc') +HELM_APPS=('mso' 'message-router') +ONAP_APPS=('sdc' 'aai' 'robot' 'vid' 'sdnc' 'portal' 'policy' 'appc') ONAP_DOCKER_REGISTRY_KEY=${ONAP_DOCKER_REGISTRY_KEY:-onap-docker-registry-key} ONAP_DOCKER_REGISTRY=${ONAP_DOCKER_REGISTRY:-nexus3.onap.org:10001} ONAP_DOCKER_USER=${ONAP_DOCKER_USER:-docker} -- cgit 1.2.3-korg