name: lab3

services:
  database:
    type: rds
    name: alibabaRds

  data-api:
    type: webservice
    image: artursouza/rudr-data-api:0.50
    name: data-api
    port: 3009
    env:
      - name: DATABASE_NAME
        value: postgres
      - name: DATABASE_DRIVER
        value: postgresql
      - name: DATABASE_HOSTNAME
        valueFrom:
          secretKeyRef: 
            name: db-conn
            key: endpoint
      - name: DATABASE_USER 
        valueFrom:
          secretKeyRef: 
            name: db-conn
            key: username
      - name: DATABASE_PASSWORD
        valueFrom:
          secretKeyRef:
            name: db-conn
            key: password
      - name: DATABASE_PORT
        value: "1921"

  flights-api:
    type: webservice
    image: sonofjorel/rudr-flights-api:0.49
    name: flights-api
    port: 3003
    env:
      - name: DATA_SERVICE_URI 
        value: http://data-api.default.svc.cluster.local:8080/

  quakes-api:
    type: webservice
    image: sonofjorel/rudr-quakes-api:0.49
    name: quakes-api
    port: 3012
    env:
      - name: DATA_SERVICE_URI 
        value: http://data-api.default.svc.cluster.local:8080/

  weather-api:
    type: webservice
    image: sonofjorel/rudr-weather-api:0.49
    name: weather-api
    port: 3015
    env:
      - name: DATA_SERVICE_URI 
        value: http://data-api.default.svc.cluster.local:8080/

  web-ui:
    type: webservice
    image: sonofjorel/rudr-web-ui:0.49
    name: web-ui
    port: 8080
    route:
      domain: kubevela.kubecon.demo
    env:
      - name: FLIGHT_API_ROOT
        value: http://flights-api.default.svc.cluster.local:8080/
      - name: WEATHER_API_ROOT
        value: http://weather-api.default.svc.cluster.local:8080/
      - name: QUAKES_API_ROOT
        value: http://quakes-api.default.svc.cluster.local:8080/


  
