Skip to content

Commit

Permalink
Implemented PodDisruptionBudget on relevant deployments
Browse files Browse the repository at this point in the history
- added a pdb on the ping deployment
- added a pdb on the allocator deployment
- default to no creation of pdb, opt-in install
  • Loading branch information
Valentin T committed Sep 19, 2022
1 parent a980e89 commit 807468d
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 5 deletions.
16 changes: 16 additions & 0 deletions install/helm/agones/templates/ping.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,22 @@ spec:
{{- if .Values.agones.image.controller.pullSecret }}
imagePullSecrets:
- name: {{.Values.agones.image.controller.pullSecret}}
{{- end }}
{{- if .Values.agones.ping.pdb.enabled }}
---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: agones-ping-pdb
spec:
minAvailable: {{ .Values.agones.ping.pdb.minAvailable }}
maxUnavailable: {{ .Values.agones.ping.pdb.maxUnavailable }}
selector:
matchLabels:
agones.dev/role: ping
app: {{ template "agones.name" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- end }}
{{- if .Values.agones.ping.http.expose }}
---
Expand Down
17 changes: 16 additions & 1 deletion install/helm/agones/templates/service/allocation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,22 @@ spec:
imagePullSecrets:
- name: {{.Values.agones.image.controller.pullSecret}}
{{- end }}

{{- if .Values.agones.allocator.pdb.enabled }}
---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: agones-allocator-pdb
spec:
minAvailable: {{ .Values.agones.allocator.pdb.minAvailable }}
maxUnavailable: {{ .Values.agones.allocator.pdb.maxUnavailable }}
selector:
matchLabels:
multicluster.agones.dev/role: allocator
app: {{ template "agones.name" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- end }}
---
# Create a ClusterRole in that grants access to the agones allocation api
apiVersion: rbac.authorization.k8s.io/v1
Expand Down
6 changes: 6 additions & 0 deletions install/helm/agones/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ agones:
allocationBatchWaitTime: 500ms
ping:
install: true
pdb:
enabled: false
minAvailable: 1
updateStrategy: {}
resources: {}
# requests:
Expand Down Expand Up @@ -139,6 +142,9 @@ agones:
timeoutSeconds: 1
allocator:
install: true
pdb:
enabled: false
minAvailable: 1
updateStrategy: {}
apiServerQPS: 400
apiServerQPSBurst: 500
Expand Down
15 changes: 11 additions & 4 deletions site/content/en/docs/Installation/Install Agones/helm.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,20 @@ The following tables lists the configurable parameters of the Agones chart and t
| `gameservers.podPreserveUnknownFields` | Disable [field pruning][pruning] and schema validation on the Pod template for a [GameServer][gameserver] definition | `false` |
| `helm.installTests` | Add an ability to run `helm test agones` to verify the installation | `false` |
| `agones.controller.allocationBatchWaitTime` | Wait time between each allocation batch when performing allocations in controller mode | `500ms` |
| `agones.allocator.updateStrategy` | The [strategy](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy) to apply to the ping deployment | `{}` |
| `agones.ping.updateStrategy` | The [strategy](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy) to apply to the allocator deployment | `{}` |
| `agones.allocator.updateStrategy` | The [strategy](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy) to apply to the ping deployment | `{}` |
| `agones.ping.updateStrategy` | The [strategy](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy) to apply to the allocator deployment | `{}` |

{{% feature publishVersion="1.27.0" %}}
**New Configuration Features:**
| Parameter | Description | Default |
| -------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ---------------------- |

| Parameter | Description | Default |
|---------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|
| `agones.allocator.pdb.enabled` | Set to `true` to enable the creation of a [PodDisruptionBudget](https://kubernetes.io/docs/tasks/run-application/configure-pdb/) for the allocator deployment | `false` |
| `agones.allocator.pdb.minAvailable` | Description of the number of pods from that set that must still be available after the eviction, even in the absence of the evicted pod. Can be either an absolute number or a percentage. | `1` |
| `agones.allocator.pdb.maxUnavailable` | Description of the number of pods from that set that can be unavailable after the eviction. It can be either an absolute number or a percentage. | \`\` |
| `agones.ping.pdb.enabled` | Set to `true` to enable the creation of a [PodDisruptionBudget](https://kubernetes.io/docs/tasks/run-application/configure-pdb/) for the ping deployment | `false` |
| `agones.ping.pdb.minAvailable` | Description of the number of pods from that set that must still be available after the eviction, even in the absence of the evicted pod. Can be either an absolute number or a percentage. | `1` |
| `agones.ping.pdb.maxUnavailable` | Description of the number of pods from that set that can be unavailable after the eviction. It can be either an absolute number or a percentage. | \`\` |
{{% /feature %}}

[toleration]: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
Expand Down

0 comments on commit 807468d

Please sign in to comment.