Skip to content

Commit 2001194

Browse files
updates to kubernetes deployments
1 parent a866427 commit 2001194

File tree

5 files changed

+14
-7
lines changed

5 files changed

+14
-7
lines changed

docker-compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ services:
1515
image: aimvector/golang:1.0.0
1616
build:
1717
context: ./golang
18-
target: debug
18+
target: prod
1919
volumes:
2020
- ./golang/src/:/go/src/work/
2121
ports:

golang/src/main.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,17 @@ import (
1111
func Response(ctx *fasthttp.RequestCtx) {
1212
fmt.Fprintf(ctx, "Hello")
1313
}
14+
15+
func Status(ctx *fasthttp.RequestCtx) {
16+
fmt.Fprintf(ctx, "ok")
17+
}
1418
func main() {
1519

1620
fmt.Println("starting...")
1721

1822
router := fasthttprouter.New()
1923
router.GET("/", Response)
24+
router.GET("/status", Status)
2025

2126
log.Fatal(fasthttp.ListenAndServe(":5000", router.Handler))
2227
}

kubernetes/deployments/deployment.yaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,16 @@ spec:
1212
labels:
1313
app: example-app
1414
spec:
15-
imagePullSecrets:
16-
- name: "docker-registry"
1715
containers:
1816
- name: example-app
19-
image: aimvector/example-app
17+
image: aimvector/golang:1.0.0
2018
imagePullPolicy: Always
2119
ports:
22-
- containerPort: 80
20+
- containerPort: 5000
2321
livenessProbe:
2422
httpGet:
2523
path: /status
26-
port: 80
24+
port: 5000
2725
initialDelaySeconds: 3
2826
periodSeconds: 3
2927
resources:

kubernetes/deployments/readme.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,6 @@ docker-compose build nodejs
2323
# aimvector/python:1.0.0
2424
docker-compose build python
2525
26-
```
26+
```
27+
28+
Take a look at example [deployment yaml](./deployment.yaml)

kubernetes/readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@
55
Checkout [kubectl](./kubectl.md) for detailed steps
66

77
## Deployments
8+
9+
Checkout [deployments](./deployments/readme.md) for detailed steps

0 commit comments

Comments
 (0)