From 3c9966560df194ec162eaeefaf938b66da0e4439 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Skyler=20M=C3=A4ntysaari?= Date: Sat, 4 Mar 2023 01:52:18 +0200 Subject: [PATCH] Major version release of Chart --- .github/ISSUE_TEMPLATE/bug-report.yml | 94 ++++++++++ .github/ISSUE_TEMPLATE/config.yml | 1 + .github/ISSUE_TEMPLATE/enhancement.yml | 37 ++++ charts/apps/piped/Chart.yaml | 12 +- charts/apps/piped/README.md | 97 ++++++++-- charts/apps/piped/README_CONFIG.md.gotmpl | 7 +- .../piped/templates/backend/configmap.yaml | 28 ++- .../piped/templates/backend/deployment.yaml | 4 +- .../apps/piped/templates/backend/ingress.yaml | 24 +-- charts/apps/piped/templates/common.yaml | 2 +- .../piped/templates/frontend/deployment.yaml | 4 +- .../piped/templates/frontend/ingress.yaml | 54 +++--- .../piped/templates/ytproxy/deployment.yaml | 4 +- .../apps/piped/templates/ytproxy/ingress.yaml | 54 +++--- charts/apps/piped/values.yaml | 14 +- hack/templates/.helmignore | 26 +++ hack/templates/README.md.gotmpl | 170 ++++++++++++++++++ hack/templates/README_CONFIG.md.gotmpl | 9 + 18 files changed, 524 insertions(+), 117 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug-report.yml create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/enhancement.yml create mode 100644 hack/templates/.helmignore create mode 100644 hack/templates/README.md.gotmpl create mode 100644 hack/templates/README_CONFIG.md.gotmpl diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml new file mode 100644 index 0000000..d5acd1e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -0,0 +1,94 @@ +--- +name: Bug report +description: Create a report to help us improve +title: '[] Concise description of the issue' +labels: ["bug"] + +# Header + +body: + - type: markdown + attributes: + value: | + Please search issues and discussions before opening a new bug report. + + # Helm Chart details + + - type: input + id: chart-name + attributes: + label: Helm chart name + description: Name of the Helm chart this issue relates to + placeholder: e.g. piped + validations: + required: true + + - type: input + id: chart-version + attributes: + label: Helm chart version + description: Version of the Helm chart this issue relates to + placeholder: e.g. 16.1.0 + validations: + required: true + + # Container details + + - type: input + id: container-image + attributes: + label: Container name + description: Name of the container image this issue relates to + placeholder: e.g. ghcr.io/linuxserver/sonarr + validations: + required: true + + - type: input + id: container-tag + attributes: + label: Container tag + description: Tag of the container image this issue relates to + placeholder: e.g. v3.0.7.1477 + validations: + required: true + + # Issue details + + - type: textarea + id: description + attributes: + label: Description + description: A clear and concise description of what the bug is. + validations: + required: true + + - type: textarea + id: expected-result + attributes: + label: Expected result + description: What did you expect to happen + validations: + required: true + + - type: textarea + id: helm-values + attributes: + label: Helm values to reproduce + description: A snippet of the relevant Helm values + placeholder: | + Enter your relevant YAML values here + render: YAML + validations: + required: true + + - type: textarea + id: other-info + attributes: + label: Additional Information + description: Anything to give further context to the bug report or information that will assist in solving the issue + + - type: textarea + id: repository-link + attributes: + label: Repo link + description: A link to a (public) Git repository where your values are available \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..ec4bb38 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: false \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/enhancement.yml b/.github/ISSUE_TEMPLATE/enhancement.yml new file mode 100644 index 0000000..8996c19 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/enhancement.yml @@ -0,0 +1,37 @@ +--- +name: Feature request +description: Suggest an idea for this project +title: '[] Concise description of the enhancement' +labels: ["enhancement"] + +# Header + +body: + - type: markdown + + # Helm Chart details + + - type: input + id: chart-name + attributes: + label: Helm chart name + description: Name of the Helm chart this issue relates to + placeholder: e.g. piped + validations: + required: true + + # Enhancement details + + - type: textarea + id: description + attributes: + label: Describe the solution you'd like + description: A clear and concise description of what you want to happen + validations: + required: true + + - type: textarea + id: other-info + attributes: + label: Additional Information + description: Anything to give further context to the requested new feature \ No newline at end of file diff --git a/charts/apps/piped/Chart.yaml b/charts/apps/piped/Chart.yaml index 62ea79b..7a4d150 100644 --- a/charts/apps/piped/Chart.yaml +++ b/charts/apps/piped/Chart.yaml @@ -9,16 +9,24 @@ sources: - https://github.com/TeamPiped/piped-proxy keywords: - streaming -version: 0.0.4 +version: 1.0.0 appVersion: latest +kubeVersion: ">=1.22.0-0" maintainers: - name: Skyler Mäntysaari email: samip5@users.noreply.github.com + url: https://github.com/samip5 dependencies: - name: common repository: https://bjw-s.github.io/helm-charts - version: 0.1.0 + version: 1.3.2 - name: postgresql repository: https://charts.bitnami.com/bitnami version: 12.2.0 condition: postgresql.enabled +annotations: + artifacthub.io/changes: |- + - kind: changed + description: Updated to common v1.3.2 which bumps kubeVersion to 1.22. + - kind: changed + description: Enabled the probes by default. diff --git a/charts/apps/piped/README.md b/charts/apps/piped/README.md index 7d24dd9..07df14e 100644 --- a/charts/apps/piped/README.md +++ b/charts/apps/piped/README.md @@ -1,16 +1,10 @@ # piped -![Version: 0.0.3](https://img.shields.io/badge/Version-0.0.3-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square) +![Version: 1.0.0](https://img.shields.io/badge/Version-1.0.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. -**Homepage:** - -## Maintainers - -| Name | Email | Url | -| ---- | ------ | --- | -| Skyler Mäntysaari | samip5@users.noreply.github.com | | +NOTICE: There is currently NO caching support included in the chart. ## Source Code @@ -20,13 +14,66 @@ Piped is an alternative privacy-friendly YouTube frontend which is efficient by ## Requirements +Kubernetes: `>=1.22.0-0` + +## Dependencies + | Repository | Name | Version | |------------|------|---------| -| https://bjw-s.github.io/helm-charts | common | 0.1.0 | +| https://bjw-s.github.io/helm-charts | common | 1.3.2 | | https://charts.bitnami.com/bitnami | postgresql | 12.2.0 | +## TL;DR + +```console +helm repo add TeamPiped https://helm.piped.video +helm repo update +helm install piped TeamPiped/piped +``` + +## Installing the Chart + +To install the chart with the release name `piped` + +```console +helm install piped TeamPiped/piped +``` + +## Uninstalling the Chart + +To uninstall the `piped` deployment + +```console +helm uninstall piped +``` + +The command removes all the Kubernetes components associated with the chart **including persistent volumes** and deletes the release. + +## Configuration + +Read through the [values.yaml](./values.yaml) file. It has several commented out suggested values. +Other values may be used from the [values.yaml](https://github.com/bjw-s/helm-charts/blob/main/charts/library/common/values.yaml) from the [common library](https://github.com/bjw-s/helm-charts/tree/main/charts/library/common). + +Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. + +```console +helm install piped \ + --set env.TZ="America/New York" \ + TeamPiped/piped +``` + +Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. + +```console +helm install piped TeamPiped/piped -f values.yaml +``` + +## Custom configuration + ## Values +**Important**: When deploying an application Helm chart you can add more values from the common library chart [here](https://github.com/bjw-s/helm-charts/tree/main/charts/library/common) + | Key | Type | Default | Description | |-----|------|---------|-------------| | backend.args[0] | string | `"-server"` | | @@ -43,8 +90,9 @@ Piped is an alternative privacy-friendly YouTube frontend which is efficient by | backend.args[8] | string | `"-Xgcpolicy:gencon"` | | | backend.args[9] | string | `"-Xshareclasses:allowClasspaths"` | | | backend.command | string | `"/opt/java/openjdk/bin/java"` | | +| backend.config.HTTP_WORKERS | int | `2` | | +| backend.config.PORT | int | `8080` | | | backend.enabled | bool | `true` | | -| backend.image | object | `{"pullPolicy":"IfNotPresent","repository":"1337kavin/piped","tag":null}` | Outgoing HTTP Proxy - eg: 127.0.0.1:8118 Captcha Parameters Enable haveibeenpwned compromised password API Disable Registration Feed Retention Time in Days connection_url: jdbc:postgresql://postgres:5432/piped driver_class: org.postgresql.Driver dialect: org.hibernate.dialect.PostgreSQLDialect username: piped password: changeme | | backend.image.pullPolicy | string | `"IfNotPresent"` | image pull policy | | backend.image.repository | string | `"1337kavin/piped"` | image repository | | backend.image.tag | string | `nil` | image tag @chart.appVersion | @@ -83,7 +131,7 @@ Piped is an alternative privacy-friendly YouTube frontend which is efficient by | ingress.main.enabled | bool | `true` | | | ingress.main.hosts[0].host | string | `"piped.video"` | | | ingress.main.hosts[0].paths[0].path | string | `"/"` | | -| ingress.main.primary | bool | `false` | | +| ingress.main.primary | bool | `true` | | | ingress.main.tls | list | `[]` | | | ingress.ytproxy.enabled | bool | `true` | | | ingress.ytproxy.hosts[0].host | string | `"ytproxy.piped.video"` | | @@ -99,15 +147,15 @@ Piped is an alternative privacy-friendly YouTube frontend which is efficient by | probes | object | See below | Probe configuration -- [[ref]](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) | | probes.liveness | object | See below | Liveness probe configuration | | probes.liveness.custom | bool | `false` | Set this to `true` if you wish to specify your own livenessProbe | -| probes.liveness.enabled | bool | `false` | Enable the liveness probe | +| probes.liveness.enabled | bool | `true` | Enable the liveness probe | | probes.liveness.spec | object | See below | The spec field contains the values for the default livenessProbe. If you selected `custom: true`, this field holds the definition of the livenessProbe. | | probes.readiness | object | See below | Redainess probe configuration | | probes.readiness.custom | bool | `false` | Set this to `true` if you wish to specify your own readinessProbe | -| probes.readiness.enabled | bool | `false` | Enable the readiness probe | +| probes.readiness.enabled | bool | `true` | Enable the readiness probe | | probes.readiness.spec | object | See below | The spec field contains the values for the default readinessProbe. If you selected `custom: true`, this field holds the definition of the readinessProbe. | | probes.startup | object | See below | Startup probe configuration | | probes.startup.custom | bool | `false` | Set this to `true` if you wish to specify your own startupProbe | -| probes.startup.enabled | bool | `false` | Enable the startup probe | +| probes.startup.enabled | bool | `true` | Enable the startup probe | | probes.startup.spec | object | See below | The spec field contains the values for the default startupProbe. If you selected `custom: true`, this field holds the definition of the startupProbe. | | serviceAccount.create | bool | `false` | | | termination.gracePeriodSeconds | string | `nil` | | @@ -124,5 +172,26 @@ Piped is an alternative privacy-friendly YouTube frontend which is efficient by | ytproxy.service.main.primary | bool | `true` | | | ytproxy.service.main.type | string | `"ClusterIP"` | | +## Changelog + +### Version 1.0.0 + +#### Added + +N/A + +#### Changed + +* Updated to common v1.3.2 which bumps kubeVersion to 1.22. +* Enabled the probes by default. + +#### Fixed + +N/A + +## Support + +- Open an [issue](https://github.com/TeamPiped/Piped-Kubernetes/issues/new/choose) + ---------------------------------------------- Autogenerated from chart metadata using [helm-docs v0.1.1](https://github.com/k8s-at-home/helm-docs/releases/v0.1.1) diff --git a/charts/apps/piped/README_CONFIG.md.gotmpl b/charts/apps/piped/README_CONFIG.md.gotmpl index 0360bf6..6dbbc22 100644 --- a/charts/apps/piped/README_CONFIG.md.gotmpl +++ b/charts/apps/piped/README_CONFIG.md.gotmpl @@ -5,5 +5,8 @@ {{- define "custom.custom.configuration" -}} {{ template "custom.custom.configuration.header" . }} -N/A -{{- end -}} \ No newline at end of file +{{- end -}} + +{{- define "custom.notes" -}} +NOTICE: There is currently NO caching support included in the chart. +{{- end -}} diff --git a/charts/apps/piped/templates/backend/configmap.yaml b/charts/apps/piped/templates/backend/configmap.yaml index fa0f892..ca21f87 100644 --- a/charts/apps/piped/templates/backend/configmap.yaml +++ b/charts/apps/piped/templates/backend/configmap.yaml @@ -3,35 +3,49 @@ apiVersion: v1 kind: ConfigMap metadata: name: {{ include "backend.names.fullname" . }}-config - {{- with (merge (.Values.backend.labels | default dict) (include "common.labels" $ | fromYaml)) }} + {{- with (merge (.Values.backend.labels | default dict) (include "bjw-s.common.lib.metadata.allLabels" $ | fromYaml)) }} labels: {{- toYaml . | nindent 4 }} {{- end }} - {{- with (merge (.Values.backend.annotations | default dict) (include "common.annotations" $ | fromYaml)) }} + {{- with (merge (.Values.backend.annotations | default dict) (include "bjw-s.common.lib.metadata.globalAnnotations" $ | fromYaml)) }} annotations: {{- toYaml . | nindent 4 }} {{- end }} data: config.properties: | - PORT: {{ .Values.backend.config.PORT | default 8080 }} - HTTP_WORKERS: {{ .Values.backend.config.HTTP_WORKERS | default 2 }} + {{- if .Values.backend.config.PORT }} + PORT: {{ .Values.backend.config.PORT }} + {{- else }} + PORT: 8080 + {{ end }} + {{- if .Values.backend.config.HTTP_WORKERS }} + HTTP_WORKERS: {{ .Values.backend.config.HTTP_WORKERS }} + {{- else }} + HTTP_WORKERS: 2 + {{ end }} {{- if .Values.backend.config.HTTP_PROXY }} HTTP_PROXY: {{ .Values.backend.config.HTTP_PROXY }} {{ end }} {{- if .Values.backend.config.PROXY_PART }} PROXY_PART: {{.Values.backend.config.PROXY_PART }} - {{- else if .Values.ingress.ytproxy.enabled and .Values.ingress.ytproxy.tls }} + {{- else if (and .Values.ingress.ytproxy.enabled .Values.ingress.ytproxy.tls) }} PROXY_PART: https://{{ index (index .Values.ingress.ytproxy.hosts 0) "host" }} + {{- else if .Values.ingress.ytproxy.enabled }} + PROXY_PART: http://{{ index (index .Values.ingress.ytproxy.hosts 0) "host" }} {{- else }} {{- fail "PROXY_PART needs to be set in config values or ytproxy ingress must be enabled."}} {{ end }} {{- if .Values.backend.config.API_URL }} API_URL: {{ .Values.backend.config.API_URL }} + {{- else if (and .Values.ingress.backend.enabled .Values.ingress.backend.tls) }} + API_URL: https://{{ index (index .Values.ingress.backend.hosts 0) "host" }} {{- else if .Values.ingress.backend.enabled }} - API_URL: {{ index (index .Values.ingress.backend.hosts 0) "host" }} + API_URL: http://{{ index (index .Values.ingress.backend.hosts 0) "host" }} {{- else }} {{- fail "API_URL needs to be set in config values or backend ingress must be enabled."}} {{ end }} {{- if .Values.backend.config.FRONTEND_URL }} FRONTEND_URL: {{.Values.backend.config.FRONTEND_URL }} + {{- else if (and .Values.ingress.main.enabled .Values.ingress.main.tls) }} + FRONTEND_URL: https://{{ index (index .Values.ingress.main.hosts 0) "host" }} {{- else if .Values.ingress.main.enabled }} FRONTEND_URL: {{ index (index .Values.ingress.main.hosts 0) "host" }} {{- else }} @@ -52,5 +66,5 @@ data: hibernate.dialect: org.hibernate.dialect.PostgreSQLDialect hibernate.connection.username: {{.Values.postgresql.auth.username }} hibernate.connection.password: {{.Values.postgresql.auth.password }} - {{ end }} + {{- end }} SENTRY_DSN: diff --git a/charts/apps/piped/templates/backend/deployment.yaml b/charts/apps/piped/templates/backend/deployment.yaml index 0c44548..2f13880 100644 --- a/charts/apps/piped/templates/backend/deployment.yaml +++ b/charts/apps/piped/templates/backend/deployment.yaml @@ -4,10 +4,10 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "backend.names.fullname" . }} - {{- with (merge (.Values.backend.labels | default dict) (include "common.labels" $ | fromYaml)) }} + {{- with (merge (.Values.backend.labels | default dict) (include "bjw-s.common.lib.metadata.allLabels" $ | fromYaml)) }} labels: {{- toYaml . | nindent 4 }} {{- end }} - {{- with (merge (.Values.backend.annotations | default dict) (include "common.annotations" $ | fromYaml)) }} + {{- with (merge (.Values.backend.annotations | default dict) (include "bjw-s.common.lib.metadata.globalAnnotations" $ | fromYaml)) }} annotations: {{- toYaml . | nindent 4 }} {{- end }} spec: diff --git a/charts/apps/piped/templates/backend/ingress.yaml b/charts/apps/piped/templates/backend/ingress.yaml index adde5cf..d0a7d5b 100644 --- a/charts/apps/piped/templates/backend/ingress.yaml +++ b/charts/apps/piped/templates/backend/ingress.yaml @@ -16,21 +16,20 @@ {{- $primaryService := .Values.backend.service.main -}} {{- $defaultServiceName := "piped-backend" -}} - {{- $defaultServicePort := get $primaryService.ports (include "common.classes.service.ports.primary" (dict "values" $primaryService)) -}} - {{- $isStable := include "common.capabilities.ingress.isStable" . }} + {{- $defaultServicePort := get $primaryService.ports (include "bjw-s.common.lib.service.primaryPort" (dict "values" $primaryService)) -}} --- -apiVersion: {{ include "common.capabilities.ingress.apiVersion" . }} +apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: {{ $ingressName }}-backend - {{- with (merge ($values.labels | default dict) (include "common.labels" $ | fromYaml)) }} + {{- with (merge ($values.labels | default dict) (include "bjw-s.common.lib.metadata.allLabels" $ | fromYaml)) }} labels: {{- toYaml . | nindent 4 }} - {{- end }} - {{- with (merge ($values.annotations | default dict) (include "common.annotations" $ | fromYaml)) }} +{{- end }} +{{- with (merge ($values.annotations | default dict) (include "bjw-s.common.lib.metadata.globalAnnotations" $ | fromYaml)) }} annotations: {{- toYaml . | nindent 4 }} - {{- end }} +{{- end }} spec: - {{- if and $isStable $values.ingressClassName }} + {{- if $values.ingressClassName }} ingressClassName: {{ $values.ingressClassName }} {{- end }} {{- if $values.tls }} @@ -58,19 +57,12 @@ spec: {{- $port = default $port .service.port -}} {{- end }} - path: {{ tpl .path $ | quote }} - {{- if $isStable }} pathType: {{ default "Prefix" .pathType }} - {{- end }} backend: - {{- if $isStable }} service: name: {{ $service }} port: number: {{ $port }} - {{- else }} - serviceName: {{ $service }} - servicePort: {{ $port }} - {{- end }} {{- end }} - {{- end }} + {{- end }} {{- end }} \ No newline at end of file diff --git a/charts/apps/piped/templates/common.yaml b/charts/apps/piped/templates/common.yaml index bd7db60..f7d42d9 100644 --- a/charts/apps/piped/templates/common.yaml +++ b/charts/apps/piped/templates/common.yaml @@ -1,5 +1,5 @@ --- -{{- include "common.values.setup" . }} +{{- include "bjw-s.common.values.init" . }} {{- define "app-template.hardcodedValues" -}} diff --git a/charts/apps/piped/templates/frontend/deployment.yaml b/charts/apps/piped/templates/frontend/deployment.yaml index d7c0f46..50685d8 100644 --- a/charts/apps/piped/templates/frontend/deployment.yaml +++ b/charts/apps/piped/templates/frontend/deployment.yaml @@ -4,10 +4,10 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "frontend.names.fullname" . }} - {{- with (merge (.Values.frontend.labels | default dict) (include "common.labels" $ | fromYaml)) }} + {{- with (merge (.Values.frontend.labels | default dict) (include "bjw-s.common.lib.metadata.allLabels" $ | fromYaml)) }} labels: {{- toYaml . | nindent 4 }} {{- end }} - {{- with (merge (.Values.frontend.annotations | default dict) (include "common.annotations" $ | fromYaml)) }} + {{- with (merge (.Values.frontend.annotations | default dict) (include "bjw-s.common.lib.metadata.globalAnnotations" $ | fromYaml)) }} annotations: {{- toYaml . | nindent 4 }} {{- end }} spec: diff --git a/charts/apps/piped/templates/frontend/ingress.yaml b/charts/apps/piped/templates/frontend/ingress.yaml index 8b048e1..7967bb1 100644 --- a/charts/apps/piped/templates/frontend/ingress.yaml +++ b/charts/apps/piped/templates/frontend/ingress.yaml @@ -16,61 +16,53 @@ {{- $primaryService := .Values.frontend.service.main -}} {{- $defaultServiceName := "piped-frontend" -}} - {{- $defaultServicePort := get $primaryService.ports (include "common.classes.service.ports.primary" (dict "values" $primaryService)) -}} - {{- $isStable := include "common.capabilities.ingress.isStable" . }} + {{- $defaultServicePort := get $primaryService.ports (include "bjw-s.common.lib.service.primaryPort" (dict "values" $primaryService)) -}} --- -apiVersion: {{ include "common.capabilities.ingress.apiVersion" . }} +apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: {{ $ingressName }} -{{- with (merge ($values.labels | default dict) (include "common.labels" $ | fromYaml)) }} +{{- with (merge ($values.labels | default dict) (include "bjw-s.common.lib.metadata.allLabels" $ | fromYaml)) }} labels: {{- toYaml . | nindent 4 }} {{- end }} -{{- with (merge ($values.annotations | default dict) (include "common.annotations" $ | fromYaml)) }} +{{- with (merge ($values.annotations | default dict) (include "bjw-s.common.lib.metadata.globalAnnotations" $ | fromYaml)) }} annotations: {{- toYaml . | nindent 4 }} {{- end }} spec: -{{- if and $isStable $values.ingressClassName }} + {{- if $values.ingressClassName }} ingressClassName: {{ $values.ingressClassName }} -{{- end }} -{{- if $values.tls }} + {{- end }} + {{- if $values.tls }} tls: - {{- range $values.tls }} + {{- range $values.tls }} - hosts: - {{- range .hosts }} + {{- range .hosts }} - {{ tpl . $ | quote }} - {{- end }} - {{- if .secretName }} + {{- end }} + {{- if .secretName }} secretName: {{ tpl .secretName $ | quote}} + {{- end }} {{- end }} {{- end }} -{{- end }} rules: -{{- range $values.hosts }} + {{- range $values.hosts }} - host: {{ tpl .host $ | quote }} http: paths: - {{- range .paths }} - {{- $service := $defaultServiceName -}} - {{- $port := $defaultServicePort.port -}} - {{- if .service -}} - {{- $service = default $service .service.name -}} - {{- $port = default $port .service.port -}} - {{- end }} - - path: {{ tpl .path $ | quote }} - {{- if $isStable }} - pathType: {{ default "Prefix" .pathType }} + {{- range .paths }} + {{- $service := $defaultServiceName -}} + {{- $port := $defaultServicePort.port -}} + {{- if .service -}} + {{- $service = default $service .service.name -}} + {{- $port = default $port .service.port -}} {{- end }} + - path: {{ tpl .path $ | quote }} + pathType: {{ default "Prefix" .pathType }} backend: - {{- if $isStable }} service: name: {{ $service }} port: number: {{ $port }} - {{- else }} - serviceName: {{ $service }} - servicePort: {{ $port }} - {{- end }} - {{- end }} -{{- end }} + {{- end }} + {{- end }} {{- end }} \ No newline at end of file diff --git a/charts/apps/piped/templates/ytproxy/deployment.yaml b/charts/apps/piped/templates/ytproxy/deployment.yaml index 583f4b3..bfe739a 100644 --- a/charts/apps/piped/templates/ytproxy/deployment.yaml +++ b/charts/apps/piped/templates/ytproxy/deployment.yaml @@ -4,10 +4,10 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "ytproxy.names.fullname" . }} - {{- with (merge (.Values.ytproxy.labels | default dict) (include "common.labels" $ | fromYaml)) }} + {{- with (merge (.Values.ytproxy.labels | default dict) (include "bjw-s.common.lib.metadata.allLabels" $ | fromYaml)) }} labels: {{- toYaml . | nindent 4 }} {{- end }} - {{- with (merge (.Values.ytproxy.annotations | default dict) (include "common.annotations" $ | fromYaml)) }} + {{- with (merge (.Values.ytproxy.annotations | default dict) (include "bjw-s.common.lib.metadata.globalAnnotations" $ | fromYaml)) }} annotations: {{- toYaml . | nindent 4 }} {{- end }} spec: diff --git a/charts/apps/piped/templates/ytproxy/ingress.yaml b/charts/apps/piped/templates/ytproxy/ingress.yaml index cd08fc0..4007d99 100644 --- a/charts/apps/piped/templates/ytproxy/ingress.yaml +++ b/charts/apps/piped/templates/ytproxy/ingress.yaml @@ -16,61 +16,53 @@ {{- $primaryService := .Values.ytproxy.service.main -}} {{- $defaultServiceName := "piped-ytproxy" -}} - {{- $defaultServicePort := get $primaryService.ports (include "common.classes.service.ports.primary" (dict "values" $primaryService)) -}} - {{- $isStable := include "common.capabilities.ingress.isStable" . }} + {{- $defaultServicePort := get $primaryService.ports (include "bjw-s.common.lib.service.primaryPort" (dict "values" $primaryService)) -}} --- -apiVersion: {{ include "common.capabilities.ingress.apiVersion" . }} +apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: {{ $ingressName }}-ytproxy -{{- with (merge ($values.labels | default dict) (include "common.labels" $ | fromYaml)) }} +{{- with (merge ($values.labels | default dict) (include "bjw-s.common.lib.metadata.allLabels" $ | fromYaml)) }} labels: {{- toYaml . | nindent 4 }} {{- end }} -{{- with (merge ($values.annotations | default dict)) }} +{{- with (merge ($values.annotations | default dict) (include "bjw-s.common.lib.metadata.globalAnnotations" $ | fromYaml)) }} annotations: {{- toYaml . | nindent 4 }} {{- end }} spec: -{{- if and $isStable $values.ingressClassName }} + {{- if $values.ingressClassName }} ingressClassName: {{ $values.ingressClassName }} -{{- end }} -{{- if $values.tls }} + {{- end }} + {{- if $values.tls }} tls: - {{- range $values.tls }} + {{- range $values.tls }} - hosts: - {{- range .hosts }} + {{- range .hosts }} - {{ tpl . $ | quote }} - {{- end }} - {{- if .secretName }} + {{- end }} + {{- if .secretName }} secretName: {{ tpl .secretName $ | quote}} + {{- end }} {{- end }} {{- end }} -{{- end }} rules: -{{- range $values.hosts }} + {{- range $values.hosts }} - host: {{ tpl .host $ | quote }} http: paths: - {{- range .paths }} - {{- $service := $defaultServiceName -}} - {{- $port := $defaultServicePort.port -}} - {{- if .service -}} - {{- $service = default $service .service.name -}} - {{- $port = default $port .service.port -}} - {{- end }} - - path: {{ tpl .path $ | quote }} - {{- if $isStable }} - pathType: {{ default "Prefix" .pathType }} + {{- range .paths }} + {{- $service := $defaultServiceName -}} + {{- $port := $defaultServicePort.port -}} + {{- if .service -}} + {{- $service = default $service .service.name -}} + {{- $port = default $port .service.port -}} {{- end }} + - path: {{ tpl .path $ | quote }} + pathType: {{ default "Prefix" .pathType }} backend: - {{- if $isStable }} service: name: {{ $service }} port: number: {{ $port }} - {{- else }} - serviceName: {{ $service }} - servicePort: {{ $port }} - {{- end }} - {{- end }} -{{- end }} + {{- end }} + {{- end }} {{- end }} \ No newline at end of file diff --git a/charts/apps/piped/values.yaml b/charts/apps/piped/values.yaml index d72f50d..3553e7e 100644 --- a/charts/apps/piped/values.yaml +++ b/charts/apps/piped/values.yaml @@ -84,9 +84,9 @@ backend: # - sleep infinity # If the hostnames are not set for backend, proxy and API, they will be automatically fetched from their ingresses. - #config: - #PORT: 8080 - #HTTP_WORKERS: 2 + config: + PORT: 8080 + HTTP_WORKERS: 2 #PROXY_PART: https://PROXY_HOSTNAME # Outgoing HTTP Proxy - eg: 127.0.0.1:8118 #HTTP_PROXY: 127.0.0.1:8118 @@ -147,7 +147,7 @@ ytproxy: ingress: main: enabled: true - primary: false + primary: true hosts: - host: piped.video paths: @@ -192,7 +192,7 @@ probes: # @default -- See below liveness: # -- Enable the liveness probe - enabled: false + enabled: true # -- Set this to `true` if you wish to specify your own livenessProbe custom: false # -- The spec field contains the values for the default livenessProbe. @@ -208,7 +208,7 @@ probes: # @default -- See below readiness: # -- Enable the readiness probe - enabled: false + enabled: true # -- Set this to `true` if you wish to specify your own readinessProbe custom: false # -- The spec field contains the values for the default readinessProbe. @@ -224,7 +224,7 @@ probes: # @default -- See below startup: # -- Enable the startup probe - enabled: false + enabled: true # -- Set this to `true` if you wish to specify your own startupProbe custom: false # -- The spec field contains the values for the default startupProbe. diff --git a/hack/templates/.helmignore b/hack/templates/.helmignore new file mode 100644 index 0000000..2a482c1 --- /dev/null +++ b/hack/templates/.helmignore @@ -0,0 +1,26 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ +# OWNERS file for Kubernetes +OWNERS +# helm-docs templates +*.gotmpl \ No newline at end of file diff --git a/hack/templates/README.md.gotmpl b/hack/templates/README.md.gotmpl new file mode 100644 index 0000000..8166aba --- /dev/null +++ b/hack/templates/README.md.gotmpl @@ -0,0 +1,170 @@ +{{- define "custom.repository.organization" -}} +TeamPiped +{{- end -}} + +{{- define "custom.repository.url" -}} +https://github.com/TeamPiped/Piped-Kubernetes +{{- end -}} + +{{- define "custom.helm.url" -}} +https://helm.piped.video +{{- end -}} + +{{- define "custom.helm.path" -}} +{{ template "custom.repository.organization" . }}/{{ template "chart.name" . }} +{{- end -}} + +{{- define "custom.notes" -}} + +{{- end -}} + +{{- define "custom.requirements" -}} +## Requirements + +{{ template "chart.kubeVersionLine" . }} +{{- end -}} + +{{- define "custom.dependencies" -}} +## Dependencies + +{{ template "chart.requirementsTable" . }} +{{- end -}} + +{{- define "custom.install.tldr" -}} +## TL;DR + +```console +helm repo add {{ template "custom.repository.organization" . }} {{ template "custom.helm.url" . }} +helm repo update +helm install {{ template "chart.name" . }} {{ template "custom.helm.path" . }} +``` +{{- end -}} + +{{- define "custom.install" -}} +## Installing the Chart + +To install the chart with the release name `{{ template "chart.name" . }}` + +```console +helm install {{ template "chart.name" . }} {{ template "custom.helm.path" . }} +``` +{{- end -}} + +{{- define "custom.uninstall" -}} +## Uninstalling the Chart + +To uninstall the `{{ template "chart.name" . }}` deployment + +```console +helm uninstall {{ template "chart.name" . }} +``` + +The command removes all the Kubernetes components associated with the chart **including persistent volumes** and deletes the release. +{{- end -}} + +{{- define "custom.configuration.header" -}} +## Configuration +{{- end -}} + +{{- define "custom.configuration.readValues" -}} +Read through the [values.yaml](./values.yaml) file. It has several commented out suggested values. +Other values may be used from the [values.yaml](https://github.com/bjw-s/helm-charts/blob/main/charts/library/common/values.yaml) from the [common library](https://github.com/bjw-s/helm-charts/tree/main/charts/library/common). +{{- end -}} + +{{- define "custom.configuration.example.set" -}} +Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. + +```console +helm install {{ template "chart.name" . }} \ + --set env.TZ="America/New York" \ + {{ template "custom.helm.path" . }} +``` +{{- end -}} + +{{- define "custom.configuration.example.file" -}} +Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. + +```console +helm install {{ template "chart.name" . }} {{ template "custom.helm.path" . }} -f values.yaml +``` +{{- end -}} + +{{- define "custom.valuesSection" -}} +## Values + +**Important**: When deploying an application Helm chart you can add more values from the common library chart [here](https://github.com/bjw-s/helm-charts/tree/main/charts/library/common) + +{{ template "chart.valuesTable" . }} +{{- end -}} + +{{- define "custom.support" -}} +## Support + +- Open an [issue](https://github.com/TeamPiped/Piped-Kubernetes/issues/new/choose) +{{- end -}} + +{{- define "custom.changelog" -}} +{{ $changeTypes := list "added" "changed" "fixed" }} +## Changelog + +### Version {{ template "chart.version" . }} + +{{ range $changeType := $changeTypes }} + {{- with (index $.Annotations "artifacthub.io/changes") }} + {{- print "#### " ($changeType | title) | nindent 0 }} + {{- print "" | nindent 0 }} + {{- $changesFound := false }} + {{- $changes := ((print "changes:\n" .) | fromYaml).changes }} + {{- range $changes }} + {{- if eq .kind $changeType }} + {{- print "* " .description | nindent 0 }} + {{- $changesFound = true }} + {{- end }} + {{- end }} + {{- if not $changesFound }} + {{- print "N/A" | nindent 0 }} + {{- end }} + {{- print "" | nindent 0 }} + {{- end }} +{{- end }} + +{{- end -}} + +{{ template "chart.header" . }} + +{{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}{{ template "chart.appVersionBadge" . }} + +{{ template "chart.description" . }} + +{{ template "custom.notes" . }} + +{{ template "chart.sourcesSection" . }} + +{{ template "custom.requirements" . }} + +{{ template "custom.dependencies" . }} + +{{ template "custom.install.tldr" . }} + +{{ template "custom.install" . }} + +{{ template "custom.uninstall" . }} + +{{ template "custom.configuration.header" . }} + +{{ template "custom.configuration.readValues" . }} + +{{ template "custom.configuration.example.set" . }} + +{{ template "custom.configuration.example.file" . }} + +{{ template "custom.custom.configuration" . }} + +{{ template "custom.valuesSection" . }} + +{{ template "custom.changelog" . }} + +{{ template "custom.support" . }} + +{{ template "helm-docs.versionFooter" . }} +{{ "" }} \ No newline at end of file diff --git a/hack/templates/README_CONFIG.md.gotmpl b/hack/templates/README_CONFIG.md.gotmpl new file mode 100644 index 0000000..0360bf6 --- /dev/null +++ b/hack/templates/README_CONFIG.md.gotmpl @@ -0,0 +1,9 @@ +{{- define "custom.custom.configuration.header" -}} +## Custom configuration +{{- end -}} + +{{- define "custom.custom.configuration" -}} +{{ template "custom.custom.configuration.header" . }} + +N/A +{{- end -}} \ No newline at end of file