forked from Azure-Samples/openhack-containers
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwalk-through-sample.yaml
More file actions
58 lines (57 loc) · 1.47 KB
/
walk-through-sample.yaml
File metadata and controls
58 lines (57 loc) · 1.47 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
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-app-deployment
namespace: my-app
labels:
app: my-app-deployment
spec:
replicas: 3
selector:
matchLabels:
app: my-app
template:
metadata:
labels:
app: my-app
spec:
containers:
- name: my-app
image: "{{<acr registry name>.azurecr.io/<name of acr registry>:<tag>}}"
ports:
- containerPort: 80
env:
- name: ENV_VAR_NAME
value: "Value of environment variable"
envFrom:
- secretRef:
name: {{name of your secret in kubernetes}}
# not required, but recommended best practice
livenessProbe:
httpGet:
path: "{{url path you want to check}}" # hint: there is a healthcheck endpoint - read the README!
port: 80
initialDelaySeconds: 10
periodSeconds: 30
readinessProbe:
httpGet:
path: "{{url path you want to check}}"
port: 80
initialDelaySeconds: 5
periodSeconds: 5
# resource limits are also best practice - I'll let you figure that out on your own
---
apiVersion: v1
kind: Service
metadata:
name: my-app
namespace: my-app
spec:
type: ClusterIP #LoadBalancer
selector:
app: my-app
ports:
- protocol: TCP
name: my-app-http
port: 80 # port you hit
targetPort: 80 # port inside container