forked from fabianlee/golang-github-action-example
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgolang-github-action-example.yaml
More file actions
86 lines (77 loc) · 1.88 KB
/
golang-github-action-example.yaml
File metadata and controls
86 lines (77 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: golang-hello-world-web
# allow for override: kubectl -n <ns> apply ...
#namespace: default
spec:
selector:
matchLabels:
app: golang-hello-world-web
# kubectl scale --replicas=x deployment/golang-hello-world-web
replicas: 1
template:
metadata:
labels:
app: golang-hello-world-web
annotations:
sidecar.istio.io/inject: "false"
spec:
# scaled up deployment will go to different nodes
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- golang-hello-world-web
topologyKey: "kubernetes.io/hostname"
containers:
- name: golang-hello-world-web
image: fabianlee/golang-github-action-example:1.0.0
# resource limits
resources:
requests:
memory: "8Mi"
cpu: "500m" # half a vcpu
limits:
memory: "16Mi"
cpu: "1000m" # whole vcpu
#env:
# default message
#- name: foo
# value: bar
livenessProbe:
httpGet:
path: /
port: 8080
initialDelaySeconds: 3
periodSeconds: 3
readinessProbe:
httpGet:
path: /
port: 8080
initialDelaySeconds: 3
periodSeconds: 3
restartPolicy: Always
---
apiVersion: v1
kind: Service
metadata:
name: golang-hello-world-web-service
#namespace: default
labels:
app: golang-hello-world-web
spec:
ports:
# port=available to other containers
- port: 8080
name: http
# targetPort=exposed from inside container
targetPort: 8080
protocol: TCP
selector:
app: golang-hello-world-web