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

add support for weights for resources #8448

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ashokponkumar
Copy link

@ashokponkumar ashokponkumar commented Jul 14, 2020

closes #8439

Signed-off-by: Ashok Pon Kumar ashokponkumar@in.ibm.com

What this PR does / why we need it:

Special notes for your reviewer:

If applicable:

  • this PR contains documentation
  • this PR contains unit tests
  • this PR has been tested for backwards compatibility

Signed-off-by: Ashok Pon Kumar <ashokponkumar@in.ibm.com>
@helm-bot helm-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 14, 2020
@ashokponkumar
Copy link
Author

Implemented solution: Similar to how we have an ordering requirement for known resources in the InstallOrder, users want the capability to order custom resources too. For example a custom resource like SCC need to be applied before creation of any pods.

To enable this capability we can follow the same approach we use for hooks. Essentially add a annotation "helm.sh/order-weight" which can take an integer value (+ve or -ve). This will behave the same way as "helm.sh/hook-weight", but for resources not covered by hooks.

Here is how it will work:

The first resources to be installed will be all resources that have negative weights, and then those with zero or no weights, and then those with positive weights. All in ascending order.
For resources which have same weight, Install order is preserved for known resources.


Chart weights:
To address the question raised in today's developer call around dependent charts, one way to handle it could be to have a chart weight specifiable along with the dependency specification in chart.yaml. The value specified in it will get added as a "helm.io/chart-weight" annotation in each of those charts resources, when the resources are templated. In case of dependency within a dependency, the "helm.io/chart-weight" will be the sum of the all chart-weights encountered till now.

And while each resource order-weight is computed, the chart-weight gets added to its value. For the base chart, the value is 0.

@hickeyma hickeyma marked this pull request as draft July 16, 2020 17:20
@hickeyma hickeyma marked this pull request as ready for review July 16, 2020 17:21
@hickeyma
Copy link
Contributor

@ashokponkumar It might be worth setting this to draft until you iron/flesh out the solution more?

@ashokponkumar ashokponkumar marked this pull request as draft July 16, 2020 18:08
@ashokponkumar
Copy link
Author

@ashokponkumar It might be worth setting this to draft until you iron/flesh out the solution more?

sure. Done.

@bacongobbler
Copy link
Member

Checking in here to see what’s the status on this. This was opened up in July, and it looks like there is some interest from other community members for this feature.

@ashokponkumar
Copy link
Author

Checking in here to see what’s the status on this. This was opened up in July, and it looks like there is some interest from other community members for this feature.

@bacongobbler If we can settle on the right technique, I can try to take a stab at implementing it. Here was the last discussion based on the discussion in the developer call.

@priyavj08
Copy link

hi, what is the status on this?

@gonzaloserrano
Copy link

👀

@jvossler-cogility
Copy link

Any update on this effort. I have this issue with deploying gatekeeper via helm. The custom helm chart includes a number of constraint templates and constraints. The templates deploy correctly, but the constraints will not deploy as the templates are not available to all three manager nodes. I need to get the templates fully installed before attempting to reference them with security constraints.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for ordering of resources within a chart for Custom Resources
7 participants