From 8a241f0550de756c3edf3943d978808445aa7b63 Mon Sep 17 00:00:00 2001 From: Mats Andresen Date: Tue, 6 Feb 2024 14:14:22 +0100 Subject: [PATCH] feat(chart): allow configuration of k8s_sensor pod disruption budget --- instana-agent/README.md | 11 ++++++++++- .../templates/k8s-sensor-pod-disruption-budget.yaml | 3 ++- instana-agent/values.yaml | 2 ++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/instana-agent/README.md b/instana-agent/README.md index c77114ef5..132451c9d 100644 --- a/instana-agent/README.md +++ b/instana-agent/README.md @@ -139,7 +139,12 @@ The following table lists the configurable parameters of the Instana chart and t | `serviceAccount.name` | Name of the ServiceAccount to use | `instana-agent` | | `zone.name` | Zone that detected technologies will be assigned to | `nil` You must provide either `zone.name` or `cluster.name`, see [above](#installation) for details | | `zones` | Multi-zone daemonset configuration. | `nil` see [below](#multiple-zones) for details | -| `k8s_sensor.podDisruptionBudget.enabled` | Whether to create DisruptionBudget for k8sensor to limit the number of concurrent disruptions | `false` | +| `k8s_sensor.podDisruptionBudget.enabled` | Whether to create DisruptionBudget for k8sensor to limit the number of concurrent disruptions | +`false` | +| `k8s_sensor.podDisruptionBudget.minAvailable` | Number or percentage of pods that must still be available after the eviction. | +`1` | +| `k8s_sensor.podDisruptionBudget.maxUnavailable` | Number or percentage of pods that can be unavailable after the eviction. | +`null` | | `k8s_sensor.deployment.pod.affinity` | `k8sensor` deployment affinity format | `podAntiAffinity` defined in `values.yaml` | ### Agent Modes @@ -359,6 +364,10 @@ zones: ## Changelog +### 1.2.68 + +* Allow configuration of k8s_sensor pod disruption budget + ### 1.2.67 * Fix variable name in the K8s deployment diff --git a/instana-agent/templates/k8s-sensor-pod-disruption-budget.yaml b/instana-agent/templates/k8s-sensor-pod-disruption-budget.yaml index 568a6f4d6..b2677cacf 100644 --- a/instana-agent/templates/k8s-sensor-pod-disruption-budget.yaml +++ b/instana-agent/templates/k8s-sensor-pod-disruption-budget.yaml @@ -8,6 +8,7 @@ spec: selector: matchLabels: {{- include "k8s-sensor.selectorLabels" . | nindent 6 }} - minAvailable: {{ sub (int .Values.k8s_sensor.deployment.replicas) 1 }} + minAvailable: {{ .Values.k8s_sensor.podDisruptionBudget.minAvailable }} + maxUnavailable: {{ .Values.k8s_sensor.podDisruptionBudget.maxUnavailable }} {{- end -}} {{- end -}} \ No newline at end of file diff --git a/instana-agent/values.yaml b/instana-agent/values.yaml index 9dcaeacb3..c6b0408b3 100644 --- a/instana-agent/values.yaml +++ b/instana-agent/values.yaml @@ -262,6 +262,8 @@ k8s_sensor: podDisruptionBudget: # Specifies whether or not to setup a pod disruption budget for the k8sensor deployment enabled: false + minAvailable: 1 + maxUnavailable: null kubernetes: # Configures use of a Deployment for the Kubernetes sensor rather than as a potential member of the DaemonSet. Is only accepted if k8s_sensor.deployment.enabled=false