forked from Caffrey2017/kubernetes-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpod.yaml
More file actions
55 lines (52 loc) · 1.08 KB
/
Copy pathpod.yaml
File metadata and controls
55 lines (52 loc) · 1.08 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
```
apiVersion: v1
kind: PersistentVolume
metadata:
name: pod
spec:
capacity:
storage: 1Mi
accessModes:
- ReadWriteMany
pod:
# FIXME: use the right IP
server: 07e644a3a8-rme57.cn-hangzhou.nas.aliyuncs.com
path: "/"
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: nfs
spec:
accessModes:
- ReadWriteMany
storageClassName: ""
resources:
requests:
storage: 1Mi
```
```
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: nginx
labels:
name: nginx
spec:
replicas: 2 # 镜像副本数量
template:
metadata:
labels: # 容器的标签 可和service关联
app: nginx
spec:
containers:
- name: nginx # 容器名
image: nginx:1.8 # 容器镜像
volumeMounts:
# name must match the volume name below
- name: pod
mountPath: "/pod"
volumes:
- name: pod
persistentVolumeClaim:
claimName: pod