Skip to content

Commit

Permalink
✨ (plex): Initial Plex chart release
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Apr 5, 2023
1 parent cba8499 commit c7c75b1
Show file tree
Hide file tree
Showing 10 changed files with 371 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ helm delete my-<chart-name>
| [obico <img src='https://raw.githubusercontent.com/gabe565/charts/main/charts/obico/icon.svg' alt='obico icon' width='18px' align='right' loading='lazy'>](charts/obico/) | Obico is a community-built, open-source smart 3D printing platform used by makers, enthusiasts, and tinkerers around the world. |
| [paperless-ngx <img src='https://raw.githubusercontent.com/paperless-ngx/paperless-ngx/b948750d558b58018d1d3393db145d162d44fceb/src-ui/src/assets/logo-notext.svg' alt='paperless-ngx icon' width='18px' align='right' loading='lazy'>](charts/paperless-ngx/) | A community-supported supercharged version of paperless: scan, index and archive all your physical documents |
| [pictshare <img src='https://camo.githubusercontent.com/6efdab1c63d518fafc5e735001c5ed45e7cbd4958952cdd972e2630eee881d97/68747470733a2f2f7069637473686172652e6e65742f706868796e6a2e706e67' alt='pictshare icon' width='18px' align='right' loading='lazy'>](charts/pictshare/) | PictShare is an open source image, mp4, pastebin hosting service with a simple resizing and upload API that you can host yourself. |
| [plex <img src='https://raw.githubusercontent.com/gabe565/charts/main/charts/plex/icon.svg' alt='plex icon' width='18px' align='right' loading='lazy'>](charts/plex/) | Plex organizes all of your personal media so you can enjoy it no matter where you are. |
| [podgrab ](charts/podgrab/) | A self-hosted podcast manager to download episodes as soon as they become live. |
| [portfolio <img src='https://raw.githubusercontent.com/gabe565/portfolio/0f0e80ce2f29e9382a64e7fc6fe2ed1a9993971b/public/android-chrome-512x512.png' alt='portfolio icon' width='18px' align='right' loading='lazy'>](charts/portfolio/) | My personal portfolio website |
| [qbittorrent <img src='https://raw.githubusercontent.com/qbittorrent/qBittorrent/master/src/icons/qbittorrent-tray.svg' alt='qbittorrent icon' width='18px' align='right' loading='lazy'>](charts/qbittorrent/) | The qBittorrent project aims to provide an open-source software alternative to µTorrent. |
Expand Down
25 changes: 25 additions & 0 deletions charts/plex/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 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
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
# helm-docs templates
*.gotmpl
6 changes: 6 additions & 0 deletions charts/plex/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: common
repository: https://bjw-s.github.io/helm-charts
version: 1.3.2
digest: sha256:9bb4816882dfc02904f9f347a7995bf7acefd55bd60f925c3a8d80938a2b1ec0
generated: "2023-04-04T23:04:20.101626-05:00"
29 changes: 29 additions & 0 deletions charts/plex/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: v2
name: plex
description: Plex organizes all of your personal media so you can enjoy it no matter where you are.
home: https://charts.gabe565.com/charts/plex/
icon: https://raw.githubusercontent.com/gabe565/charts/main/charts/plex/icon.svg
type: application
version: 0.0.1
# renovate datasource=docker depName=ghcr.io/linuxserver/plex
appVersion: version-1.31.3.6868-28fc46b27
kubeVersion: ">=1.22.0-0"
keywords:
- media
dependencies:
- name: common
repository: https://bjw-s.github.io/helm-charts
version: 1.3.2
sources:
- https://plex.tv
annotations:
artifacthub.io/changes: |-
- kind: added
description: Initial release
artifacthub.io/links: |-
- name: App homepage
url: https://plex.tv
- name: Container Source
url: https://github.com/linuxserver/docker-plex
- name: Chart Source
url: https://github.com/gabe565/charts/tree/main/charts/plex
121 changes: 121 additions & 0 deletions charts/plex/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# plex

<img src="https://raw.githubusercontent.com/gabe565/charts/main/charts/plex/icon.svg" align="right" width="92" alt="plex logo">

