---
apiVersion: v1
kind: Service
metadata:
  name: adm-middleware
  labels:
    app: adm-middleware
spec:
  selector:
    app: adm-middleware
  ports:
    - port: 8080
      targetPort: 8080
      name: server-port

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: adm-middleware
spec:
  replicas: 1
  selector:
    matchLabels:
      app: adm-middleware
  template:
    metadata:
      labels:
        app: adm-middleware
    spec:
      containers:
        - name: adm-middleware
          image: labisenlin.persagy.com/library/adm-middleware:latest
          imagePullPolicy: Always
          ports:
            - containerPort: 8080
              name: server-port
          env:
            - name: TZ
              value: Asia/Shanghai
            - name: SERVER_PORT
              value: "8080"
            - name: SPRING_CLOUD_CONFIG_URI
              value: "http://integrated-config:8080"
            - name: SPRING_PROFILES_ACTIVE
              value: "dev"
            - name: SPRING_CLOUD_CONFIG_PROFILE
              value: "dev"
            - name: EUREKA_CLIENT_DEFAULT_ZONE
              value: "http://frame:123456@integrated-eureka:8080/integrated-eureka/eureka/"
            - name: logging.config
              value: classpath:logback-spring.xml
            - name: eureka.instance.status-page-url
              value: "http://${eureka.instance.ip-address}:${eureka.instance.non-secure-port}/${spring.application.name}/info"
            - name: eureka.instance.non-secure-port-enabled
              value: "true"
            - name: eureka.instance.ip-address
              value: "adm-middleware"
            - name: eureka.instance.health-check-url
              value: "http://${eureka.instance.ip-address}:${eureka.instance.non-secure-port}/${spring.application.name}/health"
            - name: eureka.instance.non-secure-port
              value: "8080"
            - name: persagy.common.auth.channel
              value: "1"
            - name: persagy.common.auth.context.source
              value: "false"
            - name: saas.ems.web.service
              value: "http://revit-algorithm:8080"
            - name: persagy.common.sql.limit
              value: "100000"