Skip to content

Commit 3d8f2ed

Browse files
jvanzviccuad
andauthored
feat: PodDisruptionBudget configuration (#414)
Signed-off-by: José Guilherme Vanz <[email protected]> Signed-off-by: Víctor Cuadrado Juan <[email protected]> Co-authored-by: Víctor Cuadrado Juan <[email protected]>
1 parent e3d80e5 commit 3d8f2ed

File tree

4 files changed

+53
-2
lines changed

4 files changed

+53
-2
lines changed

charts/kubewarden-controller/templates/rbac.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,17 @@ rules:
9292
- get
9393
- list
9494
- watch
95+
- apiGroups:
96+
- policy
97+
resources:
98+
- poddisruptionbudgets
99+
verbs:
100+
- create
101+
- delete
102+
- get
103+
- list
104+
- update
105+
- watch
95106
---
96107
apiVersion: rbac.authorization.k8s.io/v1
97108
kind: ClusterRole

charts/kubewarden-defaults/templates/policyserver-default.yaml

+5-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ spec:
1414
image: {{ template "system_default_registry" . }}{{ .Values.policyServer.image.repository }}:{{ .Values.policyServer.image.tag }}
1515
serviceAccountName: {{ .Values.policyServer.serviceAccountName }}
1616
replicas: {{ .Values.policyServer.replicaCount | default 1 }}
17+
{{- if .Values.policyServer.minAvailable }}
18+
minAvailable: {{ .Values.policyServer.minAvailable }}
19+
{{- end }}
20+
{{- if .Values.policyServer.maxUnavailable }}
21+
maxUnavailable: {{ .Values.policyServer.maxUnavailable }}
1722
{{- if .Values.policyServer.affinity }}
1823
affinity: {{ .Values.policyServer.affinity | toYaml | nindent 4 }}
1924
{{- end }}
@@ -55,5 +60,3 @@ spec:
5560
securityContexts: {{ toYaml .Values.policyServer.securityContexts | nindent 4 }}
5661
{{- end }}
5762
{{- end }}
58-
59-
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"$schema": "http://json-schema.org/schema#",
3+
"type": "object",
4+
"properties": {
5+
"policyServer": {
6+
"type": "object",
7+
"properties": {
8+
"maxUnavailable": {
9+
"type": "string"
10+
},
11+
"minAvailable": {
12+
"type": "string"
13+
}
14+
},
15+
"allOf": [
16+
{
17+
"not": {
18+
"properties": {
19+
"minAvailable": {
20+
"type": "string",
21+
"minLength": 1
22+
},
23+
"maxUnavailable": {
24+
"type": "string",
25+
"minLength": 1
26+
}
27+
}
28+
}
29+
}
30+
],
31+
"additionalProperties": true
32+
}
33+
},
34+
"additionalProperties": true
35+
}

charts/kubewarden-defaults/values.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ additionalAnnotations: {}
5757
# Policy Server settings
5858
policyServer:
5959
replicaCount: 1
60+
minAvailable: ""
61+
maxUnavailable: ""
6062
image:
6163
# The registry is defined in the global.cattle.systemDefaultRegistry value
6264
repository: "kubewarden/policy-server"

0 commit comments

Comments
 (0)