{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" }}
apiVersion: networking.k8s.io/v1beta1
{{- else }}
apiVersion: networking.k8s.io/v1
{{- end }}
kind: Ingress

metadata:
  name: octavia-api
  labels:
    app.kubernetes.io/name: {{ include "octavia.name" . }}
    helm.sh/chart: {{ include "octavia.chart" . }}
    app.kubernetes.io/instance: {{ .Release.Name }}
    app.kubernetes.io/managed-by: {{ .Release.Service }}
    system: openstack
    type: api
    component: octavia
{{- with .Values.ingress.annotations }}
  annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
  tls:
     - secretName: tls-{{ include "octavia_api_endpoint_host_public" . | replace "." "-" }}
       hosts: [{{include "octavia_api_endpoint_host_public" .}}]
  rules:
    - host: {{include "octavia_api_endpoint_host_public" .}}
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" }}
              serviceName: octavia-api
              servicePort: {{.Values.api_port_internal}}
{{- else }}
              service:
                name: octavia-api
                port:
                  number: {{.Values.api_port_internal}}
{{- end }}

{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" }}
apiVersion: networking.k8s.io/v1beta1
{{- else }}
apiVersion: networking.k8s.io/v1
{{- end }}
kind: Ingress

metadata:
  name: octavia-api
  labels:
    app.kubernetes.io/name: {{ include "octavia.name" . }}
    helm.sh/chart: {{ include "octavia.chart" . }}
    app.kubernetes.io/instance: {{ .Release.Name }}
    app.kubernetes.io/managed-by: {{ .Release.Service }}
    system: openstack
    type: api
    component: octavia
{{- with .Values.ingress.annotations }}
  annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
  tls:
     - secretName: tls-{{ include "octavia_api_endpoint_host_public" . | replace "." "-" }}
       hosts: [{{include "octavia_api_endpoint_host_public" .}}]
  rules:
    - host: {{include "octavia_api_endpoint_host_public" .}}
      http:
        paths:
          - path: /
{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" }}
            backend:
              serviceName: octavia-api
              servicePort: {{.Values.api_port_internal}}
{{- else }}
            pathType: Prefix
            backend:
              service:
                name: octavia-api
                port:
                  number: {{.Values.api_port_internal}}
{{- end }}

Fix ingress: pathType only for v1, not v1beta1
[octavia] Fix ingress: pathType only for v1, not v1beta1
