Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PodDisruptionBudgets API version #835

Merged
merged 4 commits into from
Jun 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## Unreleased

### Added

- Update PodDisruptionBudgets API version to allow both `policy/v1beta1` and `policy/v1` [#835](https://github.com/signalfx/splunk-otel-collector-chart/pull/835)

## [0.80.0] - 2023-06-27

This Splunk OpenTelemetry Collector for Kubernetes release adopts the [Splunk OpenTelemetry Collector v0.80.0](https://github.com/signalfx/splunk-otel-collector/releases/tag/v0.80.0).
Expand Down
11 changes: 11 additions & 0 deletions helm-charts/splunk-otel-collector/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,17 @@ compatibility with the old config group name: "otelAgent".
{{- end }}
{{- end -}}

{{/*
The apiVersion for podDisruptionBudget policies.
*/}}
{{- define "splunk-otel-collector.PDB-apiVersion" -}}
{{- if (semverCompare ">= 1.21.0" .Capabilities.KubeVersion.Version) -}}
{{- print "policy/v1" -}}
{{- else -}}
{{- print "policy/v1beta1" -}}
{{- end -}}
{{- end -}}

{{/*
The name of the gateway service.
*/}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if and (eq (include "splunk-otel-collector.clusterReceiverEnabled" . ) "true" ) .Values.podDisruptionBudget }}
apiVersion: policy/v1beta1
apiVersion: {{ include "splunk-otel-collector.PDB-apiVersion" . }}
kind: PodDisruptionBudget
metadata:
name: {{ template "splunk-otel-collector.fullname" . }}-otel-k8s-cluster-receiver
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{ $gateway := fromYaml (include "splunk-otel-collector.gateway" .) }}
{{ $gatewayEnabled := eq (include "splunk-otel-collector.gatewayEnabled" .) "true" }}
{{- if and $gatewayEnabled .Values.podDisruptionBudget }}
apiVersion: policy/v1beta1
apiVersion: {{ include "splunk-otel-collector.PDB-apiVersion" . }}
kind: PodDisruptionBudget
metadata:
name: {{ template "splunk-otel-collector.fullname" . }}
Expand Down