Skip to content

Commit

Permalink
Add SABnzbd
Browse files Browse the repository at this point in the history
  • Loading branch information
drinkataco committed Apr 7, 2024
1 parent 3134414 commit 868da8c
Show file tree
Hide file tree
Showing 6 changed files with 317 additions and 0 deletions.
26 changes: 26 additions & 0 deletions charts/sabnzbd/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: 'v2'
name: 'sabnzbd'
description: 'SABnzbd is a program to download binary files from Usenet servers'
home: 'https://github.com/drinkataco/media-servarr/tree/main/charts/sabnzbd'
keywords:
- 'usenet'
- 'newsreader'
- 'sabnzbd'
kubeversion: ">=1.24.0-0"
type: 'application'
version: 0.1.0
appVersion: '4.2.3'
icon: 'https://github.com/drinkataco/media-servarr/blob/main/charts/sabnzbd/icon.png'
dependencies:
- name: 'media-servarr-base'
version: 0.5.0
repository: "file://../.."
maintainers:
- name: 'media-servarr'
email: '[email protected]'
url: 'https://github.com/drinkataco/media-servarr/'
sources:
- 'https://github.com/sabnzbd/sabnzbd'
- 'https://hub.docker.com/r/linuxserver/sabnzbd'
- 'https://ghcr.io/onedr0p/exportarr'
- 'https://github.com/drinkataco/media-servarr/tree/main/charts/sabnzbd'
185 changes: 185 additions & 0 deletions charts/sabnzbd/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
# SABnzbd Helm Chart

This Helm chart installs SABnzbd, a program to download binary files from Usenet servers.

This README covers the basics of customising and installation

![SABnzbd](./icon.png)

