kubernetes 调度过程

本页内容

k8s 调度过程

k8s

执行滚动升级

修改 deployment.yml 文件,追加 rollingUpdate

 1# 部署应用
 2apiVersion: apps/v1
 3kind: Deployment
 4metadata:
 5  name: jobcher-blog-deployment
 6  labels:
 7    app: jobcher-blog
 8spec:
 9  replicas: 3
10  selector:
11    matchLabels:
12      app: jobcher-blog
13  minReadySeconds: 10 #准备10s
14  strategy:
15    type: RollingUpdate
16    rollingUpdate:
17      maxUnavailable: 1 #更新期间不少于3-1
18      maxSurge: 1 #更新期间不超过3+1
19  template:
20    metadata:
21      labels:
22        app: jobcher-blog
23    spec:
24      containers:
25        - name: jobcher-blog-pod
26          image: hub.docker.com/blog/hugo:latest

执行命令

kubectl rollout restart deployment jobcher-blog-deployment