Skip to content

Commit

Permalink
Api server works
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhil-thomas authored and sthaha committed Oct 11, 2019
1 parent acb35d5 commit 9660dfd
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 8 deletions.
6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
vote-api-server

# Test binary, build with `go test -c`
*.test
Expand Down
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM golang:1.13 as builder

WORKDIR /build
ADD . /build/


ENV GOOS=linux GARCH=amd64 CGO_ENABLED=0
RUN go build -o api-server .

FROM alpine:3.7

#RUN adduser -S -D -H -h /app appuser
#USER appuser

WORKDIR /app
COPY --from=builder /build/api-server /app/api-server

CMD [ "/app/api-server" ]
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module github.com:nikhil-thomas/tekton-pipelines-demo.git
module github.com/sthaha/vote-api-server

go 1.12
go 1.13

require github.com/gin-gonic/gin v1.4.0 // indirect
require github.com/gin-gonic/gin v1.4.0
22 changes: 22 additions & 0 deletions k8s/voting-api-deployment-manifest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
app: voting-api
name: voting-api
spec:
replicas: 1
selector:
matchLabels:
app: voting-api
template:
metadata:
labels:
app: voting-api
spec:
containers:
- image: nikhilvep/voting-api:latest
name: voting-api
ports:
- containerPort: 8080
13 changes: 13 additions & 0 deletions k8s/voting-api-service-manifest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
labels:
app: voting-api
name: voting-api
spec:
ports:
- port: 8080
protocol: TCP
targetPort: 8080
selector:
app: voting-api

0 comments on commit 9660dfd

Please sign in to comment.