-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathregular-nginx-deployment.yaml
More file actions
58 lines (56 loc) · 980 Bytes
/
regular-nginx-deployment.yaml
File metadata and controls
58 lines (56 loc) · 980 Bytes
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: v1
kind: ConfigMap
metadata:
name: nginx
data:
nginx.conf: |
events {}
http {
server {
location / {
add_header Content-Type text/plain;
return 200 "Hello, world!";
}
}
}
---
apiVersion: v1
kind: Service
metadata:
name: nginx
spec:
selector:
app: nginx
ports:
- port: 80
targetPort: 80
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
labels:
app: nginx
spec:
replicas: 1
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.14.2
ports:
- containerPort: 80
volumeMounts:
- mountPath: /etc/nginx # mount nginx-conf volumn to /etc/nginx
readOnly: true
name: nginx
volumes:
- name: nginx
configMap:
name: nginx # place ConfigMap `nginx-conf` on /etc/nginx