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

Predeploy more resources #5

Draft
wants to merge 24 commits into
base: upstream-clone
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
737574c
Allow to recognize the predeployed annotation
oct8l Nov 23, 2024
4cc4e62
Allow the mock resource to be designated as predeployed
oct8l Nov 23, 2024
a075097
Fix logic in deciding if something should be predeployed
oct8l Nov 23, 2024
8746eb1
Add functionality in the discovery to respect the predeployed annotation
oct8l Nov 23, 2024
f4e0385
Add Deployments, Services and Jobs to be deployed after CRs
oct8l Nov 23, 2024
9c539c9
Fix a couple tests to be up to speed with the new functionality
oct8l Nov 23, 2024
d70bd2d
Change test to work now that Services can be predeployed
oct8l Nov 23, 2024
ca20352
Add information to the README about resources that can be marked as '…
c-gerke Nov 25, 2024
5b45f3b
Also allow Ingresses to respect the 'predeployed' annotation
c-gerke Nov 26, 2024
52a608d
Remove duplicate 'kind' definition
c-gerke Nov 29, 2024
c598e1e
Refactor predeploy logic and enhance resource handling
c-gerke Dec 2, 2024
873c050
Explicitly set the priority resources to be predeployed
c-gerke Dec 2, 2024
876715a
Clean up (now) unused definitions
c-gerke Dec 2, 2024
2f88b93
Add more resources to the 'after_crs' section of pre-deployment
c-gerke Dec 2, 2024
3af0df3
Documentation updates
c-gerke Dec 2, 2024
f873ef1
Remove a missed definition
c-gerke Dec 2, 2024
042fc44
Revert change to force Role and RoleBinding to be predeployed at the …
c-gerke Dec 2, 2024
bd5bc25
Allow CR to be set to predeployed independent of CRDs
c-gerke Dec 2, 2024
8bbbe90
Fix line references that have changed
c-gerke Dec 2, 2024
9839b6d
Quick and dirty fix to get tests and deployments working properly
c-gerke Dec 3, 2024
bbc989f
Remove accidental newline
c-gerke Dec 3, 2024
6c4c6a9
Refactor predeployed logic for Kubernetes resources
c-gerke Dec 3, 2024
5016db4
Move pod predeploy logic with the rest of the "required to predeploy"…
c-gerke Dec 3, 2024
bfd40a7
Remove the `default_to_predeployed` function from previous iterations…
c-gerke Dec 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,11 @@ before the deployment is considered successful.
- Percent (e.g. 90%): The deploy is successful when the number of new pods that are ready is equal to `spec.replicas` * Percent.
- _Compatibility_: StatefulSet
- `full`: The deployment is successful when all pods are ready.
- `krane.shopify.io/predeployed`: Causes a Custom Resource to be deployed in the pre-deploy phase.
- _Compatibility_: Custom Resource Definition
- `krane.shopify.io/predeployed`: Causes a Custom Resource, Deployment, Service, or Job to be deployed in the pre-deploy phase.
- _Compatibility_: Custom Resource Definition, Deployment, Service, Job
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be controversial upstream; the label originally got applied to the resource definition (class) not the concrete instance, so this is now conceptually mixed.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had been thinking about that as well, that this implementation/change was the result of taking a feature that existed with one purpose and kind of stealing or borrowing it to apply to different objects. I don't doubt it would be controversial upstream, and I'm ready to have those conversations on if this should even be merged upstream too!

I think it's a worthwhile feature/functional change though (I do realize I'm a little close to it to see it completely objectively), and there's at least one other person at some point who was looking for this type of functionality, so I think it's worth at least proposing and discussing if this is something that would be desired in its current state.

- _Default_: `true`
- `true`: The custom resource will be deployed in the pre-deploy phase.
- All other values: The custom resource will be deployed in the main deployment phase.
- `true`: The custom resource, deployment, service, or job will be deployed in the pre-deploy phase.
- All other values: The custom resource, deployment, service, or job will be deployed in the main deployment phase.
- `krane.shopify.io/deploy-method-override`: Cause a resource to be deployed by the specified `kubectl` command, instead of the default `apply`.
- _Compatibility_: Cannot be used for `PodDisruptionBudget`, since it always uses `create/replace-force`
- _Accepted values_: `create`, `replace`, and `replace-force`
Expand Down
Loading