-
Notifications
You must be signed in to change notification settings - Fork 273
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(k8s): add support for patching manifests #5187
Conversation
888cfdc
to
c90e4f3
Compare
export interface KubernetesPatchResource { | ||
name: string | ||
// TODO @eysi: Can we get a better type here? | ||
kind: string |
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 just went for a string type here instead of listing all K8s object types.
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 think that makes sense because a user could also patch a custom resource.
c90e4f3
to
b4f1464
Compare
e6eac87
to
1938ed8
Compare
This change introduces a \`patchResources\` field to the \`kubernetes\` Deploy action that allows users to overwrite the values of manifests in Garden config without modifying the manifest itself. This enables users to drop Garden into existing K8s projects without making any other changes to code or config. Under the hood, Garden uses the `kubectl patch` command. The behaviour is documented here: https://kubernetes.io/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/
1938ed8
to
c185074
Compare
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.
Great job! The examples are also super sound, nothing to improve imho. One nit-pick about a missing dot at the end of the sentence but that's it. Leaving it up to you to if you want to add it, otherwise approving.
export interface KubernetesPatchResource { | ||
name: string | ||
// TODO @eysi: Can we get a better type here? | ||
kind: string |
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 think that makes sense because a user could also patch a custom resource.
Co-authored-by: Anna Mager <[email protected]>
d67ea23
to
32955f2
Compare
What this PR does / why we need it:
From the commit message:
I also added an example project that demonstrates this functionality and updated the k8s-deploy-config-templates example to use the same pattern.
To do:
Update docs on Kubernetes action types (we can do that in a follow up PR if needed)I started writing the docs on a different branch to keep things simple.
Which issue(s) this PR fixes:
Fixes #5082
Special notes for your reviewer:
The large number of line changes is due to the example projects. The main feature is pretty simple.