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

Skip applying CRDs in main traefik helm chart. #1315

Open
2 tasks done
PurseChicken opened this issue Jan 20, 2025 · 2 comments
Open
2 tasks done

Skip applying CRDs in main traefik helm chart. #1315

PurseChicken opened this issue Jan 20, 2025 · 2 comments

Comments

@PurseChicken
Copy link

PurseChicken commented Jan 20, 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 did you expect to see?

Now that traefik-crds exist as a separate chart, we need another way to "skip" applying the CRDs from the main traefik helm chart.

Currently the only option is to use the helm option of --skip-crds. This is not ideal as there may be other ways that the chart is applied beyond using helm directly. ArgoCD specifically allows you to use .spec.source.helm.skipCrds: true but using this in an application set means that it applies to every application manifest derived from the application set. As you can imagine this is not ideal.

There are a few options that I think can be considered:

1. Completely remove the CRDs from the traefik chart and require applying CRDs with the separate chart (bonus here is that you only have to manage CRDs in one place):

helm install traefik-crds traefik/traefik-crds
helm install traefik traefik/traefik

2. Convert existing traefik/crds directory to a sub-chart. Reference it as a dependency chart enabled by a key value pair.

Example:

values.yaml:

crds:
  enabled: true

Chart.yaml:

dependencies:
    - name: crds
      version: "1.2.0"
      condition: crds.enabled

traefik/crds/Chart.yaml:

apiVersion: v2
name: crds
version: 1.2.0

3. Change CRD manifests to include if block based on key value pair in values:

exampleCrdManifest.yaml:

{{- if .Values.crds.enabled }}
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
........
......
....
..
{{- end }}

values.yaml:

crds:
  enabled: true
@PurseChicken PurseChicken changed the title Add ability to completely skip applying CRDs Skip applying CRDs in main traefik helm chart. Jan 20, 2025
@grantcarthew
Copy link

More context from a Google Cloud Platform perspective.

Googles documentation states to enable the Gateway API as either an option on the deployment of a new cluster or executing a command against an existing cluster:

https://cloud.google.com/kubernetes-engine/docs/how-to/deploying-gateways

This gives you the Gateway API CRDs to support the GKE Gateway Controller:

https://cloud.google.com/kubernetes-engine/docs/concepts/gateway-api#gateway_controller

The Gateway API CRDs should not be deployed as part of a cluster add-on such as Traefik as has been stated.

That said, the CRDs for Traefik use such as the IngressRoute, Middleware, etc, should be deployed with Traefik.

Maybe a thirdPartyCrds.enabled option, or include the Gateway API CRDs with gateway.enabled?

@PurseChicken
Copy link
Author

PurseChicken commented Jan 23, 2025

@grantcarthew There is already a separate chart for traefik CRDs in which you can disable gateway-api crds when deploying in GKE:

https://github.com/traefik/traefik-helm-chart/tree/master/traefik-crds

The current recommended approach for using this separate chart is to deploy traefik using the --skip-crds helm flag. E.G.

helm install traefik-crds traefik/traefik-crds
helm install traefik traefik/traefik --skip-crds

This Github Issue was created because not everyone uses helm directly so using --skip-crds is not a valid option. Or at least not one that addresses different ways of deploying traefik. In my case, with a broad ArgoCD application set.

I believe the best approach here is to remove the CRDs altogether from the main traefik chart and require the use of the traefik-crds chart. If that's not acceptable then we need a way to remove the CRD's from the main chart beyond using the --skip-crds helm flag. Some ways to do this are outlined in the OP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants