From 45c9f3c39ea06460efae4e1e52d6b07933ef0840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernd=20Sch=C3=B6rgers?= Date: Fri, 6 Nov 2020 22:40:53 +0100 Subject: [PATCH] [jackett] Migrate to common library (#113) --- charts/jackett/Chart.yaml | 7 ++- charts/jackett/README.md | 26 ++++++++--- charts/jackett/ci/ct-values.yaml | 10 ----- charts/jackett/templates/NOTES.txt | 21 +-------- charts/jackett/templates/common.yaml | 1 + charts/jackett/templates/pvc.yaml | 22 ---------- charts/jackett/values.yaml | 66 +++++++++++++--------------- 7 files changed, 55 insertions(+), 98 deletions(-) delete mode 100644 charts/jackett/ci/ct-values.yaml create mode 100644 charts/jackett/templates/common.yaml delete mode 100644 charts/jackett/templates/pvc.yaml diff --git a/charts/jackett/Chart.yaml b/charts/jackett/Chart.yaml index 8a2a6851..75421689 100644 --- a/charts/jackett/Chart.yaml +++ b/charts/jackett/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 appVersion: v0.16.1045 description: API Support for your favorite torrent trackers name: jackett -version: 4.0.1 +version: 5.0.0 keywords: - jackett - torrent @@ -15,7 +15,6 @@ maintainers: - name: billimek email: jeff@billimek.com dependencies: - - name: media-common + - name: common repository: https://k8s-at-home.com/charts/ - version: ^1.0.0 - alias: jackett + version: ^1.0.3 diff --git a/charts/jackett/README.md b/charts/jackett/README.md index 23ab298b..3e525863 100644 --- a/charts/jackett/README.md +++ b/charts/jackett/README.md @@ -28,8 +28,9 @@ helm delete my-release --purge The command removes all the Kubernetes components associated with the chart and deletes the release. ## Configuration -Read through the media-common [values.yaml](https://github.com/k8s-at-home/charts/blob/master/charts/media-common/values.yaml) +Read through the charts [values.yaml](https://github.com/k8s-at-home/charts/blob/master/charts/jackett/values.yaml) file. It has several commented out suggested values. +Additionally you can take a look at the common library [values.yaml](https://github.com/k8s-at-home/charts/blob/master/charts/common/values.yaml) for more (advanced) configuration options. Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, ```console @@ -43,11 +44,9 @@ chart. For example, helm install jackett k8s-at-home/jackett --values values.yaml ``` -These values will be nested as it is a dependency, for example ```yaml -jackett: - image: - tag: ... +image: + tag: ... ``` --- @@ -59,4 +58,19 @@ Error: rendered manifests contain a resource that already exists. Unable to cont ``` it may be because you uninstalled the chart with `skipuninstall` enabled, you need to manually delete the pvc or use `existingClaim`. ---- \ No newline at end of file +--- + +## Upgrading an existing Release to a new major version + +A major chart version change (like 4.0.1 -> 5.0.0) indicates that there is an incompatible breaking change potentially needing manual actions. + +### Upgrading from 4.x.x to 5.x.x + +Due to migrating to a centralized common library some values in `values.yaml` have changed. + +Examples: + +* `service.port` has been moved to `service.port.port`. +* `persistence.type` has been moved to `controllerType`. + +Refer to the library values.yaml for more configuration options. diff --git a/charts/jackett/ci/ct-values.yaml b/charts/jackett/ci/ct-values.yaml deleted file mode 100644 index 786a5a90..00000000 --- a/charts/jackett/ci/ct-values.yaml +++ /dev/null @@ -1,10 +0,0 @@ -jackett: - image: - organization: linuxserver - repository: jackett - tag: v0.16.1045-ls14 - service: - type: ClusterIP - port: 9117 - ingress: - enabled: false diff --git a/charts/jackett/templates/NOTES.txt b/charts/jackett/templates/NOTES.txt index f0db26f8..90f7b653 100644 --- a/charts/jackett/templates/NOTES.txt +++ b/charts/jackett/templates/NOTES.txt @@ -1,20 +1 @@ -{{- $svcPort := .Values.jackett.service.port -}} -1. Get the application URL by running these commands: -{{- if .Values.jackett.ingress.enabled }} -{{- range .Values.jackett.ingress.hosts }} - http{{ if $.Values.jackett.ingress.tls }}s{{ end }}://{{ . }}{{ $.Values.jackett.ingress.path }} -{{- end }} -{{- else if contains "NodePort" .Values.jackett.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "media-common.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.jackett.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get svc -w {{ include "media-common.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "media-common.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') - echo http://$SERVICE_IP:{{ $svcPort }} -{{- else if contains "ClusterIP" .Values.jackett.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "media-common.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl port-forward $POD_NAME 8080:{{ $svcPort }} -{{- end }} +{{- include "common.notes.defaultNotes" . -}} diff --git a/charts/jackett/templates/common.yaml b/charts/jackett/templates/common.yaml new file mode 100644 index 00000000..a6613c2c --- /dev/null +++ b/charts/jackett/templates/common.yaml @@ -0,0 +1 @@ +{{ include "common.all" . }} diff --git a/charts/jackett/templates/pvc.yaml b/charts/jackett/templates/pvc.yaml deleted file mode 100644 index 32626439..00000000 --- a/charts/jackett/templates/pvc.yaml +++ /dev/null @@ -1,22 +0,0 @@ -{{- if and .Values.jackett.persistence.torrentblackhole.enabled (not .Values.jackett.persistence.torrentblackhole.existingClaim) }} ---- -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: {{ template "media-common.fullname" . }}-downloads - {{- if .Values.jackett.persistence.torrentblackhole.skipuninstall }} - annotations: - "helm.sh/resource-policy": keep - {{- end }} - labels: - {{- include "media-common.labels" . | nindent 4 }} -spec: - accessModes: - - {{ .Values.jackett.persistence.torrentblackhole.accessMode | quote }} - resources: - requests: - storage: {{ .Values.jackett.persistence.torrentblackhole.size | quote }} - {{- if .Values.jackett.persistence.torrentblackhole.storageClass }} - storageClassName: {{ if (eq "-" .Values.jackett.persistence.torrentblackhole.storageClass) }}""{{- else }}{{ .Values.jackett.persistence.torrentblackhole.storageClass | quote}}{{- end }} - {{- end }} -{{- end -}} diff --git a/charts/jackett/values.yaml b/charts/jackett/values.yaml index e7ce07d2..f147df94 100644 --- a/charts/jackett/values.yaml +++ b/charts/jackett/values.yaml @@ -1,43 +1,37 @@ # Default values for Jackett. -jackett: - image: - organization: linuxserver - repository: jackett - pullPolicy: IfNotPresent - tag: v0.16.1045-ls14 +image: + repository: linuxserver/jackett + pullPolicy: IfNotPresent + tag: v0.16.1045-ls14 - service: +service: + port: port: 9117 - env: {} - # TZ: UTC - # PUID: 1001 - # PGID: 1001 +env: {} + # TZ: UTC + # PUID: 1001 + # PGID: 1001 - persistence: - torrentblackhole: - enabled: false - ## Jackett torrent torrentblackhole Persistent Volume Storage Class - ## If defined, storageClassName: - ## If set to "-", storageClassName: "", which disables dynamic provisioning - ## If undefined (the default) or set to null, no storageClassName spec is - ## set, choosing the default provisioner. (gp2 on AWS, standard on - ## GKE, AWS & OpenStack) - # storageClass: "-" - # accessMode: ReadWriteOnce - # size: 1Gi - ## Do not delete the pvc upon helm uninstall - # skipuninstall: false - # existingClaim: "" +persistence: + config: + enabled: true + emptyDir: true - additionalVolumes: - - name: torrentblackhole - emptyDir: {} - ## When using persistence.torrentblackhole.enabled: true, adjust this to: - # persistentVolumeClaim: - # claimName: jackett-torrentblackhole - - additionalVolumeMounts: - - name: torrentblackhole - mountPath: /downloads + torrentblackhole: + enabled: true + emptyDir: true + mountPath: /downloads + ## Jackett torrent torrentblackhole Persistent Volume Storage Class + ## If defined, storageClassName: + ## If set to "-", storageClassName: "", which disables dynamic provisioning + ## If undefined (the default) or set to null, no storageClassName spec is + ## set, choosing the default provisioner. (gp2 on AWS, standard on + ## GKE, AWS & OpenStack) + # storageClass: "-" + # accessMode: ReadWriteOnce + # size: 1Gi + ## Do not delete the pvc upon helm uninstall + # skipuninstall: false + # existingClaim: ""