Skip to content

Commit

Permalink
ZBIO-120:Image and yaml for consumer
Browse files Browse the repository at this point in the history
  • Loading branch information
VIVEK KB committed Mar 10, 2020
1 parent b3551ff commit cc32ec4
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 1 deletion.
13 changes: 13 additions & 0 deletions pub-sub/consumer/bin/consumer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
set -x
echo "Calling Sample consumer"

echo $PWD
ls -l /zbsample/zbsample_consumer

export SERVER_CRT=/zbsample/server.crt
#touch i_am_here.txt
PROG=$(ls -lart . | grep zbsample | awk '{print $NF}')
ldd $PROG
./$PROG

echo "Done"
21 changes: 21 additions & 0 deletions pub-sub/consumer/bin/server.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
-----BEGIN CERTIFICATE-----
MIIDbjCCAlYCCQDi7l8EzZo2hDANBgkqhkiG9w0BAQsFADB5MQswCQYDVQQGEwJV
UzELMAkGA1UECAwCQ0ExETAPBgNVBAcMCFNhbiBKb3NlMQ4wDAYDVQQKDAVaYi5p
bzENMAsGA1UECwwEWmJpbzEOMAwGA1UEAwwFemIuaW8xGzAZBgkqhkiG9w0BCQEW
DHN1ZGhpckB6Yi5pbzAeFw0yMDAxMTQxMjM2MTVaFw0zMDAxMTExMjM2MTVaMHkx
CzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTERMA8GA1UEBwwIU2FuIEpvc2UxDjAM
BgNVBAoMBVpiLmlvMQ0wCwYDVQQLDARaYmlvMQ4wDAYDVQQDDAV6Yi5pbzEbMBkG
CSqGSIb3DQEJARYMc3VkaGlyQHpiLmlvMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A
MIIBCgKCAQEAyCRRY0H09sSGFckgOrlZCABVWYiIz9XM0PLP7lL+ip+mF2KLc438
a4S/y7dsPUswIoUyfWXojNJ/VhmiynyuMVHDgeDYuX+rPXoeIXC07xd9VDZ0iG6x
lxhWMfowvkfuhTH48gYjlMy7mQhcCtsCcSMSYCx3pCYQtB7xNnlJ3cchhZAtqQhM
SBIKsQcVuF7yWghWXKitu5cO3dFKPphfFXN2vAaE1UqexIYVmByeSXdScjzU91PO
F/S1uVKg7dWIaP+lPmyXUh9uo7msZgS8JnTy8MDm47ksUwnSufUCbzId7x1sIz4x
hgzExPbZQkcttAKuuG1NAzfbf6sj5szozwIDAQABMA0GCSqGSIb3DQEBCwUAA4IB
AQAD48UpBOg7mzmIw7X11us7pGdu6gAKFk8R/vTfp3YyX8zCYL5T/RaGpH+buJfI
DiJi4RkXRSoslD1hQGK/GVfVgTtOIxJT2xd0ddIt2lcfxaPR83LpACuxAWtzWWis
LEft+yBggoaeakxvfbud8gvpP8Dme76CEU+sEoCI8tmDLHljK6zJTwqyd+jqC1T/
M0gOlbmkx3621toKzhUdj/n9jf+2f5AaGEEXaGCpC520R82/xd81hsMEdzLaRUwv
SbM5SL8bcgSxOow0ijUB9zPNaXt7CWcSEfvqkcLmB+o8+cJYi0+ZITAgELRbi5Z9
AWa8bDiglEZ9wPIRDe6MDWx3
-----END CERTIFICATE-----
Binary file added pub-sub/consumer/bin/zbsample_consumer
Binary file not shown.
2 changes: 1 addition & 1 deletion pub-sub/consumer/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

var (
zbCli *client.Client2020-03-05T10:21:32.623+0530 info client/client.go:323 Requested NewMessage data: [topic:"test-topic-1" data:"Message number 56 " ]
zbCli *client.Client//2020-03-05T10:21:32.623+0530 info client/client.go:323 Requested NewMessage data: [topic:"test-topic-1" data:"Message number 56 " ]

)

Expand Down
13 changes: 13 additions & 0 deletions pub-sub/consumer/consumer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
kind: Pod
apiVersion: v1
metadata:
name: zbio-example-consumer
labels:
app: zbio-example-consumer
spec:
containers:
- name: zbio-example-consumer
image: zbio-example/consumer:v1
imagePullPolicy: Never
restartPolicy: OnFailure
terminationGracePeriodSeconds: 0
13 changes: 13 additions & 0 deletions pub-sub/consumer/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM golang:alpine
MAINTAINER VIVEK K B <kbvivek@zb.io>
LABEL Description="This image is used to start consumer " Vendor="Zettabytes" Version="1.0"

# ADD consumer binary location
ADD bin /consumer
WORKDIR /consumer

ENV SERVER_CRT="/consumer/server.crt"

ENTRYPOINT ./consumer.sh
CMD [default]

12 changes: 12 additions & 0 deletions pub-sub/consumer/makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
all:
export GOPRIVATE="github.com/ZB-io/*"
GOOS=linux GOARCH=amd64 go build -o bin/zbsample_consumer
cp ../../security/cert/server.crt bin/
ifdef NODOCKER
echo "DO NOT BUILD IMAGE"
else
docker build -f docker/Dockerfile -t zbio-example/consumer:v1 .
endif

clean:
rm -f bin/zbsample_consumer

0 comments on commit cc32ec4

Please sign in to comment.