Skip to content

Commit

Permalink
Merge pull request #2 from mia-platform/feat/traefik-pdb
Browse files Browse the repository at this point in the history
feat: added poddisruptionbudget
  • Loading branch information
JGiola authored Jan 18, 2022
2 parents 7d3e73b + 6fa044c commit 7d30326
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/traefik-ingress/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: traefik-ingress
version: 1.4.2
version: 1.5.0
kubeVersion: ">= 1.17.0-0"
appVersion: 2.5.4
description: "A Kubernetes Ingress Controller based on Traefik"
Expand Down
17 changes: 17 additions & 0 deletions charts/traefik-ingress/templates/poddisruptionbudget.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{- if and (eq .Values.podDisruptionBudget.enabled true) (lt .Values.podDisruptionBudget.minAvailable .Values.deploy.replicas) -}}
apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
name: {{ include "mia-traefik-ingress.fullname" . | quote }}
labels:
{{- include "mia-traefik-ingress.labels" . | nindent 4 }}
spec:
selector:
matchLabels: {{- include "mia-traefik-ingress.selectorLabels" . | nindent 6 }}
{{- if .Values.podDisruptionBudget.minAvailable }}
minAvailable: {{ .Values.podDisruptionBudget.minAvailable }}
{{- end }}
{{- if .Values.podDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }}
{{- end }}
{{- end }}
18 changes: 18 additions & 0 deletions charts/traefik-ingress/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,24 @@
"description": "Enable the Pod Security Policy for allowing the execution of the traefik pods",
"type": "boolean"
},
"podDisruptionBudget": {
"description": "PodDisruptionBudget configuration for traefik pods",
"type": "object",
"properties": {
"enabled": {
"description": "If PodDisruptionBudget must be enabled",
"type": "boolean"
},
"minAvailable": {
"description": "Number of pods from that set that must still be available after the eviction",
"type": "integer"
},
"maxUnavailable": {
"description": "Number of pods from that set that can be unavailable after the eviction",
"type": "integer"
}
}
},
"defaultIngressClass": {
"description": "Set as default ingressClass of the cluster, setting it up only in kubernetes >= 1.18 and if the traefik version is >= 2.3",
"type": "boolean"
Expand Down
5 changes: 5 additions & 0 deletions charts/traefik-ingress/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ defaultIngressClass: false
allowCrossNamespaceResources: true
# Enable the usage of ExternalName services
allowExternalNameServices: false
# Enable PodDisruptionBudget for traefik
podDisruptionBudget:
enabled: false
minAvailable: 1
# maxUnavailable: 1

image:
# Override the default Docker image name if you use a custom image or a repository mirror
Expand Down

0 comments on commit 7d30326

Please sign in to comment.