iSula+k8s实践记录3----deployment

apiVersion: apps/v1
kind: Deployment
metadata:
  creationTimestamp: null
  labels:
    app: webserver
  name: webserver
spec:
  replicas: 3                       ######指定pod副本数
  selector:                         ######监视pod的副本数,controller干的活儿,根据标签来判断
    matchLabels:
      app: webserver
  strategy:                         #####更新策略,有两种方式,一种叫reCreate,另外一个叫rollingUpdate,其中rollingUpdate有两种方式,一种是maxUnavailable:另外一种是maxSurge,如果有二者同时存在,以maxSurge为准
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 33%
      maxSurge:
  template:
    metadata:
      creationTimestamp: null
      labels:
        app: webserver
    spec:
      containers:
      - image: nginx:1.21
        name: nginx
        resources:
          requests:
            cpu: 0.1
            memory: 100Mi
          limits:
            cpu: 0.2
            memory: 150Mi

posted @ 2022-02-10 14:44  王羊补劳  阅读(69)  评论(0)    收藏  举报