diff --git a/pkg/config/draftconfig_template_test.go b/pkg/config/draftconfig_template_test.go index bd0fb737..c7e705a7 100644 --- a/pkg/config/draftconfig_template_test.go +++ b/pkg/config/draftconfig_template_test.go @@ -49,6 +49,7 @@ var validVariableKinds = map[string]bool{ "replicaCount": true, "scalingResourceType": true, "scalingResourceUtilization": true, + "resourceLimit": true, } /* diff --git a/template/manifests/PodDisruptionBudget/manifest/draft.yaml b/template/manifests/PodDisruptionBudget/manifest/draft.yaml index 18db8bf5..3086ad3e 100644 --- a/template/manifests/PodDisruptionBudget/manifest/draft.yaml +++ b/template/manifests/PodDisruptionBudget/manifest/draft.yaml @@ -39,4 +39,10 @@ variables: kind: "scalingResourceUtilization" description: "specifies the average utilization for the monitored resource, triggering scaling when exceeded" default: - value: 80 \ No newline at end of file + 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 \ No newline at end of file diff --git a/template/manifests/PodDisruptionBudget/manifest/pdb.yaml b/template/manifests/PodDisruptionBudget/manifest/pdb.yaml new file mode 100644 index 00000000..71f25c83 --- /dev/null +++ b/template/manifests/PodDisruptionBudget/manifest/pdb.yaml @@ -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}} \ No newline at end of file