---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: <APP_NAME>
    type: frontend
  name: <APP_NAME>
spec:
  replicas: <REPLICAS>
  selector:
    matchLabels:
      app: <APP_NAME>
      type: frontend
  template:
    metadata:
      labels:
        app: <APP_NAME>
        type: frontend
    spec:
      containers:
      - name: <APP_NAME>
        image: <HARBOR>/<PROJECT>/<APP_NAME>:<BUILD_TAG>
        imagePullPolicy: Always
        env:
        - name: BUILD_ID
          value: "<BUILD_ID>"
        - name: TZ
          value: "Asia/Shanghai"
        resources:
          requests:
            memory: "128Mi"
            cpu: "50m"
          limits:
            memory: "1Gi"
            cpu: "500m"
        ports:
        - name: http
          containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: <APP_NAME>
  name: <APP_NAME>
spec:
  type: ClusterIP
  ports:
  - name: http
    port: 8080
    targetPort: 8080
  selector:
    app: <APP_NAME>
    type: frontend
---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: <APP_NAME>-nodeport
  name: <APP_NAME>-nodeport
spec:
  type: NodePort
  ports:
  - name: http
    port: 8080
    targetPort: 8080
    nodePort: <NODEPORT>
  selector:
    app: <APP_NAME>
    type: frontend