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

[prometheus] pdb template values #5001

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

Conversation

mentlak0
Copy link

@mentlak0 mentlak0 commented Nov 18, 2024

What this PR does / why we need it

Which issue this PR fixes

(optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged)

  • fixes:
  • FIX to PDB template. Here we are seeing maxUnavailable defaulting to 1. If we try to only spec minAvailable, maxUnavailable is templating due to default value. K8s does not allow both of these specs.
  • This PR sees a change to allow specific values without issue.

Special notes for your reviewer

Checklist

  • DCO signed
  • Chart Version bumped
  • Title of the PR starts with chart name (e.g. [prometheus-couchdb-exporter])

@mentlak0 mentlak0 changed the title fix: pdb template values [prometheus] pdb template values Nov 18, 2024
@mentlak0
Copy link
Author

@gianrubio @naseemkullah @Xtigyro @zanhsieh @zeritti

Hello,

Would appreciate a review on this. Our prom instance keeps jumping nodes and I want to add a correct PDB

@zeritti
Copy link
Member

zeritti commented Nov 25, 2024

@gianrubio @naseemkullah @Xtigyro @zanhsieh @zeritti

Hello,

Would appreciate a review on this. Our prom instance keeps jumping nodes and I want to add a correct PDB

Please, sign your commits so that DCO check can pass.

Signed-off-by: mentlak <[email protected]>
@mentlak0
Copy link
Author

@zeritti Apologies, first time doing a sign off. This has now been done.

Comment on lines +14 to +19
{{- if $pdbSpec.minAvailable }}
minAvailable: {{ $pdbSpec.minAvailable }}
{{- end }}
{{- if $pdbSpec.maxUnavailable }}
maxUnavailable: {{ $pdbSpec.maxUnavailable }}
{{- end }}
Copy link
Member

Choose a reason for hiding this comment

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

We can make PDB a bit friendlier to users who would like to set minAvailable since they have to set two fields: unset default maxUnavailable and then set minAvailable. I would suggest a change in this respect - commenting the current default out in the values file and rewriting the template while setting the current default. unhealthyPodEvictionPolicyshould not be discarded.

  {{- if not (or (hasKey $pdbSpec "minAvailable") (hasKey $pdbSpec "maxUnavailable")) }}
  maxUnavailable: 1
  {{- end }}
  {{- if hasKey $pdbSpec "minAvailable" }}
  minAvailable: {{ $pdbSpec.minAvailable }}
  {{- end }}
  {{- if hasKey $pdbSpec "maxUnavailable" }}
  maxUnavailable: {{ $pdbSpec.maxUnavailable }}
  {{- end }}
  {{- if hasKey $pdbSpec "unhealthyPodEvictionPolicy" }}
  unhealthyPodEvictionPolicy: {{ $pdbSpec.unhealthyPodEvictionPolicy }}
  {{- end }}

We'd have to add a comment in the values stating that default is set to maxUnavailable=1 if neither minAvailable nor maxUnavailable is set. What dou you think?

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

Successfully merging this pull request may close these issues.

2 participants