diff options
author | Rajamohan Raj <rajamohan.raj@intel.com> | 2019-10-15 00:48:18 +0000 |
---|---|---|
committer | Marco Platania <platania@research.att.com> | 2019-10-15 13:30:04 +0000 |
commit | 99f7370360201104ddfc99b5e766b4e32e8524cc (patch) | |
tree | 9e7dbc4db186e85afd0654b64bdb4cabdb7b81ab /vnfs/DAaaS/microservices/GoApps/src/go-hdfs-writer/kubernetes-manifests | |
parent | 3289af42fd3af32fd07c565d072c65743249ebce (diff) |
HDFSWriter microservice working copy
Issue-ID: ONAPARC-453
Signed-off-by: Rajamohan Raj <rajamohan.raj@intel.com>
Change-Id: I11c91b642e466763c1ca6f5734bf81fb260e2b39
Diffstat (limited to 'vnfs/DAaaS/microservices/GoApps/src/go-hdfs-writer/kubernetes-manifests')
5 files changed, 120 insertions, 0 deletions
diff --git a/vnfs/DAaaS/microservices/GoApps/src/go-hdfs-writer/kubernetes-manifests/configmap_hdfs.yaml b/vnfs/DAaaS/microservices/GoApps/src/go-hdfs-writer/kubernetes-manifests/configmap_hdfs.yaml new file mode 100644 index 00000000..1fdd7ca2 --- /dev/null +++ b/vnfs/DAaaS/microservices/GoApps/src/go-hdfs-writer/kubernetes-manifests/configmap_hdfs.yaml @@ -0,0 +1,10 @@ +# Preserving a sample config of hdfs +#NOTE : The kafka config shall come through the REST request as part of writer config +apiVersion: v1 +kind: ConfigMap +metadata: + name: configmap-hdfs +data: + #hdfs_url: hdfs1-namenode-1.hdfs1-namenode.hdfs1:8020 + hdfs_url: hdfs1-namenode:8020 +
\ No newline at end of file diff --git a/vnfs/DAaaS/microservices/GoApps/src/go-hdfs-writer/kubernetes-manifests/configmap_kafka.yaml b/vnfs/DAaaS/microservices/GoApps/src/go-hdfs-writer/kubernetes-manifests/configmap_kafka.yaml new file mode 100644 index 00000000..503896b3 --- /dev/null +++ b/vnfs/DAaaS/microservices/GoApps/src/go-hdfs-writer/kubernetes-manifests/configmap_kafka.yaml @@ -0,0 +1,11 @@ +# Preserving a sample config of kafka broker +#NOTE : The kafka config shall come through the REST request as part of writer config +apiVersion: v1 +kind: ConfigMap +metadata: + name: configmap-kafka +data: + #broker: kafka-cluster-kafka-1.kafka-cluster-kafka-brokers.hdfs1.svc.cluster.local:9092 + broker: kafka-cluster-kafka-bootstrap:9092 + group: grp1i + topic: newTopc9
\ No newline at end of file diff --git a/vnfs/DAaaS/microservices/GoApps/src/go-hdfs-writer/kubernetes-manifests/configmap_writer.yaml b/vnfs/DAaaS/microservices/GoApps/src/go-hdfs-writer/kubernetes-manifests/configmap_writer.yaml new file mode 100644 index 00000000..f5d0833b --- /dev/null +++ b/vnfs/DAaaS/microservices/GoApps/src/go-hdfs-writer/kubernetes-manifests/configmap_writer.yaml @@ -0,0 +1,22 @@ +#Preserving a sample config of writer. +#NOTE : The writer config shall come through the REST request +apiVersion: v1 +kind: ConfigMap +metadata: + name: config-json +data: + config.json: |- + [ + {"writer": { + "kafkaConfig": { + "broker": "kafka-cluster-kafka-bootstrap:9092", + "group": "grp1", + "topic": "newTopic9" + }, + "hdfsConfig": { + "hdfs_url": "hdfs1-namenode:8020" + } + } + } + ] +
\ No newline at end of file diff --git a/vnfs/DAaaS/microservices/GoApps/src/go-hdfs-writer/kubernetes-manifests/hdfs_writer_deployment.yaml b/vnfs/DAaaS/microservices/GoApps/src/go-hdfs-writer/kubernetes-manifests/hdfs_writer_deployment.yaml new file mode 100644 index 00000000..393a1d78 --- /dev/null +++ b/vnfs/DAaaS/microservices/GoApps/src/go-hdfs-writer/kubernetes-manifests/hdfs_writer_deployment.yaml @@ -0,0 +1,63 @@ +# This Deployment manifest defines: +# - single-replica deployment of the container image, with label "app: go-hello-world" +# - Pod exposes port 8080 +# - specify PORT environment variable to the container process +# Syntax reference https://kubernetes.io/docs/concepts/configuration/overview/ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: go-hdfs-writer +spec: + replicas: 1 + selector: + matchLabels: + app: hdfs-writer + template: + metadata: + labels: + app: hdfs-writer + spec: + containers: + - name: server + image: hdfs-writer + volumeMounts: + - name: config-volume + mountPath: src/hdfs-writer/cmd/hdfs-writer/config.json + subPath: config.json + ports: + - containerPort: 8080 + env: + - name: PORT + value: "8080" + - name: BROKER + valueFrom: + configMapKeyRef: + name: configmap-kafka + key: broker + - name: GROUP + valueFrom: + configMapKeyRef: + name: configmap-kafka + key: group + - name: TOPIC + valueFrom: + configMapKeyRef: + name: configmap-kafka + key: topic + - name: HDFS_URL + valueFrom: + configMapKeyRef: + name: configmap-hdfs + key: hdfs_url + resources: + requests: + memory: "640Mi" + cpu: "2500m" + limits: + memory: "1280Mi" + cpu: "5000m" + volumes: + - name: config-volume + configMap: + name: config-json + terminationGracePeriodSeconds: 3 diff --git a/vnfs/DAaaS/microservices/GoApps/src/go-hdfs-writer/kubernetes-manifests/hdfs_writer_service.yaml b/vnfs/DAaaS/microservices/GoApps/src/go-hdfs-writer/kubernetes-manifests/hdfs_writer_service.yaml new file mode 100644 index 00000000..596ad5fd --- /dev/null +++ b/vnfs/DAaaS/microservices/GoApps/src/go-hdfs-writer/kubernetes-manifests/hdfs_writer_service.yaml @@ -0,0 +1,14 @@ +# This is required for testing using the POSTMAN +kind: Service +apiVersion: v1 +metadata: + name: hdfs-writer-svc +spec: + type: NodePort + selector: + app: hdfs-writer + ports: + - nodePort: 30303 + port: 9393 + targetPort: 9393 +
\ No newline at end of file |