first init
This commit is contained in:
117
charts/audiobookshelf/CHANGELOG.md
Normal file
117
charts/audiobookshelf/CHANGELOG.md
Normal file
@ -0,0 +1,117 @@
|
||||
# Changelog
|
||||
|
||||
## [0.0.2-nightly.15](https://gitlab.com/mmuenker/audiobookshelf-chart/compare/v0.0.2-nightly.14...v0.0.2-nightly.15) (2024-10-29)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* update app version to 2.16.1 ([e834a69](https://gitlab.com/mmuenker/audiobookshelf-chart/commit/e834a69ebf543155daac48838cd496ef6750ff08))
|
||||
|
||||
## [0.0.2-nightly.14](https://gitlab.com/mmuenker/audiobookshelf-chart/compare/v0.0.2-nightly.13...v0.0.2-nightly.14) (2024-10-28)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* update app version to 2.16.0 ([9a5fda0](https://gitlab.com/mmuenker/audiobookshelf-chart/commit/9a5fda050c900654abd6fa45907d3ad309510834))
|
||||
|
||||
## [0.0.2-nightly.13](https://gitlab.com/mmuenker/audiobookshelf-chart/compare/v0.0.2-nightly.12...v0.0.2-nightly.13) (2024-10-19)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* update app version to 2.15.1 ([f927e8c](https://gitlab.com/mmuenker/audiobookshelf-chart/commit/f927e8cce841c82b7f15edd61d47f200caa628ad))
|
||||
|
||||
## [0.0.2-nightly.12](https://gitlab.com/mmuenker/audiobookshelf-chart/compare/v0.0.2-nightly.11...v0.0.2-nightly.12) (2024-10-13)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* update app version to 2.15.0 ([d07609f](https://gitlab.com/mmuenker/audiobookshelf-chart/commit/d07609f9b0ce6a50707383994c025554017fb9c8))
|
||||
|
||||
## [0.0.2-nightly.11](https://gitlab.com/mmuenker/audiobookshelf-chart/compare/v0.0.2-nightly.10...v0.0.2-nightly.11) (2024-10-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* update app version to 2.14.0 ([9ec8c4f](https://gitlab.com/mmuenker/audiobookshelf-chart/commit/9ec8c4f7013ac188ae2f6b4871a7e5f5bdd0dbf4))
|
||||
|
||||
## [0.0.2-nightly.10](https://gitlab.com/mmuenker/audiobookshelf-chart/compare/v0.0.2-nightly.9...v0.0.2-nightly.10) (2024-09-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* update app version to 2.13.4 ([9885d84](https://gitlab.com/mmuenker/audiobookshelf-chart/commit/9885d847ca63680b859949e8e613106249e93c40))
|
||||
|
||||
## [0.0.2-nightly.9](https://gitlab.com/mmuenker/audiobookshelf-chart/compare/v0.0.2-nightly.8...v0.0.2-nightly.9) (2024-09-03)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* update app version to 2.13.3 ([860f74d](https://gitlab.com/mmuenker/audiobookshelf-chart/commit/860f74dea84dd88ea5d39fdc621d448d4c37ef93))
|
||||
|
||||
## [0.0.2-nightly.8](https://gitlab.com/mmuenker/audiobookshelf-chart/compare/v0.0.2-nightly.7...v0.0.2-nightly.8) (2024-09-02)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* update app version to 2.13.2 ([65a7ad0](https://gitlab.com/mmuenker/audiobookshelf-chart/commit/65a7ad0ede7f45eb5f9aae092e3b6b1ac16bfe1e))
|
||||
|
||||
## [0.0.2-nightly.7](https://gitlab.com/mmuenker/audiobookshelf-chart/compare/v0.0.2-nightly.6...v0.0.2-nightly.7) (2024-09-01)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* update app version to 2.13.0 ([74abb38](https://gitlab.com/mmuenker/audiobookshelf-chart/commit/74abb388935ef6807bd0eff832696073dd3104c8))
|
||||
|
||||
## [0.0.2-nightly.6](https://gitlab.com/mmuenker/audiobookshelf-chart/compare/v0.0.2-nightly.5...v0.0.2-nightly.6) (2024-08-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* update app version to 2.12.3 ([0b93459](https://gitlab.com/mmuenker/audiobookshelf-chart/commit/0b93459524e2447a65f1aee2aa68fd7e9c456561))
|
||||
|
||||
## [0.0.2-nightly.5](https://gitlab.com/mmuenker/audiobookshelf-chart/compare/v0.0.2-nightly.4...v0.0.2-nightly.5) (2024-08-09)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* update app version to 2.12.2 ([a57e5b2](https://gitlab.com/mmuenker/audiobookshelf-chart/commit/a57e5b2bdf53b57c5d6b8dd39d503fd5e600336b))
|
||||
|
||||
## [0.0.2-nightly.4](https://gitlab.com/mmuenker/audiobookshelf-chart/compare/v0.0.2-nightly.3...v0.0.2-nightly.4) (2024-08-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* update app version to 2.12.1 ([f60a0dc](https://gitlab.com/mmuenker/audiobookshelf-chart/commit/f60a0dc244b510d32874f9038fe32e4052c391c7))
|
||||
|
||||
## [0.0.2-nightly.3](https://gitlab.com/mmuenker/audiobookshelf-chart/compare/v0.0.2-nightly.2...v0.0.2-nightly.3) (2024-08-05)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* update app version to 2.12.0 ([d773ab3](https://gitlab.com/mmuenker/audiobookshelf-chart/commit/d773ab3b1ac8db360f38746c28e5b87f5ed33034))
|
||||
|
||||
## [0.0.2-nightly.2](https://gitlab.com/mmuenker/audiobookshelf-chart/compare/v0.0.2-nightly.1...v0.0.2-nightly.2) (2024-07-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* update app version to 2.11.0 ([5741075](https://gitlab.com/mmuenker/audiobookshelf-chart/commit/574107539bd52d1bc17efbdfba48c816aac5c925))
|
||||
|
||||
## [0.0.2-nightly.1](https://gitlab.com/mmuenker/audiobookshelf-chart/compare/v0.0.2-nightly.0...v0.0.2-nightly.1) (2024-05-28)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* update app version to 2.10.1 ([7b56902](https://gitlab.com/mmuenker/audiobookshelf-chart/commit/7b569026a3386322f33c7fba135f63ce2d3f0efc))
|
||||
|
||||
## [0.0.2-nightly.0](https://gitlab.com/mmuenker/audiobookshelf-chart/compare/v0.0.1...v0.0.2-nightly.0) (2024-05-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* update app version to 2.10.0 ([1e55481](https://gitlab.com/mmuenker/audiobookshelf-chart/commit/1e554813f4c53944564857beb97dde5536490915))
|
||||
|
||||
## 0.0.1 (2024-05-05)
|
||||
|
||||
## 0.0.1-nightly.0 (2024-05-05)
|
17
charts/audiobookshelf/Chart.yaml
Normal file
17
charts/audiobookshelf/Chart.yaml
Normal file
@ -0,0 +1,17 @@
|
||||
apiVersion: v2
|
||||
name: audiobookshelf
|
||||
description: A Helm chart for Audiobookshelf
|
||||
type: application
|
||||
version: 0.0.2-nightly.15
|
||||
appVersion: "2.16.1"
|
||||
home: https://gitlab.com/mmuenker/audiobookshelf-chart
|
||||
keywords:
|
||||
- audiobookshelf
|
||||
sources:
|
||||
- https://gitlab.com/mmuenker/audiobookshelf-chart
|
||||
- https://github.com/advplyr/audiobookshelf
|
||||
maintainers:
|
||||
- name: Merzough Münker
|
||||
email: mmuenker@digitaix.com
|
||||
url: https://gitlab.com/mmuenker
|
||||
icon: https://www.audiobookshelf.org/Logo.png
|
21
charts/audiobookshelf/LICENSE
Normal file
21
charts/audiobookshelf/LICENSE
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2024 Merzough Münker
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
99
charts/audiobookshelf/README.md
Normal file
99
charts/audiobookshelf/README.md
Normal file
@ -0,0 +1,99 @@
|
||||
# Audiobookshelf Helm Chart
|
||||
|
||||
This Helm chart deploys the Audiobookshelf server on a Kubernetes cluster, allowing you to serve audiobooks, ebooks, and podcasts from NFS shares.
|
||||
|
||||
## Installation
|
||||
|
||||
To install Audiobookshelf using this Helm chart, follow these steps:
|
||||
|
||||
### Step 1: Prepare Configuration
|
||||
|
||||
Create a `custom.yaml` file to override the default configuration settings. Below is an example configuration that integrates Audiobookshelf with Traefik for ingress, and configures readonly NFS shares where the media files are stored.
|
||||
|
||||
```yaml
|
||||
ingress:
|
||||
enabled: true
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: traefik
|
||||
hosts:
|
||||
- host: audiobooks.my-domain.com
|
||||
paths:
|
||||
- path: /
|
||||
pathType: ImplementationSpecific
|
||||
|
||||
nfs:
|
||||
- server: 192.168.0.30
|
||||
storage: 1Ti
|
||||
name: my-nfs-server
|
||||
share:
|
||||
- name: audiobooks
|
||||
path: /volume1/audiobooks
|
||||
mountPath: /audiobooks
|
||||
```
|
||||
|
||||
If required the version of the Audiobookshelf image can be overridden by setting the `image.tag` value in the `custom.yaml` file.
|
||||
|
||||
```yaml
|
||||
image:
|
||||
repository: ghcr.io/audiobookshelf/audiobookshelf
|
||||
tag: 9.8.7
|
||||
pullPolicy: IfNotPresent
|
||||
```
|
||||
|
||||
#### Add the helm repository
|
||||
|
||||
The Audiobookshelf Helm chart is hosted in the GitLab Package Registry. To add the repository to Helm, use the following command:
|
||||
|
||||
```bash
|
||||
helm repo add audiobookshelf https://gitlab.com/api/v4/projects/57546317/packages/helm/release
|
||||
```
|
||||
|
||||
It is possible to use pre-release versions of the chart by replacing `release` with the pre-release channel name. The following pre-release channels are available:
|
||||
|
||||
- `nightly`
|
||||
- `preview`
|
||||
- `rc`
|
||||
|
||||
> **Note:** The pre-release channels may contain unstable or untested versions of the chart.
|
||||
|
||||
### Step 2: Deploy
|
||||
|
||||
Run the following Helm command to deploy Audiobookshelf with the custom configuration.
|
||||
|
||||
> **Note:** If a pre-release channel is used, add `--devel` to the Helm command.
|
||||
|
||||
```bash
|
||||
helm install \
|
||||
--create-namespace \
|
||||
--namespace audiobookshelf \
|
||||
audiobookshelf \
|
||||
-f custom.yaml \
|
||||
audiobookshelf/audiobookshelf
|
||||
```
|
||||
|
||||
## Upgrades
|
||||
|
||||
To upgrade your Audiobookshelf deployment to a new version or to apply configuration changes, use the following command:
|
||||
|
||||
```bash
|
||||
helm upgrade \
|
||||
--namespace audiobookshelf \
|
||||
audiobookshelf \
|
||||
-f custom.yaml \
|
||||
audiobookshelf/audiobookshelf
|
||||
```
|
||||
|
||||
## Managing NFS Mounts
|
||||
|
||||
If you need to update the NFS mount configuration, follow these steps:
|
||||
|
||||
1. Comment out the NFS mount configuration in `custom.yaml` that needs adjustment.
|
||||
2. Upgrade the Helm deployment using the command provided in the Upgrades section.
|
||||
3. Make the required changes to your NFS setup.
|
||||
4. Uncomment the adjusted NFS mount configuration.
|
||||
5. Upgrade the Helm deployment again to apply the changes.
|
||||
|
||||
## Additional Information
|
||||
|
||||
For more detailed configuration options and advanced setups, refer to the chart's `values.yaml` file and the Audiobookshelf documentation.
|
||||
|
22
charts/audiobookshelf/templates/NOTES.txt
Normal file
22
charts/audiobookshelf/templates/NOTES.txt
Normal file
@ -0,0 +1,22 @@
|
||||
1. Get the application URL by running these commands:
|
||||
{{- if .Values.ingress.enabled }}
|
||||
{{- range $host := .Values.ingress.hosts }}
|
||||
{{- range .paths }}
|
||||
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- else if contains "NodePort" .Values.service.type }}
|
||||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "audiobookshelf.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.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 --namespace {{ .Release.Namespace }} svc -w {{ include "audiobookshelf.fullname" . }}'
|
||||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "audiobookshelf.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
|
||||
echo http://$SERVICE_IP:{{ .Values.service.port }}
|
||||
{{- else if contains "ClusterIP" .Values.service.type }}
|
||||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "audiobookshelf.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
|
||||
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
|
||||
echo "Visit http://127.0.0.1:8080 to use your application"
|
||||
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
|
||||
{{- end }}
|
62
charts/audiobookshelf/templates/_helpers.tpl
Normal file
62
charts/audiobookshelf/templates/_helpers.tpl
Normal file
@ -0,0 +1,62 @@
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "audiobookshelf.name" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create a default fully qualified app name.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
If release name contains chart name it will be used as a full name.
|
||||
*/}}
|
||||
{{- define "audiobookshelf.fullname" -}}
|
||||
{{- if .Values.fullnameOverride }}
|
||||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- else }}
|
||||
{{- $name := default .Chart.Name .Values.nameOverride }}
|
||||
{{- if contains $name .Release.Name }}
|
||||
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
|
||||
{{- else }}
|
||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create chart name and version as used by the chart label.
|
||||
*/}}
|
||||
{{- define "audiobookshelf.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Common labels
|
||||
*/}}
|
||||
{{- define "audiobookshelf.labels" -}}
|
||||
helm.sh/chart: {{ include "audiobookshelf.chart" . }}
|
||||
{{ include "audiobookshelf.selectorLabels" . }}
|
||||
{{- if .Chart.AppVersion }}
|
||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||
{{- end }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Selector labels
|
||||
*/}}
|
||||
{{- define "audiobookshelf.selectorLabels" -}}
|
||||
app.kubernetes.io/name: {{ include "audiobookshelf.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use
|
||||
*/}}
|
||||
{{- define "audiobookshelf.serviceAccountName" -}}
|
||||
{{- if .Values.serviceAccount.create }}
|
||||
{{- default (include "audiobookshelf.fullname" .) .Values.serviceAccount.name }}
|
||||
{{- else }}
|
||||
{{- default "default" .Values.serviceAccount.name }}
|
||||
{{- end }}
|
||||
{{- end }}
|
113
charts/audiobookshelf/templates/deployment.yaml
Normal file
113
charts/audiobookshelf/templates/deployment.yaml
Normal file
@ -0,0 +1,113 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "audiobookshelf.fullname" . }}
|
||||
labels:
|
||||
{{- include "audiobookshelf.labels" . | nindent 4 }}
|
||||
spec:
|
||||
replicas: {{ .Values.replicaCount }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "audiobookshelf.selectorLabels" . | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
{{- with .Values.podAnnotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "audiobookshelf.labels" . | nindent 8 }}
|
||||
{{- with .Values.podLabels }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- with .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ include "audiobookshelf.serviceAccountName" . }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
||||
containers:
|
||||
- name: {{ .Chart.Name }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.securityContext | nindent 12 }}
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
||||
env:
|
||||
- name: TZ
|
||||
value: {{ .Values.timezone }}
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: {{ .Values.service.port }}
|
||||
protocol: TCP
|
||||
livenessProbe:
|
||||
{{- toYaml .Values.livenessProbe | nindent 12 }}
|
||||
readinessProbe:
|
||||
{{- toYaml .Values.readinessProbe | nindent 12 }}
|
||||
resources:
|
||||
{{- toYaml .Values.resources | nindent 12 }}
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: /config
|
||||
- name: metadata
|
||||
mountPath: /metadata
|
||||
{{- range .Values.persistentVolumeClaims }}
|
||||
- name: {{ .name }}
|
||||
mountPath: {{ .mountPath }}
|
||||
readOnly: {{ .readOnly }}
|
||||
{{- end }}
|
||||
{{- range .Values.nfs }}
|
||||
{{- $nfs := . }}
|
||||
{{- range .share }}
|
||||
- name: {{ include "audiobookshelf.fullname" $ }}-{{ $nfs.name }}-{{ .name }}-pvc
|
||||
mountPath: {{ .mountPath }}
|
||||
readOnly: true
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- with .Values.volumeMounts }}
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
- name: config
|
||||
{{- if .Values.persistence.config.enabled }}
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ .Values.persistence.config.existingClaim | default (printf "%s-config" (include "audiobookshelf.fullname" .)) }}
|
||||
{{- else }}
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
- name: metadata
|
||||
{{- if .Values.persistence.metadata.enabled }}
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ .Values.persistence.metadata.existingClaim | default (printf "%s-metadata" (include "audiobookshelf.fullname" .)) }}
|
||||
{{- else }}
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
{{- range .Values.persistentVolumeClaims }}
|
||||
- name: {{ .name }}
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ .name }}
|
||||
{{- end }}
|
||||
{{- range .Values.nfs }}
|
||||
{{- $nfs := . }}
|
||||
{{- range .share }}
|
||||
- name: {{ include "audiobookshelf.fullname" $ }}-{{ $nfs.name }}-{{ .name }}-pvc
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ include "audiobookshelf.fullname" $ }}-{{ $nfs.name }}-{{ .name }}-pvc
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- with .Values.volumes }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.affinity }}
|
||||
affinity:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
61
charts/audiobookshelf/templates/ingress.yaml
Normal file
61
charts/audiobookshelf/templates/ingress.yaml
Normal file
@ -0,0 +1,61 @@
|
||||
{{- if .Values.ingress.enabled -}}
|
||||
{{- $fullName := include "audiobookshelf.fullname" . -}}
|
||||
{{- $svcPort := .Values.service.port -}}
|
||||
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
|
||||
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
|
||||
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
|
||||
apiVersion: networking.k8s.io/v1
|
||||
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
|
||||
apiVersion: networking.k8s.io/v1beta1
|
||||
{{- else -}}
|
||||
apiVersion: extensions/v1beta1
|
||||
{{- end }}
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{ $fullName }}
|
||||
labels:
|
||||
{{- include "audiobookshelf.labels" . | nindent 4 }}
|
||||
{{- with .Values.ingress.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
|
||||
ingressClassName: {{ .Values.ingress.className }}
|
||||
{{- end }}
|
||||
{{- if .Values.ingress.tls }}
|
||||
tls:
|
||||
{{- range .Values.ingress.tls }}
|
||||
- hosts:
|
||||
{{- range .hosts }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
secretName: {{ .secretName }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
rules:
|
||||
{{- range .Values.ingress.hosts }}
|
||||
- host: {{ .host | quote }}
|
||||
http:
|
||||
paths:
|
||||
{{- range .paths }}
|
||||
- path: {{ .path }}
|
||||
{{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
|
||||
pathType: {{ .pathType }}
|
||||
{{- end }}
|
||||
backend:
|
||||
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
||||
service:
|
||||
name: {{ $fullName }}
|
||||
port:
|
||||
number: {{ $svcPort }}
|
||||
{{- else }}
|
||||
serviceName: {{ $fullName }}
|
||||
servicePort: {{ $svcPort }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
44
charts/audiobookshelf/templates/nfs-pv.yaml
Normal file
44
charts/audiobookshelf/templates/nfs-pv.yaml
Normal file
@ -0,0 +1,44 @@
|
||||
{{- range .Values.nfs }}
|
||||
{{- $nfs := . }}
|
||||
{{- range .share }}
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: {{ include "audiobookshelf.fullname" $ }}-{{ $nfs.name }}-{{ .name }}-pv
|
||||
labels:
|
||||
{{- include "audiobookshelf.labels" $ | nindent 4 }}
|
||||
{{- with $.Values.persistence.config.annotations }}
|
||||
annotations:
|
||||
{{ toYaml . | indent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
capacity:
|
||||
storage: {{ $nfs.storage }}
|
||||
accessModes:
|
||||
- ReadOnlyMany
|
||||
nfs:
|
||||
path: {{ .path }}
|
||||
server: {{ $nfs.server }}
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: {{ include "audiobookshelf.fullname" $ }}-{{ $nfs.name }}-{{ .name }}-pvc
|
||||
labels:
|
||||
{{- include "audiobookshelf.labels" $ | nindent 4 }}
|
||||
{{- with $.Values.persistence.config.annotations }}
|
||||
annotations:
|
||||
{{ toYaml . | indent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
volumeName: {{ include "audiobookshelf.fullname" $ }}-{{ $nfs.name }}-{{ .name }}-pv
|
||||
storageClassName: ""
|
||||
accessModes:
|
||||
- ReadOnlyMany
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ $nfs.storage }}
|
||||
---
|
||||
{{- end }}
|
||||
{{- end }}
|
51
charts/audiobookshelf/templates/pvc.yaml
Normal file
51
charts/audiobookshelf/templates/pvc.yaml
Normal file
@ -0,0 +1,51 @@
|
||||
{{- if and .Values.persistence.config.enabled (not .Values.persistence.config.existingClaim) }}
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: {{ include "audiobookshelf.fullname" . }}-config
|
||||
labels:
|
||||
{{- include "audiobookshelf.labels" . | nindent 4 }}
|
||||
{{- with .Values.persistence.config.annotations }}
|
||||
annotations:
|
||||
{{ toYaml . | indent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes:
|
||||
- {{ .Values.persistence.config.accessMode | quote }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.persistence.config.size }}
|
||||
{{- if .Values.persistence.config.storageClass }}
|
||||
{{- if (eq "-" .Values.persistence.config.storageClass) }}
|
||||
storageClassName: ""
|
||||
{{- else }}
|
||||
storageClassName: "{{ .Values.persistence.config.storageClass }}"
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
---
|
||||
{{- if and .Values.persistence.metadata.enabled (not .Values.persistence.metadata.existingClaim) }}
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: {{ include "audiobookshelf.fullname" . }}-metadata
|
||||
labels:
|
||||
{{- include "audiobookshelf.labels" . | nindent 4 }}
|
||||
{{- with .Values.persistence.metadata.annotations }}
|
||||
annotations:
|
||||
{{ toYaml . | indent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes:
|
||||
- {{ .Values.persistence.metadata.accessMode | quote }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.persistence.metadata.size }}
|
||||
{{- if .Values.persistence.metadata.storageClass }}
|
||||
{{- if (eq "-" .Values.persistence.metadata.storageClass) }}
|
||||
storageClassName: ""
|
||||
{{- else }}
|
||||
storageClassName: "{{ .Values.persistence.metadata.storageClass }}"
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
15
charts/audiobookshelf/templates/service.yaml
Normal file
15
charts/audiobookshelf/templates/service.yaml
Normal file
@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "audiobookshelf.fullname" . }}
|
||||
labels:
|
||||
{{- include "audiobookshelf.labels" . | nindent 4 }}
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
ports:
|
||||
- port: {{ .Values.service.port }}
|
||||
targetPort: http
|
||||
protocol: TCP
|
||||
name: http
|
||||
selector:
|
||||
{{- include "audiobookshelf.selectorLabels" . | nindent 4 }}
|
13
charts/audiobookshelf/templates/serviceaccount.yaml
Normal file
13
charts/audiobookshelf/templates/serviceaccount.yaml
Normal file
@ -0,0 +1,13 @@
|
||||
{{- if .Values.serviceAccount.create -}}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ include "audiobookshelf.serviceAccountName" . }}
|
||||
labels:
|
||||
{{- include "audiobookshelf.labels" . | nindent 4 }}
|
||||
{{- with .Values.serviceAccount.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
automountServiceAccountToken: {{ .Values.serviceAccount.automount }}
|
||||
{{- end }}
|
15
charts/audiobookshelf/templates/tests/test-connection.yaml
Normal file
15
charts/audiobookshelf/templates/tests/test-connection.yaml
Normal file
@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: "{{ include "audiobookshelf.fullname" . }}-test-connection"
|
||||
labels:
|
||||
{{- include "audiobookshelf.labels" . | nindent 4 }}
|
||||
annotations:
|
||||
"helm.sh/hook": test
|
||||
spec:
|
||||
containers:
|
||||
- name: wget
|
||||
image: busybox
|
||||
command: ['wget']
|
||||
args: ['{{ include "audiobookshelf.fullname" . }}:{{ .Values.service.port }}']
|
||||
restartPolicy: Never
|
33
charts/audiobookshelf/tools/scripts/ci-push-changes.sh
Normal file
33
charts/audiobookshelf/tools/scripts/ci-push-changes.sh
Normal file
@ -0,0 +1,33 @@
|
||||
#!/bin/sh
|
||||
|
||||
# exit on error
|
||||
set -e
|
||||
|
||||
commit_message=$1
|
||||
|
||||
if [ -z "$commit_message" ]; then
|
||||
echo "Commit message is required"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# if there are no changes, exit
|
||||
if [ -z "$(git status --porcelain)" ]; then
|
||||
echo "No changes found"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Adding the changes to the git stage"
|
||||
git add .
|
||||
|
||||
echo "Checking the status of the git repository"
|
||||
git status
|
||||
|
||||
echo "Committing the changes"
|
||||
git commit --no-verify -m "$commit_message"
|
||||
|
||||
current_remote=$(git config --get "branch.$CI_COMMIT_BRANCH.remote")
|
||||
|
||||
echo "Pushing the changes to the branch $CI_COMMIT_BRANCH in the remote $current_remote"
|
||||
git push --no-verify "$current_remote" "$CI_COMMIT_BRANCH"
|
||||
|
||||
echo "Done"
|
83
charts/audiobookshelf/tools/scripts/ci-setup-git-via-ssh.sh
Normal file
83
charts/audiobookshelf/tools/scripts/ci-setup-git-via-ssh.sh
Normal file
@ -0,0 +1,83 @@
|
||||
#!/bin/sh
|
||||
|
||||
# exit on error
|
||||
set -e
|
||||
|
||||
if [ -z "$GIT_SSH_KEY" ]; then
|
||||
echo "No GIT_SSH_KEY variable found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
GIT_COMMITTER_EMAIL=${GIT_COMMITTER_EMAIL:-$GITLAB_USER_EMAIL}
|
||||
GIT_COMMITTER_NAME=${GIT_COMMITTER_NAME:-$GITLAB_USER_NAME}
|
||||
|
||||
if [ -z "$GIT_COMMITTER_EMAIL" ]; then
|
||||
echo "No GIT_COMMITTER_EMAIL variable found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$GIT_COMMITTER_NAME" ]; then
|
||||
echo "No GIT_COMMITTER_NAME variable found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "GIT_COMMITTER_EMAIL: $GIT_COMMITTER_EMAIL"
|
||||
echo "GIT_COMMITTER_NAME: $GIT_COMMITTER_NAME"
|
||||
|
||||
mkdir -p ~/.ssh
|
||||
|
||||
echo "
|
||||
Host $CI_SERVER_SHELL_SSH_HOST
|
||||
HostName $CI_SERVER_SHELL_SSH_HOST
|
||||
User git
|
||||
Port $CI_SERVER_SHELL_SSH_PORT
|
||||
IdentityFile $GIT_SSH_KEY
|
||||
IdentitiesOnly yes
|
||||
" > ~/.ssh/config
|
||||
|
||||
chmod 600 ~/.ssh/config
|
||||
chmod 600 "$GIT_SSH_KEY"
|
||||
|
||||
echo "SSH configuration: ~/.ssh/config"
|
||||
cat ~/.ssh/config
|
||||
|
||||
echo "Adding the ssh key to the known hosts"
|
||||
ssh-keyscan -H "$CI_SERVER_SHELL_SSH_HOST" >> ~/.ssh/known_hosts
|
||||
|
||||
echo "Connecting to the ssh server"
|
||||
ssh git@$CI_SERVER_SHELL_SSH_HOST
|
||||
|
||||
echo "Current git version: $(git --version)"
|
||||
|
||||
echo "Setting up the git configuration"
|
||||
git config --global core.sshCommand "ssh -F ~/.ssh/config"
|
||||
git config --global user.email "$GIT_COMMITTER_EMAIL"
|
||||
git config --global user.name "$GIT_COMMITTER_NAME"
|
||||
|
||||
git remote add ssh git@$CI_SERVER_SHELL_SSH_HOST:$CI_PROJECT_PATH.git
|
||||
|
||||
echo "Checking out the branch $CI_COMMIT_BRANCH"
|
||||
git checkout "$CI_COMMIT_BRANCH"
|
||||
|
||||
echo "Pulling the latest changes from the branch $CI_COMMIT_BRANCH"
|
||||
git pull origin "$CI_COMMIT_BRANCH"
|
||||
|
||||
echo "Fetch the remote branch"
|
||||
git fetch --depth 1 ssh "$CI_COMMIT_BRANCH"
|
||||
|
||||
echo "Set the upstream to ssh"
|
||||
git branch --set-upstream-to="ssh/$CI_COMMIT_BRANCH" "$CI_COMMIT_BRANCH"
|
||||
|
||||
echo "verifying the changes"
|
||||
git branch -vv
|
||||
|
||||
echo "current git status"
|
||||
git status
|
||||
|
||||
echo "current git branch"
|
||||
git branch
|
||||
|
||||
echo "current head commit"
|
||||
git rev-parse HEAD
|
||||
|
||||
echo "Done"
|
31
charts/audiobookshelf/tools/scripts/update-app-version.sh
Normal file
31
charts/audiobookshelf/tools/scripts/update-app-version.sh
Normal file
@ -0,0 +1,31 @@
|
||||
#!/bin/sh
|
||||
|
||||
yq --version || (echo "yq is not installed. Please install yq." && exit 1)
|
||||
jq --version || (echo "jq is not installed. Please install jq." && exit 1)
|
||||
|
||||
current_app_version=$(cat Chart.yaml | yq -r '.appVersion')
|
||||
echo "Current app version: $current_app_version"
|
||||
|
||||
latest_app_version=$(curl -s "https://api.github.com/repos/advplyr/audiobookshelf/releases/latest" | jq -r '.tag_name' | sed 's/^v//')
|
||||
|
||||
echo "Latest app version: $latest_app_version"
|
||||
|
||||
if [ "$(printf "%s\n%s" "$current_app_version" "$latest_app_version" | sort -V | head -n1)" = "$current_app_version" ]; then
|
||||
if [ "$current_app_version" = "$latest_app_version" ]; then
|
||||
echo "Current version is equal to the latest version."
|
||||
exit 0
|
||||
else
|
||||
echo "Current version is less than the latest version."
|
||||
fi
|
||||
else
|
||||
echo "Current version is greater than the latest version."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Updating app version to $latest_app_version"
|
||||
|
||||
yq eval ".appVersion = \"$latest_app_version\"" -i Chart.yaml
|
||||
|
||||
echo "Commit and push the changes to the repository."
|
||||
|
||||
sh ./tools/scripts/ci-push-changes.sh "fix: update app version to $latest_app_version"
|
156
charts/audiobookshelf/values.yaml
Normal file
156
charts/audiobookshelf/values.yaml
Normal file
@ -0,0 +1,156 @@
|
||||
# Default values for audiobookshelf.
|
||||
# This is a YAML-formatted file.
|
||||
# Declare variables to be passed into your templates.
|
||||
|
||||
replicaCount: 1
|
||||
|
||||
persistence:
|
||||
config:
|
||||
enabled: true
|
||||
size: 1Gi
|
||||
storageClass: ""
|
||||
annotations: {}
|
||||
accessMode: ReadWriteOnce
|
||||
existingClaim: ""
|
||||
metadata:
|
||||
enabled: true
|
||||
size: 10Gi
|
||||
storageClass: ""
|
||||
annotations: {}
|
||||
accessMode: ReadWriteOnce
|
||||
existingClaim: ""
|
||||
|
||||
timezone: "Europe/Berlin"
|
||||
|
||||
# Define existing persistent volume claims that contain the audiobooks, ebooks and podcasts
|
||||
persistentVolumeClaims: []
|
||||
# # The name of the persistent volume claim
|
||||
# - name: audiobooks
|
||||
# # The mount path of the persistent volume claim in the audiobookshelf container.
|
||||
# mountPath: /audiobooks
|
||||
# # true - the persistent volume claim is read-only
|
||||
# readOnly: true
|
||||
|
||||
# Define nfs shares that contain the audiobooks, ebooks and podcasts
|
||||
nfs: []
|
||||
# # The domain or IP address of the NFS server
|
||||
# - server: 192.168.6.50
|
||||
# # The storage size of the NFS share
|
||||
# storage: 1Ti
|
||||
# # The name of the NFS share server
|
||||
# name: nfs
|
||||
# # The list of NFS shares
|
||||
# share:
|
||||
# # The name of the NFS share
|
||||
# - name: audiobooks
|
||||
# # The path of the NFS share
|
||||
# path: /mnt/audiobooks
|
||||
# # The mount path of the NFS share in the audiobookshelf container.
|
||||
# mountPath: /audiobooks
|
||||
|
||||
image:
|
||||
repository: ghcr.io/advplyr/audiobookshelf
|
||||
pullPolicy: IfNotPresent
|
||||
# Overrides the image tag whose default is the chart appVersion.
|
||||
tag: ""
|
||||
|
||||
imagePullSecrets: []
|
||||
nameOverride: ""
|
||||
fullnameOverride: ""
|
||||
|
||||
serviceAccount:
|
||||
# Specifies whether a service account should be created
|
||||
create: true
|
||||
# Automatically mount a ServiceAccount's API credentials?
|
||||
automount: true
|
||||
# Annotations to add to the service account
|
||||
annotations: {}
|
||||
# The name of the service account to use.
|
||||
# If not set and create is true, a name is generated using the fullname template
|
||||
name: ""
|
||||
|
||||
podAnnotations: {}
|
||||
podLabels: {}
|
||||
|
||||
podSecurityContext: {}
|
||||
# fsGroup: 2000
|
||||
|
||||
securityContext: {}
|
||||
# capabilities:
|
||||
# drop:
|
||||
# - ALL
|
||||
# readOnlyRootFilesystem: true
|
||||
# runAsNonRoot: true
|
||||
# runAsUser: 1000
|
||||
|
||||
service:
|
||||
type: ClusterIP
|
||||
port: 80
|
||||
|
||||
ingress:
|
||||
enabled: false
|
||||
className: ""
|
||||
annotations: {}
|
||||
# kubernetes.io/ingress.class: nginx
|
||||
# kubernetes.io/tls-acme: "true"
|
||||
hosts: []
|
||||
# - host: audiobooks.my-domain.com
|
||||
# paths:
|
||||
# - path: /
|
||||
# pathType: ImplementationSpecific
|
||||
tls: []
|
||||
# - secretName: chart-example-tls
|
||||
# hosts:
|
||||
# - chart-example.local
|
||||
|
||||
resources: {}
|
||||
# We usually recommend not to specify default resources and to leave this as a conscious
|
||||
# choice for the user. This also increases chances charts run on environments with little
|
||||
# resources, such as Minikube. If you do want to specify resources, uncomment the following
|
||||
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
|
||||
# limits:
|
||||
# cpu: 100m
|
||||
# memory: 128Mi
|
||||
# requests:
|
||||
# cpu: 100m
|
||||
# memory: 128Mi
|
||||
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: http
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: http
|
||||
|
||||
# Additional volumes on the output Deployment definition.
|
||||
volumes: []
|
||||
# - name: audiobooks
|
||||
# persistentVolumeClaim:
|
||||
# claimName: audiobooks-pvc
|
||||
# - name: podcasts
|
||||
# persistentVolumeClaim:
|
||||
# claimName: podcasts-pvc
|
||||
# - name: foo
|
||||
# secret:
|
||||
# secretName: mysecret
|
||||
# optional: false
|
||||
|
||||
# Additional volumeMounts on the output Deployment definition.
|
||||
volumeMounts: []
|
||||
# - name: audiobooks
|
||||
# mountPath: "/audiobooks"
|
||||
# readOnly: true
|
||||
# - name: podcasts
|
||||
# mountPath: "/podcasts"
|
||||
# readOnly: true
|
||||
# - name: foo
|
||||
# mountPath: "/etc/foo"
|
||||
# readOnly: true
|
||||
|
||||
nodeSelector: {}
|
||||
|
||||
tolerations: []
|
||||
|
||||
affinity: {}
|
Reference in New Issue
Block a user