diff options
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 |