Skip to content

Commit

Permalink
feat(cloudflare-tunnel): Add PDB
Browse files Browse the repository at this point in the history
  • Loading branch information
samcm committed Nov 23, 2023
1 parent 1daa329 commit 58d09bd
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/cloudflare-tunnel/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: cloudflare-tunnel
description: Creation of a cloudflared deployment - a reverse tunnel for an environment
type: application
version: 0.1.3
version: 0.2.0
icon: https://developers.cloudflare.com/cloudflare-one/favicon-32x32.png
maintainers:
- name: barnabasbusa
Expand Down
18 changes: 18 additions & 0 deletions charts/cloudflare-tunnel/templates/pdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{- if or .Values.podDisruptionBudget.minAvailable .Values.podDisruptionBudget.maxUnavailable -}}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ include "cloudflare-tunnel.fullname" . }}
labels:
{{- include "cloudflare-tunnel.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "cloudflare-tunnel.selectorLabels" . | nindent 6 }}
{{- if .Values.podDisruptionBudget.minAvailable }}
minAvailable: {{ .Values.podDisruptionBudget.minAvailable }}
{{- end }}
{{- if .Values.podDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }}
{{- end }}
{{- end -}}
6 changes: 6 additions & 0 deletions charts/cloudflare-tunnel/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,9 @@ tolerations: []

# Default affinity is to spread out over nodes; use this to override.
affinity: {}

# -- Define the PodDisruptionBudget spec
# If not set then a PodDisruptionBudget will not be created
podDisruptionBudget:
minAvailable: 1
# maxUnavailable: 1

0 comments on commit 58d09bd

Please sign in to comment.