NAS-124043 / 24.04 / adds Kavita to community train (#1531)

This commit is contained in:
Stavros Kois
2023-09-12 21:30:34 +03:00
committed by GitHub
parent f948955c93
commit 4d4d56b72b
19 changed files with 450 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
dependencies:
- name: common
repository: file://../../../common
version: 1.1.1
digest: sha256:a7dbe3e4d42dbcd4325776e5e01a1d630c7f185f79e7ebf22b1b9cc80f56eed7
generated: "2023-09-11T15:46:44.44770537+03:00"

View File

@@ -0,0 +1,26 @@
name: kavita
description: Kavita is a fast, feature rich, cross platform reading server.
annotations:
title: Kavita
type: application
version: 1.0.0
apiVersion: v2
appVersion: 0.7.8
kubeVersion: '>=1.16.0-0'
maintainers:
- name: truenas
url: https://www.truenas.com/
email: dev@ixsystems.com
dependencies:
- name: common
repository: file://../../../common
version: 1.1.1
home: https://www.kavitareader.com/
icon: https://github.com/Kareadita/Kavita/blob/develop/UI/Web/src/assets/images/logo.png
sources:
- https://github.com/Kareadita/Kavita
- https://github.com/truenas/charts/tree/master/library/ix-dev/community/kavita
- https://www.kavitareader.com
keywords:
- manga
- ebook

View File

@@ -0,0 +1,3 @@
# Kavita
[Kavita](https://www.kavitareader.com) is a fast, feature rich, cross platform reading server.

View File

@@ -0,0 +1,3 @@
# Kavita
[Kavita](https://www.kavitareader.com) is a fast, feature rich, cross platform reading server.

View File

@@ -0,0 +1,7 @@
kavitaNetwork:
webPort: 31000
kavitaStorage:
config:
type: hostPath
hostPath: /mnt/{{ .Release.Namespace }}/config

View File

@@ -0,0 +1,14 @@
kavitaNetwork:
webPort: 31000
kavitaStorage:
config:
type: hostPath
hostPath: /mnt/{{ .Release.Namespace }}/config
additionalStorages:
- type: hostPath
hostPath: /mnt/{{ .Release.Namespace }}/manga
mountPath: /manga
- type: hostPath
hostPath: /mnt/{{ .Release.Namespace }}/comic
mountPath: /comic

View File

@@ -0,0 +1,12 @@
icon_url: https://github.com/Kareadita/Kavita/blob/develop/UI/Web/src/assets/images/logo.png
categories:
- media
screenshots:
- https://www.kavitareader.com/img/features/homepage.PNG
- https://www.kavitareader.com/img/features/librarydetail_v0.5.4.PNG
- https://www.kavitareader.com/img/features/search_v0.5.4.PNG
- https://www.kavitareader.com/img/features/seriesdetail.PNG
- https://www.kavitareader.com/img/features/mixedchapterandvolumes.PNG
tags:
- ebook
- manga

View File

@@ -0,0 +1,8 @@
runAsContext:
- userName: root
groupName: root
gid: 0
uid: 0
description: Kavita runs as root user.
capabilities: []
hostMounts: []

View File

@@ -0,0 +1,212 @@
groups:
- name: Kavita Configuration
description: Configure Kavita
- name: Network Configuration
description: Configure Network for Kavita
- name: Storage Configuration
description: Configure Storage for Kavita
- name: Resources Configuration
description: Configure Resources for Kavita
portals:
web_portal:
protocols:
- "$kubernetes-resource_configmap_portal_protocol"
host:
- "$kubernetes-resource_configmap_portal_host"
ports:
- "$kubernetes-resource_configmap_portal_port"
path: "$kubernetes-resource_configmap_portal_path"
questions:
- variable: TZ
group: Kavita Configuration
label: Timezone
schema:
type: string
default: Etc/UTC
required: true
$ref:
- definitions/timezone
- variable: kavitaConfig
label: ""
group: Kavita Configuration
schema:
type: dict
attrs:
- variable: additionalEnvs
label: Additional Environment Variables
description: Configure additional environment variables for Kavita.
schema:
type: list
default: []
items:
- variable: env
label: Environment Variable
schema:
type: dict
attrs:
- variable: name
label: Name
schema:
type: string
required: true
- variable: value
label: Value
schema:
type: string
required: true
- variable: kavitaNetwork
label: ""
group: Network Configuration
schema:
type: dict
attrs:
- variable: webPort
label: Web Port
description: The port for the Kavita Web UI.
schema:
type: int
default: 30069
min: 9000
max: 65535
required: true
- variable: kavitaStorage
label: ""
group: Storage Configuration
schema:
type: dict
attrs:
- variable: config
label: Kavita Config Storage
description: The path to store Kavita Configuration.
schema:
type: dict
attrs:
- variable: type
label: Type
description: |
ixVolume: Is dataset created automatically by the system.</br>
Host Path: Is a path that already exists on the system.
schema:
type: string
required: true
default: "ixVolume"
enum:
- value: "hostPath"
description: Host Path (Path that already exists on the system)
- value: "ixVolume"
description: ixVolume (Dataset created automatically by the system)
- variable: datasetName
label: Dataset Name
schema:
type: string
show_if: [["type", "=", "ixVolume"]]
required: true
hidden: true
immutable: true
default: "config"
$ref:
- "normalize/ixVolume"
- variable: hostPath
label: Host Path
schema:
type: hostpath
show_if: [["type", "=", "hostPath"]]
immutable: true
required: true
- variable: additionalStorages
label: Additional Storage
description: Additional storage for Kavita.
schema:
type: list
default: []
items:
- variable: storageEntry
label: Storage Entry
schema:
type: dict
attrs:
- variable: type
label: Type
description: |
ixVolume: Is dataset created automatically by the system.</br>
Host Path: Is a path that already exists on the system.
schema:
type: string
required: true
default: "ixVolume"
enum:
- value: "hostPath"
description: Host Path (Path that already exists on the system)
- value: "ixVolume"
description: ixVolume (Dataset created automatically by the system)
- variable: mountPath
label: Mount Path
description: The path inside the container to mount the storage.
schema:
type: path
required: true
- variable: hostPath
label: Host Path
description: The host path to use for storage.
schema:
type: hostpath
show_if: [["type", "=", "hostPath"]]
required: true
- variable: datasetName
label: Dataset Name
description: The name of the dataset to use for storage.
schema:
type: string
show_if: [["type", "=", "ixVolume"]]
required: true
immutable: true
default: "storage_entry"
$ref:
- "normalize/ixVolume"
- variable: resources
group: Resources Configuration
label: ""
schema:
type: dict
attrs:
- variable: limits
label: Limits
schema:
type: dict
attrs:
- variable: cpu
label: CPU
description: CPU limit for Kavita.
schema:
type: string
max_length: 6
valid_chars: '^(0\.[1-9]|[1-9][0-9]*)(\.[0-9]|m?)$'
valid_chars_error: |
Valid CPU limit formats are</br>
- Plain Integer - eg. 1</br>
- Float - eg. 0.5</br>
- Milicpu - eg. 500m
default: "4000m"
required: true
- variable: memory
label: Memory
description: Memory limit for Kavita.
schema:
type: string
max_length: 12
valid_chars: '^[1-9][0-9]*([EPTGMK]i?|e[0-9]+)?$'
valid_chars_error: |
Valid Memory limit formats are</br>
- Suffixed with E/P/T/G/M/K - eg. 1G</br>
- Suffixed with Ei/Pi/Ti/Gi/Mi/Ki - eg. 1Gi</br>
- Plain Integer in bytes - eg. 1024</br>
- Exponent - eg. 134e6
default: "8Gi"
required: true

View File

@@ -0,0 +1 @@
{{ include "ix.v1.common.lib.chart.notes" $ }}

View File

@@ -0,0 +1,42 @@
{{- define "kavita.workload" -}}
workload:
kavita:
enabled: true
primary: true
type: Deployment
podSpec:
hostNetwork: false
containers:
kavita:
enabled: true
primary: true
imageSelector: image
securityContext:
runAsUser: 0
runAsGroup: 0
runAsNonRoot: false
readOnlyRootFilesystem: false
{{ with .Values.kavitaConfig.additionalEnvs }}
envList:
{{ range $env := . }}
- name: {{ $env.name }}
value: {{ $env.value }}
{{ end }}
{{ end }}
probes:
liveness:
enabled: true
type: http
port: 5000
path: /api/health
readiness:
enabled: true
type: http
port: 5000
path: /api/health
startup:
enabled: true
type: http
port: 5000
path: /api/health
{{- end -}}

View File

@@ -0,0 +1,24 @@
{{- define "kavita.persistence" -}}
persistence:
config:
enabled: true
type: {{ .Values.kavitaStorage.config.type }}
datasetName: {{ .Values.kavitaStorage.config.datasetName | default "" }}
hostPath: {{ .Values.kavitaStorage.config.hostPath | default "" }}
targetSelector:
kavita:
kavita:
mountPath: /kavita/config
{{- range $idx, $storage := .Values.kavitaStorage.additionalStorages }}
{{ printf "kavita-%v" (int $idx) }}:
enabled: true
type: {{ $storage.type }}
datasetName: {{ $storage.datasetName | default "" }}
hostPath: {{ $storage.hostPath | default "" }}
targetSelector:
kavita:
kavita:
mountPath: {{ $storage.mountPath }}
{{- end }}
{{- end -}}

View File

@@ -0,0 +1,12 @@
{{- define "kavita.portal" -}}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: portal
data:
path: "/"
port: {{ .Values.kavitaNetwork.webPort | quote }}
protocol: http
host: $node_ip
{{- end -}}

View File

@@ -0,0 +1,16 @@
{{- define "kavita.service" -}}
service:
kavita:
enabled: true
primary: true
type: NodePort
targetSelector: kavita
ports:
webui:
enabled: true
primary: true
port: {{ .Values.kavitaNetwork.webPort }}
nodePort: {{ .Values.kavitaNetwork.webPort }}
targetPort: 5000
targetSelector: kavita
{{- end -}}

View File

@@ -0,0 +1,11 @@
{{- include "ix.v1.common.loader.init" . -}}
{{/* Merge the templates with Values */}}
{{- $_ := mustMergeOverwrite .Values (include "kavita.workload" $ | fromYaml) -}}
{{- $_ := mustMergeOverwrite .Values (include "kavita.service" $ | fromYaml) -}}
{{- $_ := mustMergeOverwrite .Values (include "kavita.persistence" $ | fromYaml) -}}
{{/* Create the configmap for portal manually*/}}
{{- include "kavita.portal" $ -}}
{{- include "ix.v1.common.loader.apply" . -}}

View File

@@ -0,0 +1 @@
{"filename": "values.yaml", "keys": ["image"]}

View File

@@ -0,0 +1,31 @@
#!/usr/bin/python3
import json
import re
import sys
from catalog_update.upgrade_strategy import semantic_versioning
RE_STABLE_VERSION = re.compile(r'\d+\.\d+\.\d+')
def newer_mapping(image_tags):
key = list(image_tags.keys())[0]
tags = {t: t for t in image_tags[key] if RE_STABLE_VERSION.fullmatch(t)}
version = semantic_versioning(list(tags))
if not version:
return {}
return {
'tags': {key: tags[version]},
'app_version': version,
}
if __name__ == '__main__':
try:
versions_json = json.loads(sys.stdin.read())
except ValueError:
raise ValueError('Invalid json specified')
print(json.dumps(newer_mapping(versions_json)))

View File

@@ -0,0 +1,21 @@
image:
repository: kizaing/kavita
pullPolicy: IfNotPresent
tag: 0.7.8
resources:
limits:
cpu: 4000m
memory: 8Gi
kavitaConfig:
additionalEnvs: []
kavitaNetwork:
webPort: 30069
kavitaStorage:
config:
type: ixVolume
datasetName: config
additionalStorages: []