{{- if .Values.ingress.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    konghq.com/methods: GET, POST, PUT, DELETE, PATCH, OPTIONS, HEAD, TRACE
    konghq.com/protocols: http
    konghq.com/strip-path: "true"
  name: {{ include "cluster-agent.fullname" . }}
  namespace: {{ .Release.Namespace }}
spec:
  ingressClassName: kong
  rules:
  - http:
      paths:
      - backend:
          service:
            name: {{ include "cluster-agent.fullname" . }}
            port:
              number: {{ .Values.service.port }}
        path: /cluster-agent/{{ .Release.Namespace }}
        pathType: Prefix
{{- end }}
