Skip to content

Commit

Permalink
docs(kgo): add PodDisruptionBudget guide (#7729)
Browse files Browse the repository at this point in the history
* docs(kgo): add PodDisruptionBudget guide

* Update app/_src/gateway-operator/customization/pod-disruption-budget.md

Co-authored-by: Patryk Małek <[email protected]>

* Update app/_src/gateway-operator/customization/pod-disruption-budget.md

Co-authored-by: Patryk Małek <[email protected]>

* Apply suggestions from code review

Co-authored-by: Jakub Warczarek <[email protected]>

* Apply suggestions from code review

Co-authored-by: lena-larionova <[email protected]>

---------

Co-authored-by: Patryk Małek <[email protected]>
Co-authored-by: Jakub Warczarek <[email protected]>
Co-authored-by: lena-larionova <[email protected]>
  • Loading branch information
4 people authored Oct 30, 2024
1 parent 9ea265b commit 8e1f56f
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/_data/docs_nav_kgo_1.4.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ items:
url: /customization/sidecars/
- text: Customizing PodTemplateSpec
url: /customization/pod-template-spec/
- text: Defining PodDisruptionBudget for DataPlane
url: /customization/pod-disruption-budget/
- text: Autoscaling Kong Gateway
url: /guides/autoscaling-kong/
- text: Autoscaling Workloads
Expand Down
42 changes: 42 additions & 0 deletions app/_src/gateway-operator/customization/pod-disruption-budget.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
title: Defining PodDisruptionBudget for DataPlane
---

`DataPlane` resources can be configured with a `PodDisruptionBudget` to control:
- The number or percentage of pods that can be unavailable during maintenance (e.g. rollout).
- The number or percentage of pods that must be available during maintenance (e.g. rollout).

This is useful to ensure that a certain number or percentage of pods are always available.

See the [Specifying a Disruption Budget for your Application](https://kubernetes.io/docs/tasks/run-application/configure-pdb/) guide
for more details on the `PodDisruptionBudget` API itself.

## Creating a DataPlane with PodDisruptionBudget

For `DataPlane` resources, you can define a `PodDisruptionBudget` in the `spec.resources.podDisruptionBudget` field.
The `DataPlane`'s `spec.resources.podDisruptionBudget.spec` matches the `PodDisruptionBudget` API, excluding
the `selector` field, which is automatically set by {{ site.kgo_product_name }} to match the `DataPlane` pods.

Here is an example of a `DataPlane` resource with a `PodDisruptionBudget`:

```yaml
apiVersion: gateway-operator.konghq.com/v1beta1
kind: DataPlane
metadata:
name: dataplane-with-pdb
spec:
resources:
podDisruptionBudget:
spec:
maxUnavailable: 1
deployment:
replicas: 3
podTemplateSpec:
spec:
containers:
- name: proxy
image: kong/kong-gateway:{{ site.data.kong_latest_gateway.ee-version }}
```
If you leave the `resources.podDisruptionBudget` field empty, {{ site.kgo_product_name }} will not create a
`PodDisruptionBudget` for the `DataPlane`.

0 comments on commit 8e1f56f

Please sign in to comment.