-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeployment.yaml
63 lines (63 loc) · 1.7 KB
/
deployment.yaml
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
apiVersion: apps/v1
kind: Deployment
metadata:
name: myapp
spec:
replicas: 2
selector:
matchLabels:
app: myapp
# Update pods with rolling update
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
labels:
app: myapp
spec:
containers:
- name: myapp
image: httpd:latest
ports:
- containerPort: 80
args:
- /bin/sh
- -c
- echo "<!DOCTYPE html><html><body><h1>Welcome ${MY_POD_IP} - ${MY_POD_NAME}</h1></body></html>" > /usr/local/apache2/htdocs/index.html; echo 'ready' > /usr/local/apache2/htdocs/host.html; httpd-foreground
env:
- name: MY_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: MY_POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
resources:
requests:
memory: "64Mi"
cpu: "128m"
limits:
memory: "128Mi"
cpu: "250m"
readinessProbe:
failureThreshold: 1
exec:
command:
- ls
- /usr/local/apache2/htdocs/host.html
initialDelaySeconds: 10
periodSeconds: 3
successThreshold: 1
timeoutSeconds: 1
livenessProbe:
httpGet:
path: /
port: 80
initialDelaySeconds: 10
periodSeconds: 3
successThreshold: 1
timeoutSeconds: 1