Skip to content

Commit

Permalink
feat(vector): Switch policy version based on capabilities and k8s ver…
Browse files Browse the repository at this point in the history
…sion (#197)

* feat(vector): Switch policy version based on capabilities and k8s version

Signed-off-by: Spencer Gilbert <[email protected]>

* version bump

Signed-off-by: Spencer Gilbert <[email protected]>
  • Loading branch information
spencergilbert authored Apr 14, 2022
1 parent f3825de commit 347403e
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion charts/vector/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: vector
version: "0.9.0"
version: "0.10.0"
kubeVersion: ">=1.15.0-0"
description: A lightweight, ultra-fast tool for building observability pipelines
type: application
Expand Down
2 changes: 1 addition & 1 deletion charts/vector/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Vector

![Version: 0.9.0](https://img.shields.io/badge/Version-0.9.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.20.1-distroless-libc](https://img.shields.io/badge/AppVersion-0.20.1--distroless--libc-informational?style=flat-square)
![Version: 0.10.0](https://img.shields.io/badge/Version-0.10.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.20.1-distroless-libc](https://img.shields.io/badge/AppVersion-0.20.1--distroless--libc-informational?style=flat-square)

[Vector](https://vector.dev/) is a high-performance, end-to-end observability data pipeline that puts you in control of your observability data. Collect, transform, and route all your logs, metrics, and traces to any vendors you want today and any other vendors you may want tomorrow. Vector enables dramatic cost reduction, novel data enrichment, and data security where you need it, not where is most convenient for your vendors.

Expand Down
11 changes: 11 additions & 0 deletions charts/vector/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,17 @@ Create the name of the service account to use.
{{- 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 -}}

{{/*
Generate an array of ServicePorts based on `.Values.customConfig`.
*/}}
Expand Down
2 changes: 1 addition & 1 deletion charts/vector/templates/_pod.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Defines the PodSpec for Vector.
*/}}
{{- define "vector.pod" -}}
serviceAccountName: {{ include "vector.serviceAccountName" . }}
serviceAccountName: {{ include "vector.serviceAccountName" . }}
{{- with .Values.podSecurityContext }}
securityContext:
{{ toYaml . | indent 2 }}
Expand Down
2 changes: 1 addition & 1 deletion charts/vector/templates/pdb.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.podDisruptionBudget.enabled }}
apiVersion: policy/v1beta1
apiVersion: {{ template "policy.poddisruptionbudget.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
name: {{ template "vector.fullname" . }}
Expand Down

0 comments on commit 347403e

Please sign in to comment.