-
Notifications
You must be signed in to change notification settings - Fork 2k
feat(argo-workflows): Add support for full CRDs #3559
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
Conversation
b39b58e to
72cbf33
Compare
jmeridth
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the "housekeeping" items also. Excellent updates on the README.
|
I would like to sound a note of caution here. Full Argo Workflows CRDs are very large and will slow down the processing substantially. It my work we use A GitOps automated sync deployments, and when we tried to use full CRDs, the process slowed down enough to start timing out. This change does not default to full CRDs, but there are still costs being added
The former problem is annoying, but the latter can be a real breaking change for some. There are ways to rectify these issues. For example, the actual CRDs can be kept in flat files, and the CRD template could be a short stub loading them via Helm's This approach avoids the overhead of processing large CRD templates when they are not required. Incidentally, it will also let us copy the CRDs files verbatim from the Argo Workflows project, reducing maintenance burden of turning them into templates. |
|
@vladlosev, lets hold on merging this, and I'll do that (next week now), it's a very neat pattern. Thank you. |
|
It doesn't seem it's possible to modify files from Files.Get, which makes adding the annotations impossible - is there a way around that? I've pushed up a new version with something like the modifications suggested, but it's broken CI and it's broken I don't have a way to fix this, but I'm no helm expert - asking for assistance with that. |
| {{- range $path, $_ := .Files.Glob $pattern }} | ||
| {{- if not (contains "clusterworkflowtemplates" $path) }} | ||
| --- | ||
| {{ $.Files.Get $path }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may be able do something like this here:
{{ regexReplaceAllLiteral "\n annotations:\n" ($.Files.Get $path) "\n annotations:\n helm.sh/resource-policy: keep\n" }}
May even abstract it into a function call, e.g.,
{{ include "argo-workflows.insertResourcePolicyAnnotation" (dict "input" ($.Files.Get $path) "value" "keep" }
The function may look like this:
{{- define "argo-workflows.insertResourcePolicyAnnotation" -}}
{{ regexReplaceAllLiteral "\n annotations:\n" .input (format "\n annotations:\n helm.sh/resource-policy: %s\n" .value) }}
{{- end -}}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tried to implement this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a neat trick, I hadn't realised this was possible - thank you.
This change adds the capability to install full CRDs (with complete OpenAPI schemas) instead of the minified ones. This is controlled by a new configuration option crds.fullCRDs which defaults to false (minified CRDs). Changes: - Add new crds.full configuration option in values.yaml (defaults to `false`) - Create templates/crds-full/ directory with full CRDs from upstream v3.7.3 - Move existing minified CRDs to templates/crds-minified/ - Add conditional logic to install either full or minified CRDs based on config - Update README.md with documentation about the new option - Update CONTRIBUTING.md with namespace creation - Update default namespace documentation for argo-workflows - Use `/usr/bin/env bash` for scripts (making them compatible with nixos Possibly in 4.0 we will suggest switching this to default `true`. I'm happy to split this commit if you don't like my "minor fixes along the way". Signed-off-by: Alan Clucas <[email protected]>
Signed-off-by: Alan Clucas <[email protected]>
Signed-off-by: Alan Clucas <[email protected]>
96bed6d to
d34f459
Compare
|
@vladlosev I have rebased, but the actual changes requested are in d34f459 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new full CRDs seem to lack the metadata.name fields.
Signed-off-by: Alan Clucas <[email protected]>
41fb93f to
11b344c
Compare
vladlosev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other issues have been fixed, but the new full CRDs still lack the metadata.name fields. They are not valid without it.
Signed-off-by: Alan Clucas <[email protected]>
Apologies, missed this. Done now |
|
Thank you all |
|
I successfully deployed this via ArgoCD with an application with SSA enabled. |
This change adds the capability to install full CRDs (with complete OpenAPI schemas) instead of the minified ones. This is controlled by a new configuration option crds.full which defaults to false (minified CRDs).
Changes:
false)/usr/bin/env bashfor better compatibility in scriptsPossibly in 4.0 we (the workflows team) will suggest switching this to default
true.If you don't like my "minor fixes along the way" in this PR, I'm happy to split it.
3 of the 8 CRDs are already "full" so we have duplicates of them in the current format. We could put them in a common place if that is preferred. I'm new to this repo and your preferred practices.
Checklist: