updates to kubernetes deployments

This commit is contained in:
marcel-dempers 2019-09-10 21:42:26 +10:00
parent a8664272e9
commit 20011946e7
5 changed files with 14 additions and 7 deletions

View File

@ -15,7 +15,7 @@ services:
image: aimvector/golang:1.0.0 image: aimvector/golang:1.0.0
build: build:
context: ./golang context: ./golang
target: debug target: prod
volumes: volumes:
- ./golang/src/:/go/src/work/ - ./golang/src/:/go/src/work/
ports: ports:

View File

@ -11,12 +11,17 @@ import (
func Response(ctx *fasthttp.RequestCtx) { func Response(ctx *fasthttp.RequestCtx) {
fmt.Fprintf(ctx, "Hello") fmt.Fprintf(ctx, "Hello")
} }
func Status(ctx *fasthttp.RequestCtx) {
fmt.Fprintf(ctx, "ok")
}
func main() { func main() {
fmt.Println("starting...") fmt.Println("starting...")
router := fasthttprouter.New() router := fasthttprouter.New()
router.GET("/", Response) router.GET("/", Response)
router.GET("/status", Status)
log.Fatal(fasthttp.ListenAndServe(":5000", router.Handler)) log.Fatal(fasthttp.ListenAndServe(":5000", router.Handler))
} }

View File

@ -12,18 +12,16 @@ spec:
labels: labels:
app: example-app app: example-app
spec: spec:
imagePullSecrets:
- name: "docker-registry"
containers: containers:
- name: example-app - name: example-app
image: aimvector/example-app image: aimvector/golang:1.0.0
imagePullPolicy: Always imagePullPolicy: Always
ports: ports:
- containerPort: 80 - containerPort: 5000
livenessProbe: livenessProbe:
httpGet: httpGet:
path: /status path: /status
port: 80 port: 5000
initialDelaySeconds: 3 initialDelaySeconds: 3
periodSeconds: 3 periodSeconds: 3
resources: resources:

View File

@ -23,4 +23,6 @@ docker-compose build nodejs
# aimvector/python:1.0.0 # aimvector/python:1.0.0
docker-compose build python docker-compose build python
``` ```
Take a look at example [deployment yaml](./deployment.yaml)

View File

@ -5,3 +5,5 @@
Checkout [kubectl](./kubectl.md) for detailed steps Checkout [kubectl](./kubectl.md) for detailed steps
## Deployments ## Deployments
Checkout [deployments](./deployments/readme.md) for detailed steps