forked from Caffrey2017/kubernetes-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmean.yaml
More file actions
78 lines (78 loc) · 2.92 KB
/
Copy pathmean.yaml
File metadata and controls
78 lines (78 loc) · 2.92 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
---
kind: Deployment #指定创建资源的角色/类型
apiVersion: extensions/v1beta1 #指定api版本,此值必须在kubectl apiversion中
metadata: #资源的元数据/属性
name: mean #资源的名字,在同一个namespace中必须唯一
namespace: default
generation: 1 # 用于标识当前对象目标状态的代别;
annotations: #自定义注解列表
deployment.kubernetes.io/revision: '1' #自定义注解名字
spec: #specification of the resource content 指定该资源的内容
replicas: 1 #副本数量
selector:
matchLabels:
app: mean
template: #这里Pod的定义
metadata:
name: mean
creationTimestamp: #当前对象创建的日期时间时间戳;
labels:
app: mean
spec:
containers:
- name: mean #容器的名字
image: nginx #容器使用的镜像地址
resources: {} #资源管理
terminationMessagePath: "/dev/termination-log"
terminationMessagePolicy: File
imagePullPolicy: Always #[Always|Never|IfNotPresent]获取镜像的策略
command: {} #容器的启动命令列表(不配置的话使用镜像内部的命令)
workingDir: String #容器的工作目录
securityContext:
privileged: false
volumeMounts: #挂载到到容器内部的存储卷设置
- name: data #挂载设备的名字
mountPath: /usr/share/nginx/html #挂载到容器的某个路径下
readOnly: boolean
livenessProbe:
httpGet:
# Path to probe; should be cheap, but representative of typical behavior
path: /index.html
port: 80
initialDelaySeconds: 30
timeoutSeconds: 1
volumes: #定义一组挂载设备
- name: data #定义一个挂载设备的名字
hostPath:
path:String #挂载设备类型为hostPath,路径为宿主机下的/opt,这里设备类型支持很多种
restartPolicy: Always #表明该容器一直运行,默认k8s的策略,在此容器退出后,会立即创建一个相同的容器
terminationGracePeriodSeconds: 30
dnsPolicy: ClusterFirst
securityContext: {}
schedulerName: default-scheduler
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 25%
maxSurge: 25%
revisionHistoryLimit: 10
progressDeadlineSeconds: 600
status:
observedGeneration: 1
replicas: 1
updatedReplicas: 1
readyReplicas: 1
availableReplicas: 1
conditions:
- type: Available
status: 'True'
lastUpdateTime: ''
lastTransitionTime: ''
reason: MinimumReplicasAvailable
message: Deployment has minimum availability.
- type: Progressing
status: 'True'
lastUpdateTime: ''
lastTransitionTime: ''
reason: NewReplicaSetAvailable
message: ReplicaSet "mean-657b4c98d4" has successfully progressed.