#@ load("@ytt:data", "data")
#@ load("helpers.star", "fullname")
#@ load("helpers.lib.yml", "metadata")

#@ if/end data.values.ingress:
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata: #@ metadata(data.values)
spec:
  rules:
    #@ for/end host in data.values.ingress.hosts:
    - host: #@ host
      http:
        paths:
          - path: /
            backend:
              serviceName: #@ fullname(data.values)
              servicePort: #@ data.values.service.externalPort
