From c26e63c5ba34d574533d199c5774715b9f57bcc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Skyler=20M=C3=A4ntysaari?= Date: Tue, 18 Apr 2023 01:42:33 +0300 Subject: [PATCH] Allow resource limits and add config validator. Fixes #4 --- charts/apps/piped/Chart.yaml | 6 ++++-- charts/apps/piped/README.md | 8 ++++---- charts/apps/piped/templates/backend/lib/_pod.tpl | 4 ++++ .../apps/piped/templates/frontend/config-validator.yaml | 7 +++++++ charts/apps/piped/templates/frontend/lib/_pod.tpl | 4 ++++ charts/apps/piped/templates/ytproxy/lib/_pod.tpl | 4 ++++ 6 files changed, 27 insertions(+), 6 deletions(-) create mode 100644 charts/apps/piped/templates/frontend/config-validator.yaml diff --git a/charts/apps/piped/Chart.yaml b/charts/apps/piped/Chart.yaml index 3498f40..d953502 100644 --- a/charts/apps/piped/Chart.yaml +++ b/charts/apps/piped/Chart.yaml @@ -9,7 +9,7 @@ sources: - https://github.com/TeamPiped/piped-proxy keywords: - streaming -version: 2.0.1 +version: 2.0.2 appVersion: latest kubeVersion: ">=1.22.0-0" maintainers: @@ -27,4 +27,6 @@ dependencies: annotations: artifacthub.io/changes: |- - kind: fixed - description: "The backend configmap generation (GH issue: https://github.com/TeamPiped/Piped-Kubernetes/issues/2)" + description: Allow specifying of resource limits. + - kind: changed + description: Added a config validator for frontend. diff --git a/charts/apps/piped/README.md b/charts/apps/piped/README.md index c254fe4..62fd7c1 100644 --- a/charts/apps/piped/README.md +++ b/charts/apps/piped/README.md @@ -1,6 +1,6 @@ # piped -![Version: 2.0.1](https://img.shields.io/badge/Version-2.0.1-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square) +![Version: 2.0.2](https://img.shields.io/badge/Version-2.0.2-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square) Piped is an alternative privacy-friendly YouTube frontend which is efficient by design. @@ -160,7 +160,7 @@ helm install piped TeamPiped/piped -f values.yaml ## Changelog -### Version 2.0.1 +### Version 2.0.2 #### Added @@ -168,11 +168,11 @@ N/A #### Changed -N/A +* Added a config validator for frontend. #### Fixed -- The backend configmap generation (GH issue: https://github.com/TeamPiped/Piped-Kubernetes/issues/2) +* Allow specifying of resource limits. ## Support diff --git a/charts/apps/piped/templates/backend/lib/_pod.tpl b/charts/apps/piped/templates/backend/lib/_pod.tpl index 1f047dc..b396696 100644 --- a/charts/apps/piped/templates/backend/lib/_pod.tpl +++ b/charts/apps/piped/templates/backend/lib/_pod.tpl @@ -102,4 +102,8 @@ topologySpreadConstraints: tolerations: {{- toYaml . | nindent 2 }} {{- end }} + {{- with .Values.resources }} +resources: + {{- toYaml . | nindent 2 }} + {{- end }} {{- end -}} diff --git a/charts/apps/piped/templates/frontend/config-validator.yaml b/charts/apps/piped/templates/frontend/config-validator.yaml new file mode 100644 index 0000000..a46c60a --- /dev/null +++ b/charts/apps/piped/templates/frontend/config-validator.yaml @@ -0,0 +1,7 @@ +{{- if .Values.frontend.env }} +{{- $envVar := .Values.frontend.env.BACKEND_HOSTNAME }} +{{ else if .Values.ingress.main.enabled }} + {{- $envVar := index (index .Values.ingress.main.hosts 0) "host" }} +{{- else }} + {{- fail "Frontend container environment is missing a required variable BACKEND_HOSTNAME or main ingress is not enabled." .Values.frontend.env }} +{{- end }} \ No newline at end of file diff --git a/charts/apps/piped/templates/frontend/lib/_pod.tpl b/charts/apps/piped/templates/frontend/lib/_pod.tpl index 66eca12..6443511 100644 --- a/charts/apps/piped/templates/frontend/lib/_pod.tpl +++ b/charts/apps/piped/templates/frontend/lib/_pod.tpl @@ -98,4 +98,8 @@ topologySpreadConstraints: tolerations: {{- toYaml . | nindent 2 }} {{- end }} + {{- with .Values.resources }} +resources: + {{- toYaml . | nindent 2 }} + {{- end }} {{- end -}} diff --git a/charts/apps/piped/templates/ytproxy/lib/_pod.tpl b/charts/apps/piped/templates/ytproxy/lib/_pod.tpl index fde2d87..10cc56f 100644 --- a/charts/apps/piped/templates/ytproxy/lib/_pod.tpl +++ b/charts/apps/piped/templates/ytproxy/lib/_pod.tpl @@ -102,4 +102,8 @@ topologySpreadConstraints: tolerations: {{- toYaml . | nindent 2 }} {{- end -}} + {{- with .Values.resources }} +resources: + {{- toYaml . | nindent 2 }} + {{- end }} {{- end -}}