Skip to content

Commit

Permalink
creating PDB template (#403)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vidya2606 authored Oct 16, 2024
1 parent b2e15d9 commit d5acab2
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkg/config/draftconfig_template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ var validVariableKinds = map[string]bool{
"replicaCount": true,
"scalingResourceType": true,
"scalingResourceUtilization": true,
"resourceLimit": true,
}

/*
Expand Down
8 changes: 7 additions & 1 deletion template/manifests/PodDisruptionBudget/manifest/draft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,10 @@ variables:
kind: "scalingResourceUtilization"
description: "specifies the average utilization for the monitored resource, triggering scaling when exceeded"
default:
value: 80
value: 80
- name: "MAXUNAVAILABLE"
type: "int"
kind: "resourceLimit"
description: "specifies the maximum number of pods that can be unavailable during a disruption, such as a pod eviction"
default:
value: 1
13 changes: 13 additions & 0 deletions template/manifests/PodDisruptionBudget/manifest/pdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{.APPNAME}}
labels:
app.kubernetes.io/name: {{.APPNAME}}
app.kubernetes.io/part-of: {{.PARTOF}}
kubernetes.azure.com/generator: {{.GENERATORLABEL}}
spec:
maxUnavailable: {{.MAXUNAVAILABLE}}
selector:
matchLabels:
app: {{.APPNAME}}

0 comments on commit d5acab2

Please sign in to comment.