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

feat(argo-cd): Allow chart to be deployed and only ship CRDs #2299

Closed
wants to merge 4 commits into from

Conversation

cypher7682
Copy link

Checklist:

  • I have bumped the chart version according to versioning
  • I have updated the documentation according to documentation
  • I have updated the chart changelog with all the changes that come with this pull request according to changelog.
  • Any new values are backwards compatible and/or have sensible default.
  • I have signed off all my commits as required by DCO.
  • My build is green (troubleshooting builds).

@cypher7682
Copy link
Author

cypher7682 commented Oct 17, 2023

When deploying a separate cluster that is going to be managed by a remote argo, CRDs are needed for it to ship anything. This PR allows CRDs to be published without anything else in the chart coming with it.

It's untested, though. Going to give it a whirl and make sure it works. It feels a bit clunky to wrap every template in {{ if }} but that's the only way I can see to get this to work with helm_release TF resource. Happy to take any advice on how to approach this otherwise.

@cypher7682
Copy link
Author

I am wondering if it's best to pull CRDs out of this chart, and to have them as a standalone chart. This chart can then reference that, and that standalone chart can be used on remote clusters that need the CRDs. However that might result in some less than ideal situations where CRDs have been installed, and then someone deploys this chart. Though there are already options to disable CRD deployments in here. So maybe that's a better route to take. 🤷

@cypher7682 cypher7682 changed the title Allow chart to be deployed and only ship CRDs feat: Allow chart to be deployed and only ship CRDs Oct 17, 2023
@cypher7682 cypher7682 changed the title feat: Allow chart to be deployed and only ship CRDs feat(argo-cd): Allow chart to be deployed and only ship CRDs Oct 17, 2023
@mkilchhofer
Copy link
Member

mkilchhofer commented Oct 26, 2023

When I saw this PR, my first thoughts were:

I don't like this idea to be honest (too noisy/clunky on all resources and never seen this approach in the "wild"). If this is something we need to support I would be on the side to outsource the CRDs to a subchart.

What is the issue in pulling in the CRDs from the upstream repo as a Kustomize base like its described in the README.md?

I then reflected again and I would say that offering a subchart with the CRDs only would be the ideal solution but it will also increase the complexity:

  • how should we version that subchart (what version number)
  • how can we keep the procedure for upgrading the main chart for a new minor AppVersion without making two releases (one for the CRDs and one for the argo-cd chart)
  • ...
  • etc.

Your use case is valid, Terraform offers bad support for installing CRDs (the kubernetes provider offers the resource resource "kubernetes_manifest" but this is/was buggy in the past). We at @swisspost sometimes also copy an existing chart, strip everything away and keep only the CRDs just to then deploy it via Terraform. 😆

Let's see what the other maintainers here (@mbevc1 / @pdrastil / @yu-croco / @tico24 / @jmeridth ) think about this. With my reflection about complexity this proposal here might look a bit clunky, but it is a KISS solution :D .

@cypher7682
Copy link
Author

cypher7682 commented Nov 1, 2023

When I saw this PR, my first thoughts were:

I had the same thoughts doing this PR... don't worry. It's clunky AF; I am under no illusions 😂 If new templates are made, they'll need to make sure they have the {{ if }} otherwise CRD installations will randomly install miscellaneous apps.

A sub chart is definitely a better idea. I don't think the versioning matters all that much, helm wise. So far the versioning doesn't exist, so even starting at 0.0.1 would work. Existing deployments can just reference the sub-chart on 0.0.1. However...

Regarding the double PRs, I don't see a way to avoid that, to be honest; at least not without essentially guessing the version before it's shipped. On the other hand, copy pasting everything into a "slimmed down" chart is also not ideal.

I, too, would be interested in hearing from the other maintainers on what their thoughts are on the best way forward.

@jmeridth
Copy link
Member

jmeridth commented Nov 6, 2023

As @mkilchhofer has stated, your use case is valid but maintaining it would currently be painful. I'm thinking on proposals here and other ideas.

@cypher7682
Copy link
Author

Do you want me to move this to an issue, rather than a PR?

@jmeridth
Copy link
Member

@cypher7682 As @mkilchhofer stated

With my reflection about complexity this proposal here might look a bit clunky, but it is a KISS solution :D .

I'm good with this but can we do a PR per chart please? Can you also sign your commits (git commit -s)?

@jmeridth
Copy link
Member

@cypher7682 please wait before you break out the PRs. We, the maintainers, are discussing options. Will let you know asap.

Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@cypher7682 cypher7682 closed this by deleting the head repository Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants