apiVersion: apps/v1
kind: Deployment
metadata:
  name: frontend
spec:
  selector:
    matchLabels:
      app: frontend
  template:
    metadata:
      labels:
        app: frontend
    spec:
      containers:
        - name: frontend
          image: frontend:1.0.0-SNAPSHOT
          ports:
            - containerPort: 8080
          env:
            - name: dubbo.registry.address
              value: "nacos://nacos-server:8848"
            - name: spring.cloud.nacos.discovery.server-addr
              value: "nacos-server:8848"
            - name: spring.cloud.nacos.config.server-addr
              value: "nacos-server:8848"
          # resources:
          #   requests:
          #     cpu: 100m
          #     memory: 64Mi
          #   limits:
          #     cpu: 200m
          #     memory: 128Mi
---
apiVersion: v1
kind: Service
metadata:
  name: frontend
spec:
  type: ClusterIP
  selector:
    app: frontend
  ports:
    - name: http
      port: 8080
      targetPort: 8080
---
apiVersion: v1
kind: Service
metadata:
  name: frontend-external
spec:
  type: LoadBalancer
  selector:
    app: frontend
  ports:
    - name: http
      port: 8080
      targetPort: 8080