From acb827c00375369f76088a5ebcc06906349e2535 Mon Sep 17 00:00:00 2001 From: Vincent Date: Wed, 31 Aug 2022 10:07:17 -0400 Subject: [PATCH] Add the configuration of podDisruptionBudget for knative operator (#5114) * Add the configuration of podDisruptionBudget for knative operator * Add the description on the Pod Disruption Budget (PDB) Signed-off-by: Vincent Hou Signed-off-by: Vincent Hou --- .../operator/configuring-eventing-cr.md | 20 +++++++++++++++++++ .../operator/configuring-serving-cr.md | 20 +++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/docs/install/operator/configuring-eventing-cr.md b/docs/install/operator/configuring-eventing-cr.md index 767b50bc1..a6d685758 100644 --- a/docs/install/operator/configuring-eventing-cr.md +++ b/docs/install/operator/configuring-eventing-cr.md @@ -505,3 +505,23 @@ kn operator configure labels --component eventing --serviceName eventing-webhook kn operator configure annotations --component eventing --serviceName eventing-webhook --key myannotations --value bar -n knative-eventing kn operator configure selectors --component eventing --serviceName eventing-webhook --key myselector --value bar -n knative-eventing ``` + +## Override system podDisruptionBudgets + +A Pod Disruption Budget (PDB) allows you to limit the disruption to your application when its pods need to be rescheduled +for maintenance reasons. Knative Operator allows you to configure the `minAvailable` for a specific podDisruptionBudget +resource in Eventing based on the name. To understand more about the configuration of the resource podDisruptionBudget, click [here](https://kubernetes.io/docs/tasks/run-application/configure-pdb/). +For example, if you would like to change `minAvailable` into 70% for the podDisruptionBudget named `eventing-webhook`, +you need to change your KnativeEventing CR as below: + +```yaml +apiVersion: operator.knative.dev/v1beta1 +kind: KnativeEventing +metadata: + name: knative-eventing + namespace: knative-eventing +spec: + podDisruptionBudgets: + - name: eventing-webhook + minAvailable: 70% +``` diff --git a/docs/install/operator/configuring-serving-cr.md b/docs/install/operator/configuring-serving-cr.md index 6d2fcd6cb..8888ea491 100644 --- a/docs/install/operator/configuring-serving-cr.md +++ b/docs/install/operator/configuring-serving-cr.md @@ -675,3 +675,23 @@ kn operator configure labels --component serving --serviceName webhook --key myl kn operator configure annotations --component serving --serviceName webhook --key myannotations --value bar -n knative-serving kn operator configure selectors --component serving --serviceName webhook --key myselector --value bar -n knative-serving ``` + +## Override system podDisruptionBudgets + +A Pod Disruption Budget (PDB) allows you to limit the disruption to your application when its pods need to be rescheduled +for maintenance reasons. Knative Operator allows you to configure the `minAvailable` for a specific podDisruptionBudget +resource in Serving based on the name. To understand more about the configuration of the resource podDisruptionBudget, click [here](https://kubernetes.io/docs/tasks/run-application/configure-pdb/). +For example, if you would like to change `minAvailable` into 70% for the podDisruptionBudget named `activator-pdb`, you +need to change your KnativeServing CR as below: + +```yaml +apiVersion: operator.knative.dev/v1beta1 +kind: KnativeServing +metadata: + name: knative-serving + namespace: knative-serving +spec: + podDisruptionBudgets: + - name: activator-pdb + minAvailable: 70% +```