Clean up pod templates and fix templating.

There were multiple pod templates that were not using values due to how it is structured, now they do work.
This commit is contained in:
Skyler Mäntysaari 2023-04-19 01:53:54 +03:00
parent c26e63c5ba
commit 1bb362f205
6 changed files with 81 additions and 63 deletions

View file

@ -9,7 +9,7 @@ sources:
- https://github.com/TeamPiped/piped-proxy - https://github.com/TeamPiped/piped-proxy
keywords: keywords:
- streaming - streaming
version: 2.0.2 version: 2.1.0
appVersion: latest appVersion: latest
kubeVersion: ">=1.22.0-0" kubeVersion: ">=1.22.0-0"
maintainers: maintainers:
@ -27,6 +27,6 @@ dependencies:
annotations: annotations:
artifacthub.io/changes: |- artifacthub.io/changes: |-
- kind: fixed - kind: fixed
description: Allow specifying of resource limits. description: Pod templates that were not getting things from values
- kind: changed - kind: added
description: Added a config validator for frontend. description: Recommended resource limits were added to values, but are not enabled by default to make it concise decision to the user.

View file

@ -1,6 +1,6 @@
# piped # piped
![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) ![Version: 2.1.0](https://img.shields.io/badge/Version-2.1.0-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. Piped is an alternative privacy-friendly YouTube frontend which is efficient by design.
@ -160,19 +160,19 @@ helm install piped TeamPiped/piped -f values.yaml
## Changelog ## Changelog
### Version 2.0.2 ### Version 2.1.0
#### Added #### Added
N/A * Recommended resource limits were added to values, but are not enabled by default to make it concise decision to the user.
#### Changed #### Changed
* Added a config validator for frontend. N/A
#### Fixed #### Fixed
* Allow specifying of resource limits. * Pod templates that were not getting things from values
## Support ## Support

View file

@ -2,50 +2,50 @@
The pod definition included in the controller. The pod definition included in the controller.
*/ -}} */ -}}
{{- define "backend.controller.pod" -}} {{- define "backend.controller.pod" -}}
{{- with .Values.imagePullSecrets }} {{- with .Values.backend.imagePullSecrets }}
imagePullSecrets: imagePullSecrets:
{{- toYaml . | nindent 2 }} {{- toYaml . | nindent 2 }}
{{- end }} {{- end }}
serviceAccountName: {{ include "backend.names.serviceAccountName" . }} serviceAccountName: {{ include "backend.names.serviceAccountName" . }}
automountServiceAccountToken: {{ .Values.automountServiceAccountToken }} automountServiceAccountToken: {{ .Values.automountServiceAccountToken }}
{{- with .Values.podSecurityContext }} {{- with .Values.backend.podSecurityContext }}
securityContext: securityContext:
{{- toYaml . | nindent 2 }} {{- toYaml . | nindent 2 }}
{{- end }} {{- end }}
{{- with .Values.priorityClassName }} {{- with .Values.backend.priorityClassName }}
priorityClassName: {{ . }} priorityClassName: {{ . }}
{{- end }} {{- end }}
{{- with .Values.runtimeClassName }} {{- with .Values.backend.runtimeClassName }}
runtimeClassName: {{ . }} runtimeClassName: {{ . }}
{{- end }} {{- end }}
{{- with .Values.schedulerName }} {{- with .Values.backend.schedulerName }}
schedulerName: {{ . }} schedulerName: {{ . }}
{{- end }} {{- end }}
{{- with .Values.hostNetwork }} {{- with .Values.backend.hostNetwork }}
hostNetwork: {{ . }} hostNetwork: {{ . }}
{{- end }} {{- end }}
{{- with .Values.hostname }} {{- with .Values.backend.hostname }}
hostname: {{ . }} hostname: {{ . }}
{{- end }} {{- end }}
{{- if .Values.dnsPolicy }} {{- if .Values.backend.dnsPolicy }}
dnsPolicy: {{ .Values.dnsPolicy }} dnsPolicy: {{ .Values.backend.dnsPolicy }}
{{- else if .Values.hostNetwork }} {{- else if .Values.backend.hostNetwork }}
dnsPolicy: ClusterFirstWithHostNet dnsPolicy: ClusterFirstWithHostNet
{{- else }} {{- else }}
dnsPolicy: ClusterFirst dnsPolicy: ClusterFirst
{{- end }} {{- end }}
{{- with .Values.dnsConfig }} {{- with .Values.backend.dnsConfig }}
dnsConfig: dnsConfig:
{{- toYaml . | nindent 2 }} {{- toYaml . | nindent 2 }}
{{- end }} {{- end }}
enableServiceLinks: {{ .Values.enableServiceLinks }} enableServiceLinks: {{ .Values.backend.enableServiceLinks }}
{{- with .Values.termination.gracePeriodSeconds }} {{- with .Values.termination.gracePeriodSeconds }}
terminationGracePeriodSeconds: {{ . }} terminationGracePeriodSeconds: {{ . }}
{{- end }} {{- end }}
{{- if .Values.initContainers }} {{- if .Values.backend.initContainers }}
initContainers: initContainers:
{{- $initContainers := list }} {{- $initContainers := list }}
{{- range $index, $key := (keys .Values.initContainers | uniq | sortAlpha) }} {{- range $index, $key := (keys .Values.backend.initContainers | uniq | sortAlpha) }}
{{- $container := get $.Values.initContainers $key }} {{- $container := get $.Values.initContainers $key }}
{{- if not $container.name -}} {{- if not $container.name -}}
{{- $_ := set $container "name" $key }} {{- $_ := set $container "name" $key }}
@ -82,27 +82,27 @@ containers:
volumes: volumes:
{{- nindent 2 . }} {{- nindent 2 . }}
{{- end }} {{- end }}
{{- with .Values.hostAliases }} {{- with .Values.backend.hostAliases }}
hostAliases: hostAliases:
{{- toYaml . | nindent 2 }} {{- toYaml . | nindent 2 }}
{{- end }} {{- end }}
{{- with .Values.nodeSelector }} {{- with .Values.backend.nodeSelector }}
nodeSelector: nodeSelector:
{{- toYaml . | nindent 2 }} {{- toYaml . | nindent 2 }}
{{- end }} {{- end }}
{{- with .Values.affinity }} {{- with .Values.backend.affinity }}
affinity: affinity:
{{- toYaml . | nindent 2 }} {{- toYaml . | nindent 2 }}
{{- end }} {{- end }}
{{- with .Values.topologySpreadConstraints }} {{- with .Values.backend.topologySpreadConstraints }}
topologySpreadConstraints: topologySpreadConstraints:
{{- toYaml . | nindent 2 }} {{- toYaml . | nindent 2 }}
{{- end }} {{- end }}
{{- with .Values.tolerations }} {{- with .Values.backend.tolerations }}
tolerations: tolerations:
{{- toYaml . | nindent 2 }} {{- toYaml . | nindent 2 }}
{{- end }} {{- end }}
{{- with .Values.resources }} {{- with .Values.backend.resources }}
resources: resources:
{{- toYaml . | nindent 2 }} {{- toYaml . | nindent 2 }}
{{- end }} {{- end }}

