Skip to content
This repository has been archived by the owner on Aug 25, 2021. It is now read-only.

PodDisruptionBudget calculation is not working #265

Closed
s3than opened this issue Oct 23, 2019 · 3 comments
Closed

PodDisruptionBudget calculation is not working #265

s3than opened this issue Oct 23, 2019 · 3 comments
Labels
question Further information is requested waiting-on-response Waiting on the issue creator for a response before taking further action

Comments

@s3than
Copy link
Contributor

s3than commented Oct 23, 2019

As per #71 the latest version of helm https://github.com/helm/helm/releases/tag/v2.15.0 includes the following Updated Sprig to 2.20.0

This causes the previous fix to pod disruption budget to return -1 now on a new installation.

Updating the _helpers.tpl to the following resolves however if you run it in helm < 2.15.0 it's broken again..

I'll hopefully have a fix shortly that works in both and will advise.

{{- define "consul.pdb.maxUnavailable" -}}
{{- if eq (int .Values.server.replicas) 1 -}}
{{ 0 }}
{{- else if .Values.server.disruptionBudget.maxUnavailable -}}
{{ .Values.server.disruptionBudget.maxUnavailable -}}
{{- else -}}
{{- if eq (int .Values.server.replicas) 3 -}}
{{- 1 -}}
{{- else -}}
{{- div (int .Values.server.replicas) 2 -}}
{{- end -}}
{{- end -}}
{{- end -}}
@s3than
Copy link
Contributor Author

s3than commented Oct 23, 2019

Resolution is same as #264

@lkysow
Copy link
Member

lkysow commented Oct 23, 2019

Yeah looks like helm has reverted this change in their latest release (v2.15.1): https://github.com/helm/helm/releases/tag/v2.15.1

I don't think there's a good workaround on our side other than asking users to update Helm.

@lkysow lkysow added question Further information is requested waiting-on-response Waiting on the issue creator for a response before taking further action labels Oct 23, 2019
@s3than
Copy link
Contributor Author

s3than commented Oct 24, 2019

Updated pull request to just include tests, happy to close as resolved when using 2.15.1 of helm

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested waiting-on-response Waiting on the issue creator for a response before taking further action
Projects
None yet
Development

No branches or pull requests

2 participants