<!-- vim-md-toc format=bullets ignore=^TODO$ -->
* [Installation](#installation)
* [Configuration](#configuration)
* [Secrets](#secrets)
* [Application Configuration](#application-configuration)
* [Volumes](#volumes)
* [Ingress](#ingress)
* [Metrics](#metrics)
* [Advanced](#advanced)
* [Upgrading](#upgrading)
* [Uninstallation](#uninstallation)
* [Support](#support)
<!-- vim-md-toc END -->

## Installation

Install this helm chart using the following command:

```bash
helm repo add mediar-servarr https://media-servarr.shw.al/charts

helm install sabnzbd media-servarr/sabnzbd
```

Pointing the host `media-servarr.local` to your kubernetes cluster will then allow you to access the application at the default location of `http://media-servarr.local/sabnzbd/`

## Configuration

Here is some example of some configuration you may want to override (and include in installation with `-f myvalues.yaml`

### Secrets

To set up secrets, like API keys, use the following format. Use `openssl rand -hex 16` to generate a key and replace the default value.

```yaml
secrets:
- name: 'apiKey'
value: 'apiKey'
- name: 'nzbKey'
value: 'nzbKey'
# - name: 'newsreaderServerPassword'
# value: 'password123'
```

If setting up a ConfigMap, you can also store any newsreader server passwords here, for example

### Application Configuration

By default, base configuration is defined using a ConfigMap - defined by default in `./values.yaml` in `application.config`.

You can also add servers here, as shown under the `[servers]` block

```yaml
application:
port: 8080 # default UI port
urlBase: 'sabnzbd' # default web base path
config:
contents: |
[misc]
language = en
queue_limit = 20
port = 8080
api_key = $apiKey
nzb_key = $nzbKey
download_dir = Downloads/incomplete
complete_dir = Downloads/complete
# [servers]
# [[yournewsreader.example.org]]
# name = yournewsreader.example.org
# displayname = yourNewsReader
# host = yournewsreader.example.org
# port = 563
# username = username
# password = $newsreaderServerPassword
# connections = 8
# ssl = 1
# ssl_verify = 2
# enable = 1
# priority = 0
```
You can prevent a ConfigMap being create and the configuration being managed as a kubernetes resource by defing the config as null. For example;
```yaml
application:
...
config: null
```
### Volumes
Three volumes are available by default:
- **config** - General config data
- **downloads** - Downloads folder, with {complete, incomplete} subdirectories
```yaml
deployment:
...
volumes:
config: # The key will be the volume name
persistentVolumeClaim:
name: 'sabnzbd-config'
downloads:
nfs:
server: 'fileserver.local'
path: '/srv/downloads/'
```
By default, a PersistentVolumeClaim will be provisioned for the `config`, but `emptyDir: {}` will be used for downloads - but it is recommended enable some type of PVC and PV!

You can define basic persistent volume claims in code to help you get started. You just need to pass to the pvc name (which is the key) is an empty object (`{}`)

```yaml
persistentVolumeClaims:
sabnzbd-config:
accessMode: 'ReadWriteOnce'
requestStorage: '1Gi'
storageClassName: 'manual'
selector:
matchLabels:
type: 'local'
```

### Ingress

Ingress can be enabled, and you can customise the default host, path, and TLS settings:

```yaml
ingress:
enabled: true
host: 'example.com'
tls:
# Your TLS settings...
```

### Metrics

Enabling metrics enables a sidecar container being attached for [exportarr](https://github.com/onedr0p/exportarr/) - and a ServiceMonitor CRD to be consumed by the [kube-prometheus](https://github.com/prometheus-operator/kube-prometheus) package.

```yaml
metrics:
enabled: true
env: []
```

It is recommended to install [kube-prometheus chart](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack) first for the CRD to be supported. It is not included as a dependency by default in this package!

Unless changed with `metrics.port.number` you can then consume metrics over port `9707`.

### Advanced

Other supported deployment configuration include `deployment.nodeSelector`, `deployment.tolerations`, and `deployment.affinity`

You can also adjust container ports, environment variables (such as adding `PGID` and `PUID`) and define a `serviceAccount`.

Have a look at the parent charts default `values.yaml` for a comprehensive list of available config.

## Upgrading

To upgrade the deployment:

```bash
helm upgrade sabnzbd media-servarr/sabnzbd -f myvalues.yaml
```

## Uninstallation

To uninstall/delete the `sabnzbd` deployment:

```bash
helm uninstall sabnzbd
```

## Support

For support, issues, or feature requests, please file an issue on the chart's repository issue tracker.
Binary file added charts/sabnzbd/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions charts/sabnzbd/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Success!
____ _ ____ _ _
/ ___| / \ | __ ) _ __ ___| |__ __| |
\___ \ / _ \ | _ \| '_ \|_ / '_ \ / _` |
___) / ___ \| |_) | | | |/ /| |_) | (_| |
|____/_/ \_\____/|_| |_/___|_.__/ \__,_|

{{ include "media-servarr-base.notes" "SABnzbd" }}
5 changes: 5 additions & 0 deletions charts/sabnzbd/templates/application.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{{/* Prepare Values */}}
{{ include "media-servarr-base.prepareValues" . }}

{{/* Run templater */}}
{{ include "media-servarr-base.template" . }}
93 changes: 93 additions & 0 deletions charts/sabnzbd/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
#
# Secrets to create
#
secrets:
- name: 'apiKey'
value: 'apiKey'
- name: 'nzbKey'
value: 'nzbKey'
- name: 'newsreaderServerPassword'
value: 'password123'

#
# Application Config
#
application:
# main application web ui port
port: 8080
# access url base
urlBase: 'sabnzbd'
# ConfigMap for core application settings
config:
# Filename of configuration
filename: 'sabnzbd.ini'
# Configuration file contents
contents: |
[misc]
language = en
queue_limit = 20
port = 8080
api_key = $apiKey
nzb_key = $nzbKey
download_dir = Downloads/incomplete
complete_dir = Downloads/complete
# [servers]
# [[yournewsreader.example.org]]
# name = yournewsreader.example.org
# displayname = yourNewsReader
# host = yournewsreader.example.org
# port = 563
# username = username
# password = $newsreaderServerPassword
# connections = 8
# ssl = 1
# ssl_verify = 2
# enable = 1
# priority = 0
secrets: [ 'apiKey', 'nzbKey', 'newsreaderServerPassword' ]
# path the file will be mounted to in the config
mountPath: '/config/sabnzbd.ini'

#
# Resource - DEPLOYMENT
# This is to set up and define the application deployment
#
deployment:
container:
image:
repository: 'lscr.io/linuxserver/sabnzbd'

env:
- name: 'PGID'
value: '1000'
- name: 'PUID'
value: '1000'

# Additional volumeMounts on the output Deployment definition.
volumeMounts:
- name: 'config'
mountPath: '/config'
- name: 'downloads'
mountPath: '/config/Downloads'

volumes:
config:
persistentVolumeClaim:
claimName: 'sabnzbd-config'
downloads:
emptyDir: {}

persistentVolumeClaims:
sabnzbd-config:
accessMode: 'ReadWriteOnce'
requestStorage: '1Gi'
selector: {}

ingress:
enabled: true

metrics:
enabled: true
app: 'sabnzbd'
port:
number: 9707

0 comments on commit 868da8c

Please sign in to comment.