0

I try to use helmfile to run applications on the k8s node. I get an error with the file:

apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
  name: redirectscheme
  namespace: {{ .Values.namespace }}
spec:
  redirectScheme:
    scheme: https
    permanent: false
---
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
  name: stsheaders
  namespace: {{ .Values.namespace }}
spec:
  headers:
    forceSTSHeader: true
    stsSeconds: 31536000
    stsIncludeSubdomains: true
    stsPreload: true
---
 apiVersion: traefik.containo.us/v1alpha1
 kind: Middleware
 metadata:
   name: stripprefix-frontend
   namespace: {{ .Values.namespace }}

Error:

COMBINED OUTPUT:

WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: /home/kowal/.kube/config

WARNING: Kubernetes configuration file is world-readable. This is insecure. Location: /home/kowal/.kube/config

Release "frontend" does not exist. Installing it now.

Error: YAML parse error on frontend-app/templates/middleware.yaml: error converting YAML to JSON: yaml: line 2: mapping values are not allowed in this context

I have no idea what's wrong. Please help.

gumiss
  • 1
  • 1
  • now i just saw the wrong space 5 lines from the bottom. – gumiss Feb 18 '22 at 16:11
  • If the space is a problem, you might want to file a bug since this is allowed by the YAML spec and would thus be a spec violation. – flyx Feb 18 '22 at 16:14

1 Answers1

0

I think you may have answered your own question? Superfluous spaces on last five lines.

apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
  name: redirectscheme
  namespace: {{ .Values.namespace }}
spec:
  redirectScheme:
    scheme: https
    permanent: false
---
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
  name: stsheaders
  namespace: {{ .Values.namespace }}
spec:
  headers:
    forceSTSHeader: true
    stsSeconds: 31536000
    stsIncludeSubdomains: true
    stsPreload: true
---
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
  name: stripprefix-frontend
  namespace: {{ .Values.namespace }}
Robin Webb
  • 1,355
  • 1
  • 8
  • 15