-
Notifications
You must be signed in to change notification settings - Fork 23
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 optional PodDisruptionBudget to the Helm chart #383
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added this NOTES file to give some warning to the user. Inspired by something @inteon added to venafi-enhanced-issuer. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{{- if (lt (int .Values.replicaCount) 2) }} | ||
⚠️ WARNING: Consider increasing the Helm value `replicaCount` to 2 if you require high availability. | ||
{{- end }} | ||
|
||
{{- if (not .Values.podDisruptionBudget.enabled) }} | ||
⚠️ WARNING: Consider setting the Helm value `podDisruptionBudget.enabled` to true if you require high availability. | ||
{{- end }} | ||
|
||
CHART NAME: {{ .Chart.Name }} | ||
CHART VERSION: {{ .Chart.Version }} | ||
APP VERSION: {{ .Chart.AppVersion }} | ||
|
||
{{ .Chart.Name }} is a cert-manager project. | ||
|
||
If you're a new user, we recommend that you read the [cert-manager Approval Policy documentation] to learn more. | ||
|
||
[cert-manager Approval Policy documentation]: https://cert-manager.io/docs/policy/approval/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,3 +41,19 @@ See https://github.com/cert-manager/cert-manager/issues/6329 for a list of linke | |
{{- if .digest -}}{{ printf "@%s" .digest }}{{- else -}}{{ printf ":%s" (default $defaultTag .tag) }}{{- end -}} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Copied from | ||
https://github.com/kyverno/kyverno/blob/df5e39c005a78f1ffe6a2eeda3f4497cc9c24384/charts/kyverno/templates/_helpers/_pdb.tpl | ||
*/}} | ||
{{- define "cert-manager-approver-policy.pdb.spec" -}} | ||
{{- if and .minAvailable .maxUnavailable -}} | ||
{{- fail "Cannot set both .minAvailable and .maxUnavailable" -}} | ||
{{- end -}} | ||
{{- if not .maxUnavailable -}} | ||
minAvailable: {{ default 1 .minAvailable }} | ||
{{- end -}} | ||
{{- if .maxUnavailable -}} | ||
maxUnavailable: {{ .maxUnavailable }} | ||
{{- end -}} | ||
{{- end -}} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Example output of the validation in this new helper. $ helm upgrade --install -n venafi approver-policy _bin/scratch/image/cert-manager-approver-policy-v0.13.0-alpha.0-12-g075790a76f86b9-dirty.tgz --set podDisruptionBudget.enabled=true --set podDisruptionBudget.minAvailable=1 --set podDisruptionBudget.maxUnavailable=1 --set image.tag=v0.12.1
Error: UPGRADE FAILED: execution error at (cert-manager-approver-policy/templates/poddisruptionbudget.yaml:10:6): Cannot set both .minAvailable and .maxUnavailable |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{{- if .Values.podDisruptionBudget.enabled -}} | ||
apiVersion: policy/v1 | ||
kind: PodDisruptionBudget | ||
metadata: | ||
name: {{ include "cert-manager-approver-policy.name" . }} | ||
namespace: {{ .Release.Namespace | quote }} | ||
labels: | ||
{{- include "cert-manager-approver-policy.labels" . | nindent 4 }} | ||
spec: | ||
{{- include "cert-manager-approver-policy.pdb.spec" .Values.podDisruptionBudget | nindent 2 }} | ||
selector: | ||
matchLabels: | ||
app: {{ include "cert-manager-approver-policy.name" . }} | ||
{{- end -}} |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Auto generated by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Auto generated by
make generate-helm-docs