I have the following definition of ingress.yaml
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "onion.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1
{{- else -}}
apiVersion: networking.k8s.io/v1
{{- end }}
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{- include "onion.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ . }}
backend:
serviceName: {{ $fullName }}
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}
And the value.yaml created is as below:
ingress:
name: external
enabled: true
type: LoadBalancer
annotations:
kubernetes.io/ingress.class: "nginx-environment"
hosts:
- host: "onion.api.environment.cloud.google.com"
http:
paths:
- backend:
serviceName: internal
servicePort: 8081
path: "/"
tls:
- secretName: "onion.api.environment.cloud.google.com-tls"
hosts:
- "onion.api.environment.cloud.google.com"
- "*.cloud.google.com"
I keep getting the following error: Error: unable to build kubernetes objects from release manifest: error validating "": error validating data: ValidationError(Ingress.spec.rules[0].http): missing required field "paths" in io.k8s.api.networking.v1.HTTPIngressRuleValue
Can someone advice please what am I doing wrong in the values.yaml file?