智慧保安后台管理-外网项目备份
钟日健
2022-03-14 37195358e6f51a9df7d7666137ebfaa45a393b28
新增 deploy 部署文件
1 files added
61 ■■■■■ changed files
deploy/deploy.yml 61 ●●●●● patch | view | raw | blame | history
deploy/deploy.yml
New file
@@ -0,0 +1,61 @@
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: zhbaw
  name: zhbaw
  #一定要写名称空间
  namespace: zhba
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  selector:
    matchLabels:
      app: zhbaw
  strategy:
    rollingUpdate:
      maxSurge: 50%
      maxUnavailable: 50%
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: zhbaw
    spec:
      imagePullSecrets:
        - name: aliyun  #提前在项目下配置访问阿里云的账号密码
      containers:
#        - image: registry.cn-hangzhou.aliyuncs.com/arsn/myf:SNAPSHOT-50
        - image: $REGISTRY/$DOCKERHUB_NAMESPACE/zhba:SNAPSHOT-$BUILD_NUMBER
          imagePullPolicy: Always
          name: app
          ports:
            - containerPort: 81
              protocol: TCP
          resources:
            limits:
              cpu: 300m
              memory: 600Mi
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: zhbaw
  name: zhbaw
  namespace: zhba
spec:
  ports:
    - name: http
      port: 81
      protocol: TCP
      targetPort: 81
  selector:
    app: zhbaw
  sessionAffinity: None
  type: ClusterIP