---
version: 1
kind: component

requires:
- kubernetes
- helm

provides:
- ingress

parameters:
- name: hub.componentName
- name: ingress.class
  value: nginx
- name: ingress.isDefault
  value: true

- name: kubernetes
  parameters: 
  - name: namespace
    value: kube-ingress
    env: NAMESPACE

- name: nlb
  parameters:
  - name: name
    empty: allow
    env: NLB_NAME
  - name: backendPortHttp
    empty: allow
  - name: backendPortHttps
    empty: allow      

- name: nginx
  parameters:
  - name: replicaCount
    value: 1
  - name: serviceType
    value: LoadBalancer
  - name: image
    value: nginx/nginx-ingress
  - name: imageTag
    value: 3.0.1
  - name: loadBalancerSourceRanges
    empty: allow
  - name: externalTrafficPolicy
    value: Cluster
  - name: enableSnippets
    value: true

- name: helm
  parameters:
  - name: chart
    value: "nginx-ingress"
    env: HELM_CHART
  - name: repo
    value: https://helm.nginx.com/stable
    env: HELM_REPO
  - name: version
    value: 0.16.1
    env: HELM_CHART_VERSION
  - name: baseValuesFile
    value: values.yaml
    env: CHART_VALUES_FILE

templates:
  kind: go
  files: ["*.gotemplate"]
