Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Json schema validation fails when using traefik-crds as chart dependency #1311

Open
2 tasks done
Soortor opened this issue Jan 15, 2025 · 6 comments
Open
2 tasks done
Labels
area/documentation Improvements or additions to documentation kind/question Further information is requested

Comments

@Soortor
Copy link

Soortor commented Jan 15, 2025

Welcome!

  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've searched similar issues on the Traefik community forum and didn't find any.

What version of the Traefik's Helm Chart are you using?

1.1.0

What version of Traefik are you using?

34.0.0

What did you do?

We deploy many of our applications with ArgoCD by defining them as subcharts.
For Traefik this works, but for Traefik-crds this does not as the additionalProperties is set to false in the .schema.yaml

Example chart.yaml to reproduce:

apiVersion: v2
name: traefik-crds
description: Traefik CRDS Helm Chart

version: 1.0.0

dependencies:
  - name: traefik-crds
    version: 1.1.0
    repository: https://traefik.github.io/charts

The expectation is that this renders a helm template with default values.

What did you see instead?

$ helm template .
Error: values don't meet the specifications of the schema(s) in the following chart(s):
gateway:
- (root): Additional property global is not allowed

What is your environment & configuration?

ArgoCD

Additional Information

Similar issue reported here: https://github.com/helm/helm/issues/10392#issuecomment-1091673838
It appears that helm implicitly injects a global section from the parent chart, which is not allowed by the subchart.
@darkweaver87
Copy link
Contributor

darkweaver87 commented Jan 15, 2025

Hello @Soortor ,

Thanks for reporting this.
Those charts needs to be used separately (cf. https://github.com/traefik/traefik-helm-chart/blob/master/README.md#an-installation-with-additional-crds-chart).
After a lot of tests we intentionally removed the dependency from the original PR.
I'll recommand you to use one application dependencies instead.
We will open a PR to detail the reasons so it will be explicit in the README.

Rémi

@mloiseleur mloiseleur added area/documentation Improvements or additions to documentation kind/question Further information is requested and removed status/0-needs-triage labels Jan 15, 2025
@Soortor
Copy link
Author

Soortor commented Jan 15, 2025

Instead of loading as a subchart, we ended up loading the chart directly via ArgoCD.
This also solves the aforementioned issue regarding the global property being propagated to the Traefik CRDS chart.

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: traefik-crds
  namespace: argocd
  finalizers:
    - resources-finalizer.argocd.argoproj.io
spec:
  project: default
  source:
    chart: traefik-crds
    repoURL: https://traefik.github.io/charts
    targetRevision: 1.1.0
  destination:
    server: https://kubernetes.default.svc
  syncPolicy:
    automated:
      prune: true
      selfHeal: true

@darkweaver87
Copy link
Contributor

I'm glad to see that it works 👍
I'll let this issue opened to not forgot to create a PR for the documentation part I mentioned :-)

@cirias
Copy link

cirias commented Jan 23, 2025

Hi! I just ran into the same issue as well. I understand that additionalProperties should stay being false to prevent the old traefik only values accidentally leaks to this new crds chart. But can we at least add a dummy global property, like this, just to unblock people using subchart?

@darkweaver87
Copy link
Contributor

Hello @cirias ,

I'll look into it with other maintainers.

Rémi

@Nitive
Copy link

Nitive commented Jan 28, 2025

I faced this problem as well through not when using chart as subchart. I'm installing chart with helmfile and use global.cluster=<my-cluster> value for all charts. Unfortunately, it breaks CRDs chart instead of being ignored.

helmDefaults:
  kubeContext: my-cluster
  args:
    - "--set global.cluster=my-cluster"

repositories:
  - name: traefik
    url: https://traefik.github.io/charts

releases:
  - name: crds
    namespace: traefik-ingress-controller
    chart: traefik/traefik-crds

Workaround

My workaround is to use skipSchemaValidation: true option for CRDs release (requires helm 3.16+ and fresh versions of helmfile and helm-diff)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/documentation Improvements or additions to documentation kind/question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants