This commit is contained in:
2022-07-04 19:14:22 +08:00
parent 994a5d4b1c
commit e245893f1b
3 changed files with 98 additions and 1 deletions

View File

@@ -10,6 +10,7 @@ metadata: #译名为元数据,即 Deployment 的一些基本属性和
key2: value2
spec: #这是关于该Deployment的描述可以理解为你期待该Deployment在k8s中如何使用
replicas: 3 #使用该Deployment创建一个应用程序实例
revisionHistoryLimit: 10 # 该Deployment保留多少个旧的ReplicaSet
selector: #标签选择器,与上面的标签共同作用,目前不需要理解
matchLabels: #选择包含标签app:nginx的资源
app: nginx
@@ -33,7 +34,13 @@ spec: #这是关于该Deployment的描述可以理解为你期待该D
preStop:
exec:
command: ["/bin/sh", "-c", "nginx -s quit; while killall -o nginx; do sleep 1; done"]
limits:
resources:
limits:
cpu: 100m
memory: 200Mi
requests:
cpu: 100m
memory: 200Mi
# These containers are run during pod initialization
initContainers:
- name: install