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

Refactor and Document chart values #27

Open
5nafu opened this issue Mar 13, 2024 · 4 comments
Open

Refactor and Document chart values #27

5nafu opened this issue Mar 13, 2024 · 4 comments
Assignees

Comments

@5nafu
Copy link

5nafu commented Mar 13, 2024

Hi @mstein11,

As the offered PR for the additional findings of #26 might get a bit bigger, I create this issue for discussion.

As a user of the docker-hub-rate-limit-exporter, I want to see all available variables and their defaults in the values.yaml file for a better overview of possible configurations.

@5nafu
Copy link
Author

5nafu commented Mar 13, 2024

While writing the update, I see that there is some inconsistency in the usage of some variables:

  • daemonset vs. deployment
    • some variables are migrated directly into the different configurations (like daemonset.affinity or daemonset.nodeSelector) while other remain in the top level like podSecurityContext or hostNetwork.
    • as I would guess, that one would either use a deployment or daemonset, I would suggest to revert these variables to the top level.
    • this change was introduced in feat: enhance chart features, add daemonset, add linting ci #24
    • this will probably be a breaking change
  • image and pullsecret
    • all variables controlling the image are consolidated under the image variable
    • except the imagePullSecrets
    • I would suggest to migrate immagePullSecrets into the image.immagePullSecrets
    • this will probably be a breaking change

@mstein11
Copy link
Contributor

Hi @5nafu,

thank you for contributing, I like your ideas! From here on @MaxStroh is going to take over from viadee side. He has some ideas of how we could implement the suggested changes.

Best,
Marius

@MaxStroh
Copy link
Contributor

MaxStroh commented Mar 15, 2024

Hi @5nafu,

thanks for your input. We discussed this shortly and want to make our thoughts about this transparent to you.

First of all, we totally agree, that the values referenced in the templates should be consistent with the arrangement of the variables in the values.yaml. Therefore we should definitely fix the references of daemonset.affinity and daemonset.nodeSelector in the daemonset template (and the corresponding references in the deployment template) back to the toplevel variables, which can already be set in the values.yaml on toplevel. This would probably not even cause breaking changes because these references in the templates are simply not working now (except users explicitly added daemonset.affinity e.g. in their own values.yaml file).

Regarding the variable imagePullSecrets we would prefer sticking to the defaults that helm delivers. As most users probably create helm charts via helm create ... we should also stick to the structure, in which helm itself structures these variables. If you run helm create ... you will get a chart like this:

image:
  repository: nginx
  pullPolicy: IfNotPresent
  tag: ""

imagePullSecrets: []
...

With regard to the principle of least astonishment, restructuring these variables other than the helm default, we fear to confuse most of the users - although I agree, that I do not fully understand why helm puts e.g. pullPolicy under image, but imagePullSecrets not. I assume that they also stick to the default on which hierarchy level the values are later parsed into the yaml of a e.g. deployment yaml.

Long story short:

  • We would prefer to leave imagePullSecrets as toplevel variable
  • We would prefer to fix the references in the template yamls from daemonset.affinity / daemonset.nodeSelector / deployment.affinity / deployment.nodeSelector to toplevel affinity / nodeSelector

Regarding the potentially breaking changes this generates, we think there are three ways to handle this:

  1. We simply change these references in the template yamls, causing breaking changes for users who upgrade the charts (maybe automatically), causing the dashboards to simply not work anymore without a concrete hint about why
  2. We allow both kinds of value structuring, causing no breaking changes, but confusing new users which way to use and increasing the maintenance
  3. We change the references in the template yamls but additionally implement that a speaking and detailed error message is thrown, including which variables are set wrong and where they should be defined now. Although this also causes breaking changes for users, it informs them exactly why it does not work anymore

We would prefer option 3 - what do you think about how to handle breaking changes and our conclusion about the variable structuring?

@5nafu
Copy link
Author

5nafu commented Mar 15, 2024

Cool. I'll have a look at it over the weekend. Talk to you soon.

5nafu added a commit to 5nafu/docker-hub-rate-limit-exporter that referenced this issue Mar 15, 2024
@MaxStroh MaxStroh self-assigned this Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants