Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion charts/fluentd/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,19 @@ Name of the configMap used for additional configuration files; allows users to o
{{- end -}}
{{- end -}}


{{/*
Pdb apiVersion according k8s version and capabilities
*/}}
{{- define "fluentd.pdb.apiVersion" -}}
{{- if and (.Capabilities.APIVersions.Has "policy/v1") (semverCompare ">=1.21-0" .Capabilities.KubeVersion.GitVersion) -}}
policy/v1
{{- else -}}
policy/v1beta1
{{- end }}
{{- end -}}


{{/*
HPA ApiVersion according k8s version
Check legacy first so helm template / kustomize will default to latest version
Expand All @@ -101,4 +114,4 @@ autoscaling/v2beta2
{{- else -}}
autoscaling/v2
{{- end -}}
{{- end -}}
{{- end -}}
21 changes: 21 additions & 0 deletions charts/fluentd/templates/pdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{- if and (or ( eq .Values.kind "Deployment" ) ( eq .Values.kind "StatefulSet" )) .Values.podDisruptionBudget.enabled }}
apiVersion: {{ include "fluentd.pdb.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
name: {{ include "fluentd.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "fluentd.labels" . | nindent 4 }}
{{- with .Values.podDisruptionBudget.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }}
selector:
matchLabels:
{{- include "fluentd.selectorLabels" . | nindent 6 }}
{{- with .Values.labels }}
{{- toYaml . | nindent 6 }}
{{- end }}
{{- end }}
7 changes: 7 additions & 0 deletions charts/fluentd/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -403,3 +403,10 @@ ingress:
# - secretName: fluentd-tls
# hosts:
# - fluentd.example.tld


## only available if kind is Deployment or StatefulSet
podDisruptionBudget:
enabled: false
annotations: {}
maxUnavailable: "30%"
Loading