apiVersion: apps/v1
kind: Deployment
metadata:
  name: zkui
  namespace: default
  labels:
    app: zkui
spec:
  replicas: 1
  selector:
    matchLabels:
      app: zkui
#  minReadySeconds: 60     #滚动升级时60s后认为该pod就绪
  strategy:
    rollingUpdate:  ##由于replicas为3,则整个升级,pod个数在2-4个之间
      maxSurge: 1      #滚动升级时会先启动1个pod
      maxUnavailable: 1 #滚动升级时允许的最大Unavailable的pod个数
  template:
    metadata:
      labels:
        app: zkui
    spec:
      #nodeSelector:  #	指派特定的节点
      #  env: test-team
      terminationGracePeriodSeconds: 60 ##k8s将会给应用发送SIGTERM信号，可以用来正确、优雅地关闭应用,默认为30秒
      #imagePullSecrets:
      #- name: registrykey-ali-ext
      containers:
      - name: zkui
        #image: maauso/zkui
        image: slpcat/zkui
        imagePullPolicy: Always
        resources:
          # keep request = limit to keep this container in guaranteed class
          requests:
            cpu: 50m
            memory: 64Mi
          limits:
            cpu: 1000m
            memory: 4Gi
        securityContext:
          capabilities: {}
          privileged: false
        env:
          - name: ZKLIST
            value: "zk-0.zk-svc.default.svc.cluster.local:2181,zk-1.zk-svc.default.svc.cluster.local:2181,zk-2.zk-svc.default.svc.cluster.local:2181"
        ports:
          - name: zkui
            containerPort: 9090
