Skip to content

Commit

Permalink
[synthetics] Add support for PDB for private location deployment (#1459)
Browse files Browse the repository at this point in the history
* feat(synthetics): add pdb support for private locations

* feat(synthetics): add pdb support for private locations
  • Loading branch information
tr3mor authored Jul 17, 2024
1 parent aec9e19 commit d661a02
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 2 deletions.
4 changes: 4 additions & 0 deletions charts/synthetics-private-location/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Datadog changelog

## 0.17.0

* Add `podDisruptionBudget` to allow creating and configuring PodDisruptionBudget for deployment.

## 0.16.4

* Update private location image version to `1.49.0`.
Expand Down
2 changes: 1 addition & 1 deletion charts/synthetics-private-location/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: synthetics-private-location
version: 0.16.4
version: 0.17.0
appVersion: 1.49.0
description: Datadog Synthetics Private Location
keywords:
Expand Down
3 changes: 2 additions & 1 deletion charts/synthetics-private-location/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Datadog Synthetics Private Location

![Version: 0.16.4](https://img.shields.io/badge/Version-0.16.4-informational?style=flat-square) ![AppVersion: 1.49.0](https://img.shields.io/badge/AppVersion-1.49.0-informational?style=flat-square)
![Version: 0.17.0](https://img.shields.io/badge/Version-0.17.0-informational?style=flat-square) ![AppVersion: 1.49.0](https://img.shields.io/badge/AppVersion-1.49.0-informational?style=flat-square)

[Datadog](https://www.datadoghq.com/) is a hosted infrastructure monitoring platform. This chart adds a Datadog Synthetics Private Location Deployment. For more information about synthetics monitoring with Datadog, please refer to the [Datadog documentation website](https://docs.datadoghq.com/synthetics/private_locations/?tab=helmchart).

Expand Down Expand Up @@ -46,6 +46,7 @@ helm install <RELEASE_NAME> datadog/synthetics-private-location --set-file confi
| nameOverride | string | `""` | Override name of app |
| nodeSelector | object | `{}` | Allows to schedule Datadog Synthetics Private Location on specific nodes |
| podAnnotations | object | `{}` | Annotations to set to Datadog Synthetics Private Location PODs |
| podDisruptionBudget | object | `{"enabled":false,"minAvailable":1}` | Allows to create and configure PodDisruptionBudget for Datadog Synthetics Private Location deployment |
| podLabels | object | `{}` | Labels to be placed on pods managed by the deployment |
| podSecurityContext | object | `{}` | Security context to set to Datadog Synthetics Private Location PODs |
| priorityClassName | string | `""` | Allows to specify PriorityClass for Datadog Synthetics Private Location PODs |
Expand Down
11 changes: 11 additions & 0 deletions charts/synthetics-private-location/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,14 @@ Create the name of the service account to use
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
Return the appropriate apiVersion for PodDisruptionBudget policy APIs.
*/}}
{{- define "policy.poddisruptionbudget.apiVersion" -}}
{{- if or (.Capabilities.APIVersions.Has "policy/v1/PodDisruptionBudget") (semverCompare ">=1.21" .Capabilities.KubeVersion.Version) -}}
"policy/v1"
{{- else -}}
"policy/v1beta1"
{{- end -}}
{{- end -}}
17 changes: 17 additions & 0 deletions charts/synthetics-private-location/templates/pdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{- if .Values.podDisruptionBudget.enabled -}}
apiVersion: {{ template "policy.poddisruptionbudget.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
name: {{ include "synthetics-private-location.fullname" . }}
labels:
{{- include "synthetics-private-location.labels" . | nindent 4 }}
spec:
{{- if .Values.podDisruptionBudget.minAvailable }}
minAvailable: {{ .Values.podDisruptionBudget.minAvailable }}
{{- end }}
{{- if .Values.podDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }}
{{- end }}
selector:
matchLabels: {{- include "synthetics-private-location.selectorLabels" . | nindent 6 }}
{{- end -}}
6 changes: 6 additions & 0 deletions charts/synthetics-private-location/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,9 @@ enableStatusProbes: false

# priorityClassName -- Allows to specify PriorityClass for Datadog Synthetics Private Location PODs
priorityClassName: ""

# podDisruptionBudget -- Allows to create and configure PodDisruptionBudget for Datadog Synthetics Private Location deployment
podDisruptionBudget:
enabled: false
minAvailable: 1
# maxUnavailable: 1

0 comments on commit d661a02

Please sign in to comment.