![Version: 0.0.1](https://img.shields.io/badge/Version-0.0.1-informational?style=flat)
![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat)
![AppVersion: version-1.31.3.6868-28fc46b27](https://img.shields.io/badge/AppVersion-version--1.31.3.6868--28fc46b27-informational?style=flat)

Plex organizes all of your personal media so you can enjoy it no matter where you are.

**Homepage:** <https://charts.gabe565.com/charts/plex/>

**This chart is not maintained by the upstream project and any issues with the chart should be raised
[here](https://github.com/gabe565/charts/issues/new?assignees=gabe565&labels=bug&template=bug_report.yaml&name=plex&version=0.0.1)**

## Source Code

* <https://plex.tv>

## Requirements

Kubernetes: `>=1.22.0-0`

## Dependencies

| Repository | Name | Version |
|------------|------|---------|
| <https://bjw-s.github.io/helm-charts> | common | 1.3.2 |

## TL;DR

```console
helm repo add gabe565 https://charts.gabe565.com
helm repo update
helm install plex gabe565/plex
```

## Installing the Chart

To install the chart with the release name `plex`

```console
helm install plex gabe565/plex
```

## Uninstalling the Chart

To uninstall the `plex` deployment

```console
helm uninstall plex
```

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/tree/main/charts/library/common/values.yaml) from the [bjw-s 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 plex \
--set env.TZ="America/New York" \
gabe565/plex
```

Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart.

```console
helm install plex gabe565/plex -f values.yaml
```

## Custom configuration

### Hardware Acceleration

#### Intel QuickSync

Hardware acceleration using an Intel iGPU with QuickSync requires the GPU plugin in
[intel-device-plugins-for-kubernetes](https://github.com/intel/intel-device-plugins-for-kubernetes).

1. Install [intel/gpu-device-plugin](https://github.com/intel/helm-charts/tree/main/charts/gpu-device-plugin)

2. Get the group IDs from your host:
```sh
$ cat /etc/group | grep 'video\|render'
video:x:44:
render:x:109:
```

3. Add the following to your `values.yaml`, replacing the `supplementalGroups` with your group IDs:
```yaml
podSecurityContext:
supplementalGroups: [44, 109]
resources:
requests:
gpu.intel.com/i915: 1
limits:
gpu.intel.com/i915: 1
```

## Values

**Important**: When deploying an application Helm chart you can add more values from the bjw-s common library chart [here](https://github.com/bjw-s/helm-charts/tree/main/charts/library/common)

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| env | object | See [values.yaml](./values.yaml) | Environment variables. [[ref]](https://github.com/linuxserver/docker-plex#parameters) |
| env.TZ | string | `"UTC"` | Set the container timezone |
| image.pullPolicy | string | `"IfNotPresent"` | image pull policy |
| image.repository | string | `"ghcr.io/linuxserver/plex"` | image repository |
| image.tag | string | `"version-1.31.3.6868-28fc46b27"` | image tag |
| ingress.main | object | See [values.yaml](./values.yaml) | Enable and configure ingress settings for the chart under this key. |
| persistence.config | object | See [values.yaml](./values.yaml) | Configure persistence settings for the chart under this key. |
| service.main | object | See [values.yaml](./values.yaml) | Configures HTTP service settings for the chart. |

---
Autogenerated from chart metadata using [helm-docs](https://github.com/norwoodj/helm-docs)
35 changes: 35 additions & 0 deletions charts/plex/README_CONFIG.md.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{{- define "custom.custom.configuration.header" -}}
## Custom configuration
{{- end -}}

{{- define "custom.custom.configuration" -}}
{{ template "custom.custom.configuration.header" . }}

### Hardware Acceleration

#### Intel QuickSync

Hardware acceleration using an Intel iGPU with QuickSync requires the GPU plugin in
[intel-device-plugins-for-kubernetes](https://github.com/intel/intel-device-plugins-for-kubernetes).

1. Install [intel/gpu-device-plugin](https://github.com/intel/helm-charts/tree/main/charts/gpu-device-plugin)

2. Get the group IDs from your host:
```sh
$ cat /etc/group | grep 'video\|render'
video:x:44:
render:x:109:
```

3. Add the following to your `values.yaml`, replacing the `supplementalGroups` with your group IDs:
```yaml
podSecurityContext:
supplementalGroups: [44, 109]

resources:
requests:
gpu.intel.com/i915: 1
limits:
gpu.intel.com/i915: 1
```
{{- end -}}
1 change: 1 addition & 0 deletions charts/plex/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions charts/plex/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{- include "bjw-s.common.lib.chart.notes" . -}}

{{- $deploymentName := printf "deployments/%s" (include "bjw-s.common.lib.chart.names.fullname" .) }}

2. Create a Namespace:

kubectl rollout status {{ $deploymentName }}
kubectl exec -i {{ $deploymentName }} -- headscale users create myfirstnamespace

3. Connect a Node:

When you connect a node for the first time, a webpage will open with a
command to add the machine to your network. Run this command in the container.
For example:

kubectl exec -i {{ $deploymentName }} -- headscale -n NAMESPACE nodes register --key KEY
85 changes: 85 additions & 0 deletions charts/plex/templates/common.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{{/* Append the hardcoded settings */}}
{{- define "headscale.harcodedValues" -}}
args: ["headscale", "serve"]

initContainers:
config:
image: alpine
env:
- name: CONFIG_DIR
value: {{ .Values.persistence.config.mountPath }}
volumeMounts:
{{- if .Values.persistence.config.enabled }}
- name: config
mountPath: {{ .Values.persistence.config.mountPath }}
{{- end }}
command:
- sh
- -c
- |
if [[ -f "$CONFIG_DIR/config.yaml" ]]; then
echo 'Config already exists' >&2
else
echo 'Writing empty config' >&2
cat <<- 'EOF' >"$CONFIG_DIR/config.yaml"
# It's suggested to use environment variables to configure Headscale.
# For config reference, see https://github.com/juanfont/headscale/blob/main/config-example.yaml
# To configure any of these as an env:
# 1. Flatten object keys using "_"
# 2. Prefix with "HEADSCALE_"
#
# For example:
# - "listen_addr" becomes "HEADSCALE_LISTEN_ADDR"
# - "log.level" becomes "HEADSCALE_LOG_LEVEL"
EOF
fi
env:
{{- with .Values.ingress.main }}
{{- if and .enabled .hosts }}
HEADSCALE_SERVER_URL: http{{ if .tls }}s{{ end }}://{{ (first .hosts).host }}
{{- end }}
{{- end }}

{{- with .Values.service.main.ports }}
HEADSCALE_LISTEN_ADDR: "0.0.0.0:{{ .http.port }}"
HEADSCALE_METRICS_LISTEN_ADDR: "0.0.0.0:{{ .metrics.port }}"
{{- end }}

HEADSCALE_PRIVATE_KEY_PATH: "{{ .Values.persistence.config.mountPath }}/private.key"
HEADSCALE_NOISE: "{}"
HEADSCALE_NOISE_PRIVATE_KEY_PATH: "{{ .Values.persistence.config.mountPath }}/noise_private.key"

HEADSCALE_IP_PREFIXES: "fd7a:115c:a1e0::/48 100.64.0.0/10"

HEADSCALE_DERP_URLS: "https://controlplane.tailscale.com/derpmap/default"
HEADSCALE_DERP_AUTO_UPDATE_ENABLED: "true"
HEADSCALE_DERP_UPDATE_FREQUENCY: "24h"

HEADSCALE_EPHEMERAL_NODE_INACTIVITY_TIMEOUT: "30m"

HEADSCALE_DNS_CONFIG_NAMESERVERS: "1.1.1.1 1.0.0.1"
HEADSCALE_DNS_CONFIG_MAGIC_DNS: "true"

{{- with .Values.postgresql }}
{{- if .enabled }}
HEADSCALE_DB_TYPE: postgres
HEADSCALE_DB_HOST: {{ $.Release.Name }}-postgresql
HEADSCALE_DB_PORT: "5432"
HEADSCALE_DB_SSL: "false"
HEADSCALE_DB_NAME: {{ .auth.database }}
HEADSCALE_DB_USER: {{ default "postgres" .auth.username }}
HEADSCALE_DB_PASS:
secretKeyRef:
name: {{ $.Release.Name }}-postgresql
key: {{ if not .auth.password }}postgres-{{ end }}password
{{- else }}
HEADSCALE_DB_TYPE: "sqlite3"
HEADSCALE_DB_PATH: "{{ $.Values.persistence.config.mountPath }}/db.sqlite"
{{- end }}
{{- end }}
{{- end -}}
{{- $_ := merge .Values (include "headscale.harcodedValues" . | fromYaml) -}}

{{/* Render the templates */}}
{{ include "bjw-s.common.loader.all" . }}
52 changes: 52 additions & 0 deletions charts/plex/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#
# IMPORTANT NOTE
#
# This chart inherits from our common library chart. You can check the default values/options here:
# https://github.com/bjw-s/helm-charts/blob/main/charts/library/common/values.yaml
#

image:
# -- image repository
repository: ghcr.io/linuxserver/plex
# -- image pull policy
pullPolicy: IfNotPresent
# -- image tag
tag: version-1.31.3.6868-28fc46b27

# -- Environment variables. [[ref]](https://github.com/linuxserver/docker-plex#parameters)
# @default -- See [values.yaml](./values.yaml)
env:
# -- Set the container timezone
TZ: UTC

service:
# -- Configures HTTP service settings for the chart.
# @default -- See [values.yaml](./values.yaml)
main:
ports:
http:
port: 32400

ingress:
# -- Enable and configure ingress settings for the chart under this key.
# @default -- See [values.yaml](./values.yaml)
main:
enabled: false
# hosts:
# - host: chart-example.local
# paths:
# - path: /
# tls:
# - secretName: chart-example.local-tls
# hosts:
# - chart-example.local

persistence:
# -- Configure persistence settings for the chart under this key.
# @default -- See [values.yaml](./values.yaml)
config:
enabled: false
retain: true
# storageClass: ""
# accessMode: ReadWriteOnce
# size: 1Gi

0 comments on commit c7c75b1

Please sign in to comment.