Skip to content

Add extraObjects value that allows creating supportive / adhoc resources #595

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

Closed
2 tasks done
colearendt opened this issue May 10, 2022 · 3 comments · Fixed by #643
Closed
2 tasks done

Add extraObjects value that allows creating supportive / adhoc resources #595

colearendt opened this issue May 10, 2022 · 3 comments · Fixed by #643
Labels
kind/proposal a proposal that needs to be discussed.

Comments

@colearendt
Copy link

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?

There is a pattern I have recently been made aware of in helm charts to create an extraObjects value, evaluated as a template (similar to discussion on #588 ), which allows deploying supporting kubernetes resources along with the traefik deployment.

In many cases, it can avoid the need for additional (fake helm chart w/ a few resources), extended (chart that extends the traefik chart), or adhoc deployments (kubectl apply and friends).

We discussed before adding to our helm charts here: rstudio/helm#115

I'm not sure if Bitnami deserves the original credit, but they call their value extraDeploy. We thought extraObjects was a better name in our context 🤷

In any case, I would be happy to write a PR with the functionality if it seems like a welcome addition. In particular, we would use it immediately for:

  • a couple of IngressRoutes that are related to the traefik service (i.e. exposing the dashboard, etc.)
  • a couple of Middlewares that are used commonly by lots of our services (and thus are more appropriately scoped to traefik)

Our implementation:
https://github.com/rstudio/helm/blob/ac2ad2b2e3c84309a456f6229934e5170c82164e/charts/rstudio-library/templates/_tplvalues.tpl#L6-L14

https://github.com/rstudio/helm/blob/ac2ad2b2e3c84309a456f6229934e5170c82164e/charts/rstudio-connect/templates/extra-objects.yaml#L1-L4

@mloiseleur
Copy link
Member

mloiseleur commented Sep 29, 2022

Hello @colearendt

Thanks for your interest in Traefik !

We will think about it. In the mean time, as you noticed, you can include this chart as a sub-chart of your own.

We plan to merge #373 soon, in order to help.

@colearendt
Copy link
Author

colearendt commented Sep 29, 2022

That's definitely a possible workaround. However, it is a noteworthy amount of tedious work tracking upstream versions of the traefik chart, all to add something that could (IMO should) be considered "baseline functionality." How many such charts w/ traefik as a sub-chart will be created by the community because some CRD is needed to set up a baseline functional traefik instance w/ appropriate middlewares / etc.? Trusting the traefik chart directly is easier for most orgs than some random guy on the internet (i.e. me) 😄

For instance, traefik v1 allowed creating middlewares via annotations. v2 has moved to using CRDs:

https://community.traefik.io/t/global-middleware-with-kubernetes-crd/9908/2?u=_cole
https://community.traefik.io/t/annotations-for-rewrite-and-other-features-in-v2/10971/2?u=_cole

In practice, this means that the traefik chart is less useful by itself. extraObjects is a nice escape hatch because it allows

  1. minimal maintenance on the chart side (i.e. better than having config sections for every type of CRD)
  2. appropriate flexibility to deploy traefik as needed using the chart directly
  3. no myriad of third-party chart forks / trivial embedding
  4. scoping "global" middlewares appropriately to the traefik service rather than duplicating middlewares on upstream applications everywhere

It's also worth noting that my experience with sub-charts is less than ideal. Lots of complexities can be introduced by the namespacing that it creates. It may be fine in this case, but it's certainly not my favorite thing in the world to do 😄

@mloiseleur mloiseleur linked a pull request Oct 3, 2022 that will close this issue
1 task
@mloiseleur
Copy link
Member

mloiseleur commented Oct 3, 2022

@colearendt It's been accepted and it's now available. See #643.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/proposal a proposal that needs to be discussed.
Projects
None yet
3 participants