From 7ef200e9518ca7528df19949d6136dd50b5336f1 Mon Sep 17 00:00:00 2001 From: Dries De Peuter Date: Tue, 5 Dec 2023 23:29:28 +0100 Subject: [PATCH 1/2] feat(charts/tusd): Allow setting PDB --- charts/tusd/Chart.yaml | 4 ++-- charts/tusd/templates/pdb.yaml | 19 +++++++++++++++++++ charts/tusd/values.yaml | 11 +++++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 charts/tusd/templates/pdb.yaml diff --git a/charts/tusd/Chart.yaml b/charts/tusd/Chart.yaml index 283f485..550e861 100644 --- a/charts/tusd/Chart.yaml +++ b/charts/tusd/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 type: application name: tusd -version: 0.1.1 +version: 0.1.2 appVersion: "1.10.0" kubeVersion: ">=1.16.0-0" description: "Reference server implementation in Go of tus: the open protocol for resumable file uploads." @@ -19,7 +19,7 @@ maintainers: url: https://sagikazarmark.hu annotations: artifacthub.io/changes: | - - Ensure all arguments are strings + - Add optional PDB artifacthub.io/images: | - name: tusd image: tusproject/tusd:v1.10.0 diff --git a/charts/tusd/templates/pdb.yaml b/charts/tusd/templates/pdb.yaml new file mode 100644 index 0000000..e77fff6 --- /dev/null +++ b/charts/tusd/templates/pdb.yaml @@ -0,0 +1,19 @@ +{{- if .Values.podDisruptionBudget.enabled }} +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: {{ include "tusd.fullname" . }} + labels: + {{- include "tusd.labels" . | nindent 4 }} +spec: + {{- with .Values.podDisruptionBudget.minAvailable }} + minAvailable: {{ . }} + {{- end }} + {{- with .Values.podDisruptionBudget.maxUnavailable }} + maxUnavailable: {{ . }} + {{- end }} + selector: + matchLabels: + {{- include "tusd.selectorLabels" . | nindent 6 }} +{{- end }} + diff --git a/charts/tusd/values.yaml b/charts/tusd/values.yaml index 95199ff..1c5af58 100644 --- a/charts/tusd/values.yaml +++ b/charts/tusd/values.yaml @@ -57,6 +57,17 @@ deploymentAnnotations: {} # -- Annotations to be added to pods. podAnnotations: {} +podDisruptionBudget: + # -- Enable a [pod distruption budget](https://kubernetes.io/docs/tasks/run-application/configure-pdb/) to help dealing with [disruptions](https://kubernetes.io/docs/concepts/workloads/pods/disruptions/). + # It is **highly recommended** for webhooks as disruptions can prevent launching new pods. + enabled: false + + # -- (int/percentage) Number or percentage of pods that must remain available. + minAvailable: + + # -- (int/percentage) Number or percentage of pods that can be unavailable. + maxUnavailable: + # -- Pod [security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod). # See the [API reference](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#security-context) for details. podSecurityContext: {} From bef99808bbd79a2a71082faced746c70cb60ab95 Mon Sep 17 00:00:00 2001 From: Dries De Peuter Date: Fri, 12 Jan 2024 08:50:57 +0100 Subject: [PATCH 2/2] docs(charts/CHART): regenerate documentation --- charts/tusd/README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/charts/tusd/README.md b/charts/tusd/README.md index 83d402c..059468e 100644 --- a/charts/tusd/README.md +++ b/charts/tusd/README.md @@ -1,6 +1,6 @@ # tusd -![version: 0.1.1](https://img.shields.io/badge/version-0.1.1-informational?style=flat-square) ![type: application](https://img.shields.io/badge/type-application-informational?style=flat-square) ![app version: 1.10.0](https://img.shields.io/badge/app%20version-1.10.0-informational?style=flat-square) ![kube version: >=1.16.0-0](https://img.shields.io/badge/kube%20version->=1.16.0--0-informational?style=flat-square) [![artifact hub](https://img.shields.io/badge/artifact%20hub-tusd-informational?style=flat-square)](https://artifacthub.io/packages/helm/sagikazarmark/tusd) +![version: 0.1.2](https://img.shields.io/badge/version-0.1.2-informational?style=flat-square) ![type: application](https://img.shields.io/badge/type-application-informational?style=flat-square) ![app version: 1.10.0](https://img.shields.io/badge/app%20version-1.10.0-informational?style=flat-square) ![kube version: >=1.16.0-0](https://img.shields.io/badge/kube%20version->=1.16.0--0-informational?style=flat-square) [![artifact hub](https://img.shields.io/badge/artifact%20hub-tusd-informational?style=flat-square)](https://artifacthub.io/packages/helm/sagikazarmark/tusd) Reference server implementation in Go of tus: the open protocol for resumable file uploads. @@ -33,6 +33,9 @@ helm install --generate-name --wait skm/tusd | serviceAccount.name | string | `""` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template. | | deploymentAnnotations | object | `{}` | Annotations to be added to deployments. | | podAnnotations | object | `{}` | Annotations to be added to pods. | +| podDisruptionBudget.enabled | bool | `false` | Enable a [pod distruption budget](https://kubernetes.io/docs/tasks/run-application/configure-pdb/) to help dealing with [disruptions](https://kubernetes.io/docs/concepts/workloads/pods/disruptions/). It is **highly recommended** for webhooks as disruptions can prevent launching new pods. | +| podDisruptionBudget.minAvailable | int/percentage | `nil` | Number or percentage of pods that must remain available. | +| podDisruptionBudget.maxUnavailable | int/percentage | `nil` | Number or percentage of pods that can be unavailable. | | podSecurityContext | object | `{}` | Pod [security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod). See the [API reference](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#security-context) for details. | | securityContext | object | `{}` | Container [security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container). See the [API reference](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#security-context-1) for details. | | initContainers | list | `[]` | Additional [init containers](https://kubernetes.io/docs/concepts/workloads/pods/init-containers/) to be added to pods. |