View file

@ -2,50 +2,50 @@
The pod definition included in the controller. The pod definition included in the controller.
*/ -}} */ -}}
{{- define "frontend.controller.pod" -}} {{- define "frontend.controller.pod" -}}
{{- with .Values.imagePullSecrets }} {{- with .Values.frontend.imagePullSecrets }}
imagePullSecrets: imagePullSecrets:
{{- toYaml . | nindent 2 }} {{- toYaml . | nindent 2 }}
{{- end }} {{- end }}
serviceAccountName: {{ include "frontend.names.serviceAccountName" . }} serviceAccountName: {{ include "frontend.names.serviceAccountName" . }}
automountServiceAccountToken: {{ .Values.automountServiceAccountToken }} automountServiceAccountToken: {{ .Values.automountServiceAccountToken }}
{{- with .Values.podSecurityContext }} {{- with .Values.frontend.podSecurityContext }}
securityContext: securityContext:
{{- toYaml . | nindent 2 }} {{- toYaml . | nindent 2 }}
{{- end }} {{- end }}
{{- with .Values.priorityClassName }} {{- with .Values.frontend.priorityClassName }}
priorityClassName: {{ . }} priorityClassName: {{ . }}
{{- end }} {{- end }}
{{- with .Values.runtimeClassName }} {{- with .Values.frontend.runtimeClassName }}
runtimeClassName: {{ . }} runtimeClassName: {{ . }}
{{- end }} {{- end }}
{{- with .Values.schedulerName }} {{- with .Values.frontend.schedulerName }}
schedulerName: {{ . }} schedulerName: {{ . }}
{{- end }} {{- end }}
{{- with .Values.hostNetwork }} {{- with .Values.frontend.hostNetwork }}
hostNetwork: {{ . }} hostNetwork: {{ . }}
{{- end }} {{- end }}
{{- with .Values.hostname }} {{- with .Values.frontend.hostname }}
hostname: {{ . }} hostname: {{ . }}
{{- end }} {{- end }}
{{- if .Values.dnsPolicy }} {{- if .Values.frontend.dnsPolicy }}
dnsPolicy: {{ .Values.dnsPolicy }} dnsPolicy: {{ .Values.frontend.dnsPolicy }}
{{- else if .Values.hostNetwork }} {{- else if .Values.frontend.hostNetwork }}
dnsPolicy: ClusterFirstWithHostNet dnsPolicy: ClusterFirstWithHostNet
{{- else }} {{- else }}
dnsPolicy: ClusterFirst dnsPolicy: ClusterFirst
{{- end }} {{- end }}
{{- with .Values.dnsConfig }} {{- with .Values.frontend.dnsConfig }}
dnsConfig: dnsConfig:
{{- toYaml . | nindent 2 }} {{- toYaml . | nindent 2 }}
{{- end }} {{- end }}
enableServiceLinks: {{ .Values.enableServiceLinks }} enableServiceLinks: {{ .Values.frontend.enableServiceLinks }}
{{- with .Values.termination.gracePeriodSeconds }} {{- with .Values.termination.gracePeriodSeconds }}
terminationGracePeriodSeconds: {{ . }} terminationGracePeriodSeconds: {{ . }}
{{- end }} {{- end }}
{{- if .Values.initContainers }} {{- if .Values.frontend.initContainers }}
initContainers: initContainers:
{{- $initContainers := list }} {{- $initContainers := list }}
{{- range $index, $key := (keys .Values.initContainers | uniq | sortAlpha) }} {{- range $index, $key := (keys .Values.frontend.initContainers | uniq | sortAlpha) }}
{{- $container := get $.Values.initContainers $key }} {{- $container := get $.Values.initContainers $key }}
{{- if not $container.name -}} {{- if not $container.name -}}
{{- $_ := set $container "name" $key }} {{- $_ := set $container "name" $key }}
@ -78,27 +78,27 @@ containers:
{{- end }} {{- end }}
{{- tpl (toYaml $additionalContainers) $ | nindent 2 }} {{- tpl (toYaml $additionalContainers) $ | nindent 2 }}
{{- end }} {{- end }}
{{- with .Values.hostAliases }} {{- with .Values.frontend.hostAliases }}
hostAliases: hostAliases:
{{- toYaml . | nindent 2 }} {{- toYaml . | nindent 2 }}
{{- end }} {{- end }}
{{- with .Values.nodeSelector }} {{- with .Values.frontend.nodeSelector }}
nodeSelector: nodeSelector:
{{- toYaml . | nindent 2 }} {{- toYaml . | nindent 2 }}
{{- end }} {{- end }}
{{- with .Values.affinity }} {{- with .Values.frontend.affinity }}
affinity: affinity:
{{- toYaml . | nindent 2 }} {{- toYaml . | nindent 2 }}
{{- end }} {{- end }}
{{- with .Values.topologySpreadConstraints }} {{- with .Values.frontend.topologySpreadConstraints }}
topologySpreadConstraints: topologySpreadConstraints:
{{- toYaml . | nindent 2 }} {{- toYaml . | nindent 2 }}
{{- end }} {{- end }}
{{- with .Values.tolerations }} {{- with .Values.frontend.tolerations }}
tolerations: tolerations:
{{- toYaml . | nindent 2 }} {{- toYaml . | nindent 2 }}
{{- end }} {{- end }}
{{- with .Values.resources }} {{- with .Values.frontend.resources }}
resources: resources:
{{- toYaml . | nindent 2 }} {{- toYaml . | nindent 2 }}
{{- end }} {{- end }}

