Skip to content

Commit

Permalink
Merge pull request #206 from NoUseFreak/tusd-pdb
Browse files Browse the repository at this point in the history
feat(charts/tusd): Allow setting PDB
  • Loading branch information
sagikazarmark authored Feb 5, 2024
2 parents 61487da + bef9980 commit 7d3dd02
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 3 deletions.
4 changes: 2 additions & 2 deletions charts/tusd/Chart.yaml
Original file line number Diff line number Diff line change
@@ -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."
Expand All @@ -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
5 changes: 4 additions & 1 deletion charts/tusd/README.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down Expand Up @@ -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. |
Expand Down
19 changes: 19 additions & 0 deletions charts/tusd/templates/pdb.yaml
Original file line number Diff line number Diff line change
@@ -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 }}

11 changes: 11 additions & 0 deletions charts/tusd/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: {}
Expand Down

0 comments on commit 7d3dd02

Please sign in to comment.