Skip to content

Commit

Permalink
Merge pull request #287 from oldgiova/MC-7436-pdb-maxunavailable
Browse files Browse the repository at this point in the history
Deviceconnect pdb, and maxUnavailable option
  • Loading branch information
oldgiova authored Jun 11, 2024
2 parents 18436b0 + 2ade83c commit 8fabfab
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 1 deletion.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ The following table lists the global, default, and other parameters supported by
| `default.hpa.behavior` | HorizontalPodAutoscaler behavior as defined in the [reference](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#horizontalpodautoscalerbehavior-v2-autoscaling) | `nil` |
| `default.pdb.enabled` | PodDistruptionBudget enabled | `false` |
| `default.pdb.minAvailable` | PodDistruptionBudget minAvailable | `1` |
| `default.pdb.maxUnavailable` | PodDistruptionBudget maxUnavailable | `nil` |
| `default.imagePullSecrets` | Optional list of existing Image Pull Secrets in the format of `- name: my-custom-secret` | `[]` |
| `default.updateStrategy` | The strategy to use to update existing pods | `rollingUpdate = { maxSurge = 25%, maxUnavailable = 0 }` |
| `default.probesOverrides.timeoutSeconds` | Override the `timeoutSeconds` for every Readiness and Liveness probes. | `nil` |
Expand Down Expand Up @@ -338,6 +339,7 @@ The following table lists the parameters for the `api-gateway` component and the
| `api_gateway.hpa.behavior` | HorizontalPodAutoscaler behavior as defined in the [reference](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#horizontalpodautoscalerbehavior-v2-autoscaling) | `nil` |
| `api_gateway.pdb.enabled` | PodDistruptionBudget enabled | `nil` |
| `api_gateway.pdb.minAvailable` | PodDistruptionBudget minAvailable | `nil` |
| `api_gateway.pdb.maxUnavailable` | PodDistruptionBudget maxUnavailable | `nil` |
| `api_gateway.priorityClassName` | Optional pre-existing priorityClassName to be assigned to the resource | `nil` |
| `api_gateway.certs` | certificate management | `nil` |
| `api_gateway.certs.cert` | Public certificate (with full chain optionally) in PEM format | `nil` |
Expand Down Expand Up @@ -400,6 +402,7 @@ The following table lists the parameters for the `deployments` component and the
| `deployments.hpa.behavior` | HorizontalPodAutoscaler behavior as defined in the [reference](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#horizontalpodautoscalerbehavior-v2-autoscaling) | `nil` |
| `deployments.pdb.enabled` | PodDistruptionBudget enabled | `nil` |
| `deployments.pdb.minAvailable` | PodDistruptionBudget minAvailable | `nil` |
| `deployments.pdb.maxUnavailable` | PodDistruptionBudget maxUnavailable | `nil` |
| `deployments.priorityClassName` | Optional pre-existing priorityClassName to be assigned to the resource | `nil` |
| `deployments.migrationRestartPolicy` | Migration job: restartPolicy option | `Never` |
| `deployments.migrationResources` | Migration job: optional K8s resources. If not specified, uses the deployment resources | `nil` |
Expand Down Expand Up @@ -460,6 +463,7 @@ The following table lists the parameters for the `device-auth` component and the
| `device_auth.hpa.behavior` | HorizontalPodAutoscaler behavior as defined in the [reference](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#horizontalpodautoscalerbehavior-v2-autoscaling) | `nil` |
| `device_auth.pdb.enabled` | PodDistruptionBudget enabled | `nil` |
| `device_auth.pdb.minAvailable` | PodDistruptionBudget minAvailable | `nil` |
| `device_auth.pdb.maxUnavailable` | PodDistruptionBudget maxUnavailable | `nil` |
| `device_auth.priorityClassName` | Optional pre-existing priorityClassName to be assigned to the resource | `nil` |
| `device_auth.certs` | certificate management | `nil` |
| `device_auth.certs.key` | Private key in PEM format | `nil` |
Expand Down Expand Up @@ -557,6 +561,7 @@ The following table lists the parameters for the `inventory` component and their
| `inventory.hpa.behavior` | HorizontalPodAutoscaler behavior as defined in the [reference](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#horizontalpodautoscalerbehavior-v2-autoscaling) | `nil` |
| `inventory.pdb.enabled` | PodDistruptionBudget enabled | `nil` |
| `inventory.pdb.minAvailable` | PodDistruptionBudget minAvailable | `nil` |
| `inventory.pdb.maxUnavailable` | PodDistruptionBudget maxUnavailable | `nil` |
| `inventory.priorityClassName` | Optional pre-existing priorityClassName to be assigned to the resource | `nil` |
| `inventory.migrationRestartPolicy` | Migration job: restartPolicy option | `Never` |
| `inventory.migrationResources` | Migration job: optional K8s resources. If not specified, uses the deployment resources | `nil` |
Expand Down Expand Up @@ -640,6 +645,7 @@ The following table lists the parameters for the `tenantadm` component and their
| `tenantadm.hpa.behavior` | HorizontalPodAutoscaler behavior as defined in the [reference](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#horizontalpodautoscalerbehavior-v2-autoscaling) | `nil` |
| `tenantadm.pdb.enabled` | PodDistruptionBudget enabled | `nil` |
| `tenantadm.pdb.minAvailable` | PodDistruptionBudget minAvailable | `nil` |
| `tenantadm.pdb.maxUnavailable` | PodDistruptionBudget maxUnavailable | `nil` |
| `tenantadm.priorityClassName` | Optional pre-existing priorityClassName to be assigned to the resource | `nil` |
| `tenantadm.certs` | certificate management | `nil` |
| `tenantadm.certs.key` | Private key in PEM format | `nil` |
Expand Down Expand Up @@ -714,6 +720,7 @@ The following table lists the parameters for the `useradm` component and their d
| `useradm.hpa.behavior` | HorizontalPodAutoscaler behavior as defined in the [reference](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#horizontalpodautoscalerbehavior-v2-autoscaling) | `nil` |
| `useradm.pdb.enabled` | PodDistruptionBudget enabled | `nil` |
| `useradm.pdb.minAvailable` | PodDistruptionBudget minAvailable | `nil` |
| `useradm.pdb.maxUnavailable` | PodDistruptionBudget maxUnavailable | `nil` |
| `useradm.priorityClassName` | Optional pre-existing priorityClassName to be assigned to the resource | `nil` |
| `useradm.certs` | certificate management | `nil` |
| `useradm.certs.key` | Private key in PEM format | `nil` |
Expand Down Expand Up @@ -938,6 +945,9 @@ The following table lists the parameters for the `deviceconnect` component and t
| `deviceconnect.hpa.behavior` | HorizontalPodAutoscaler behavior as defined in the [reference](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#horizontalpodautoscalerbehavior-v2-autoscaling) | `nil` |
| `deviceconnect.gracefulShutdownTimeout` | Timeout for the graceful shutdown | `60s` |
| `deviceconnect.terminationGracePeriodSeconds` | Termination grace period in seconds | `65` |
| `deviceconnect.pdb.enabled` | PodDistruptionBudget enabled | `nil` |
| `deviceconnect.pdb.minAvailable` | PodDistruptionBudget minAvailable | `nil` |
| `deviceconnect.pdb.maxUnavailable` | PodDistruptionBudget maxUnavailable | `nil` |
| `deviceconnect.priorityClassName` | Optional pre-existing priorityClassName to be assigned to the resource | `nil` |
| `deviceconnect.migrationRestartPolicy` | Migration job: restartPolicy option | `Never` |
| `deviceconnect.migrationResources` | Migration job: optional K8s resources. If not specified, uses the deployment resources | `nil` |
Expand Down
4 changes: 4 additions & 0 deletions mender/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Mender Helm chart

## Version 5.9.0
* Added `pdb.maxUnavailable` option.
* Added `deviceconnect` PodDisruptionBudget

## Version 5.8.3
* Fix: correctly setup the Integration Version.

Expand Down
2 changes: 1 addition & 1 deletion mender/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
appVersion: "3.7.4"
description: Mender is a robust and secure way to update all your software and deploy your IoT devices at scale with support for customization
name: mender
version: 5.8.3
version: 5.9.0
keywords:
- mender
- iot
Expand Down
7 changes: 7 additions & 0 deletions mender/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,19 @@ spec:
{{- $_ := (mergeOverwrite $pdb .override.pdb) }}
{{- end }}
{{- if $pdb.enabled }}
{{- if and $pdb.minAvailable $pdb.maxUnavailable }}
{{- fail "Only one of minAvailable or maxUnavailable can be set" }}
{{- end }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ .name }}
spec:
{{- if $pdb.minAvailable }}
minAvailable: {{ $pdb.minAvailable | default 1 }}
{{- else if $pdb.maxUnavailable }}
maxUnavailable: {{ $pdb.maxUnavailable | default 1 }}
{{- end }}
selector:
matchLabels:
run: {{ .name }}
Expand Down
5 changes: 5 additions & 0 deletions mender/templates/deviceconnect/pdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{{- if .Values.deviceconnect.enabled }}
{{- $servicename := "deviceconnect" }}
{{- $context := (dict "default" .Values.default "override" .Values.deviceconnect "name" (printf "%s-%s" (include "mender.fullname" . ) $servicename ) ) -}}
{{- include "mender.pdb" $context }}
{{- end }}
1 change: 1 addition & 0 deletions mender/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ default:
pdb:
enabled: false
minAvailable: 1
# maxUnavailable: 1

# custom default envs for every service
customEnvs: []
Expand Down

0 comments on commit 8fabfab

Please sign in to comment.