View file

@ -2,50 +2,50 @@
The pod definition included in the controller. The pod definition included in the controller.
*/ -}} */ -}}
{{- define "ytproxy.controller.pod" -}} {{- define "ytproxy.controller.pod" -}}
{{- with .Values.imagePullSecrets }} {{- with .Values.ytproxy.imagePullSecrets }}
imagePullSecrets: imagePullSecrets:
{{- toYaml . | nindent 2 }} {{- toYaml . | nindent 2 }}
{{- end }} {{- end }}
serviceAccountName: {{ include "ytproxy.names.serviceAccountName" . }} serviceAccountName: {{ include "ytproxy.names.serviceAccountName" . }}
automountServiceAccountToken: {{ .Values.automountServiceAccountToken }} automountServiceAccountToken: {{ .Values.automountServiceAccountToken }}
{{- with .Values.podSecurityContext }} {{- with .Values.ytproxy.podSecurityContext }}
securityContext: securityContext:
{{- toYaml . | nindent 2 }} {{- toYaml . | nindent 2 }}
{{- end }} {{- end }}
{{- with .Values.priorityClassName }} {{- with .Values.ytproxy.priorityClassName }}
priorityClassName: {{ . }} priorityClassName: {{ . }}
{{- end }} {{- end }}
{{- with .Values.runtimeClassName }} {{- with .Values.ytproxy.runtimeClassName }}
runtimeClassName: {{ . }} runtimeClassName: {{ . }}
{{- end }} {{- end }}
{{- with .Values.schedulerName }} {{- with .Values.ytproxy.schedulerName }}
schedulerName: {{ . }} schedulerName: {{ . }}
{{- end }} {{- end }}
{{- with .Values.hostNetwork }} {{- with .Values.ytproxy.hostNetwork }}
hostNetwork: {{ . }} hostNetwork: {{ . }}
{{- end }} {{- end }}
{{- with .Values.hostname }} {{- with .Values.ytproxy.hostname }}
hostname: {{ . }} hostname: {{ . }}
{{- end }} {{- end }}
{{- if .Values.dnsPolicy }} {{- if .Values.ytproxy.dnsPolicy }}
dnsPolicy: {{ .Values.dnsPolicy }} dnsPolicy: {{ .Values.ytproxy.dnsPolicy }}
{{- else if .Values.hostNetwork }} {{- else if .Values.ytproxy.hostNetwork }}
dnsPolicy: ClusterFirstWithHostNet dnsPolicy: ClusterFirstWithHostNet
{{- else }} {{- else }}
dnsPolicy: ClusterFirst dnsPolicy: ClusterFirst
{{- end }} {{- end }}
{{- with .Values.dnsConfig }} {{- with .Values.ytproxy.dnsConfig }}
dnsConfig: dnsConfig:
{{- toYaml . | nindent 2 }} {{- toYaml . | nindent 2 }}
{{- end }} {{- end }}
enableServiceLinks: {{ .Values.enableServiceLinks }} enableServiceLinks: {{ .Values.ytproxy.enableServiceLinks }}
{{- with .Values.termination.gracePeriodSeconds }} {{- with .Values.termination.gracePeriodSeconds }}
terminationGracePeriodSeconds: {{ . }} terminationGracePeriodSeconds: {{ . }}
{{- end }} {{- end }}
{{- if .Values.initContainers }} {{- if .Values.ytproxy.initContainers }}
initContainers: initContainers:
{{- $initContainers := list }} {{- $initContainers := list }}
{{- range $index, $key := (keys .Values.initContainers | uniq | sortAlpha) }} {{- range $index, $key := (keys .Values.ytproxy.initContainers | uniq | sortAlpha) }}
{{- $container := get $.Values.initContainers $key }} {{- $container := get $.Values.initContainers $key }}
{{- if not $container.name -}} {{- if not $container.name -}}
{{- $_ := set $container "name" $key }} {{- $_ := set $container "name" $key }}

View file

@ -48,6 +48,12 @@ frontend:
- -c - -c
- "sed -i s/pipedapi.kavin.rocks/$BACKEND_HOSTNAME/g /usr/share/nginx/html/assets/* && /docker-entrypoint.sh && nginx -g 'daemon off;'" - "sed -i s/pipedapi.kavin.rocks/$BACKEND_HOSTNAME/g /usr/share/nginx/html/assets/* && /docker-entrypoint.sh && nginx -g 'daemon off;'"
#resources:
# requests:
# memory: 32Mi
# limits:
# memory: 128Mi
backend: backend:
enabled: true enabled: true
service: service:
@ -105,6 +111,12 @@ backend:
# -- image pull policy # -- image pull policy
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
#resources:
# requests:
# memory: 500Mi
# limits:
# memory: 1500Mi
ytproxy: ytproxy:
enabled: true enabled: true
service: service:
@ -131,6 +143,12 @@ ytproxy:
# -- image pull policy # -- image pull policy
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
#resources:
# requests:
# memory: 32Mi
# limits:
# memory: 500Mi
ingress: ingress:
main: main:
enabled: true enabled: true