---
version: 1
kind: component

requires:
  - kubernetes
  - helm

parameters:
  - name: hub.componentName

  - name: ingress
    empty: allow
    parameters:
      - name: protocol
        value: http
      - name: class
        empty: allow
      - name: hosts
        env: INGRESS_HOSTS

  - name: nginx
    parameters:
      - name: maxUploadSize
        value: "1024m"
      - name: uploadTimeout
        value: "1800"
      - name: readTimeout
        value: "1800"

  - name: istio
    parameters:
      - name: namespace
        value: istio-system
        env: NAMESPACE
      - name: version
        value: 1.15.0
        env: CHART_VERSION
      - name: replicas
        value: 1
      - name: serviceType
        value: ClusterIP
  - name: helm.chart
    parameters:
      - name: name
        value: "gateway"
        env: HELM_CHART
      - name: repo
        empty: allow
        value: https://istio-release.storage.googleapis.com/charts
        env: HELM_REPO

outputs:
  - name: istio.ingressGateway
    value: ${hub.componentName}

templates:
  files:
    - "*.template"
  extra:
    - kind: go
      files:
        - "*.gotemplate"
