钟日健
2022-03-15 585a822b6ebee53a7c33d9ae09e4dfa9c483d23f
新增 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: zhba-vue
  name: zhba-vue
  namespace: zhba   #一定要写名称空间
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  selector:
    matchLabels:
      app: zhba-vue
  strategy:
    rollingUpdate:
      maxSurge: 50%
      maxUnavailable: 50%
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: zhba-vue
    spec:
      imagePullSecrets:
        - name: aliyun  #提前在项目下配置访问阿里云的账号密码
      containers:
        # - image: $REGISTRY/$ALIYUNHUB_NAMESPACE/zhba-vue:SNAPSHOT-$BUILD_NUMBER
        - image: registry.cn-hangzhou.aliyuncs.com/arsn/zhba-vue:SNAPSHOT-1
          imagePullPolicy: Always
          name: app
          ports:
            - containerPort: 80
              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: zhba-vue
  name: zhba-vue
  namespace: zhba
spec:
  ports:
    - name: http
      port: 80
      protocol: TCP
      targetPort: 80
      nodePort: 32248
  selector:
    app: zhba-vue
  sessionAffinity: None
  type: NodePort