apiVersion: apps/v1
kind: Deployment
metadata:
  name: mes-antd-admin
  namespace: sealers-test
  labels:
    app: mes-antd-admin
spec:
  replicas: 1
  revisionHistoryLimit: 5
  selector:
    matchLabels:
      app: mes-antd-admin
  template:
    metadata:
      labels:
        app: mes-antd-admin
    spec:
      containers:
      - name: bmes-antd-admin
        image: registry.gitlab.com/seasoul/mes-antd-admin:latest
        imagePullPolicy: Always
        ports:
        - containerPort: 80
        readinessProbe:
          tcpSocket:
            port: 80
          initialDelaySeconds: 5
          periodSeconds: 10
        livenessProbe:
          tcpSocket:
            port: 80
          initialDelaySeconds: 15
          periodSeconds: 20
        resources:
          requests:
            cpu: 50m
            memory: 64Mi
          limits:
            cpu: 200m
            memory: 256Mi
        volumeMounts:
        - name: timezone
          mountPath: /etc/localtime
        # ============EnvSetttingStart===========
        # 该内容为gozero-batch生成的内容，请不要手动修改
        env: # 环境变量
          - name: API_SERVER_HOST # Api服务地址
            value: http://zxx4.f3322.net # 请在files-settings.yaml中修改
        # 该内容为gozero-batch生成的内容，请不要手动修改
        # ============EnvSetttingEnd===========
      imagePullSecrets:
      - name: gitlab
      volumes:
        - name: timezone
          hostPath:
            path: /usr/share/zoneinfo/Asia/Shanghai

---

apiVersion: v1
kind: Service
metadata:
  name: mes-antd-admin-svc
  namespace: sealers-test
spec:
  ports:
  - port: 19001
    targetPort: 19001
  selector:
    app: mes-antd-admin

---

apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
  name: mes-antd-admin-hpa-c
  namespace: sealers-test
  labels:
    app: mes-antd-admin-hpa-c
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: mes-antd-admin
  minReplicas: 1
  maxReplicas: 50
  metrics:
  - type: Resource
    resource:
      name: cpu
      targetAverageUtilization: 80

---

apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
  name: mes-antd-admin-hpa-m
  namespace: sealers-test
  labels:
    app: mes-antd-admin-hpa-m
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: mes-antd-admin
  minReplicas: 1
  maxReplicas: 50
  metrics:
  - type: Resource
    resource:
      name: memory
      targetAverageUtilization: 80
