Percona Pmm helm upgrade failed: error converting YAML to JSON: yaml: line 14: did not find expected key

50 Views Asked by At

Trying to update our percona pmm instance ingress values and this error is getting thrown:

Error: UPGRADE FAILED: YAML parse error on pmm/templates/ingress.yaml: error converting YAML to JSON: yaml: line 14: did not find expected key

I tried both with manual line by line commands as well as applying a values.yaml file:

helm upgrade pmm percona/pmm \
  --set ingress.enabled=true \
  --set ingress.nginxInc=true \
  --set ingress.ingressClassName=testprivate \
  --set ingress.hosts[0].host=pmm-tst-test.test-private.com \
  --set ingress.hosts[0].paths={} \
  --set ingress.tls[0].secretName=pmm-certificate 

As well as the values.yaml:

ingress:
  enabled: true
  nginxInc: true
  annotations: {}
    # Add specific annotations here if needed
  community:
    annotations: {}
    # Add annotations for community-managed ingress here if needed
  ingressClassName: "testprivate"
  hosts:
    - host: pmm-tst-test.test-hos.com
      paths: []
  pathType: Prefix
  tls:
    - secretName: pmm-certificates

Pulled down the chart to grab the context for line 14 on ingress.yaml (line 14 in bold):

{{- if .Values.ingress.enabled -}}
{{- $serviceName := .Values.service.name -}}
{{- $servicePort := (index $.Values.service.ports 1).port  -}}
{{- $ingressPathType := .Values.ingress.pathType -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: {{ include "pmm.fullname" . }}
  labels:
    {{- include "pmm.labels" . | nindent 4 }}
**{{- if or .Values.ingress.annotations .Values.ingress.nginxInc }}**
  annotations:
    {{- toYaml .Values.ingress.annotations | nindent 4 }}
    {{- if .Values.ingress.nginxInc }}
    nginx.org/ssl-services: {{ $serviceName }}-grpc
    nginx.org/grpc-services: {{ $serviceName }}-grpc
    {{- end }}
{{- end }}

At wits ends here, any idea what im missing? Ive confirmed the secret exists, I have an nginx ingress controller deployed, and ive been able to alter all other values for the instance besides this one? Can anyone point me in the right direction?

1

There are 1 best solutions below

0
Vetements On

Figured it out.

The issue was that i had both ingress and nginx set to true. I had an nginx ingress controller placed in front of it, however because i also had the ingress value set to "true" it was expecting further configuration for the default ingress, hence the error message about a missing key. Setting it to false while keeping nginx true resolved it.

ingress:
  enabled: false
  nginxInc: true
  annotations: {}