feat(generic-device-plugin): Add generic device plugin to repository (#28863)

**Description**
<!--
Please include a summary of the change and which issue is fixed. Please
also include relevant motivation and context. List any dependencies that
are required for this change.
-->
⚒️ Fixes  # <!--(issue)-->

**⚙️ Type of change**

- [x] ⚙️ Feature/App addition
- [ ] 🪛 Bugfix
- [ ] ⚠️ Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] 🔃 Refactor of current code

**🧪 How Has This Been Tested?**
<!--
Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. Please also list any relevant details
for your test configuration
-->

**📃 Notes:**
<!-- Please enter any other relevant information here -->

**✔️ Checklist:**

- [x] ⚖️ My code follows the style guidelines of this project
- [x] 👀 I have performed a self-review of my own code
- [ ] #️⃣ I have commented my code, particularly in hard-to-understand
areas
- [x] 📄 I have made corresponding changes to the documentation
- [ ] ⚠️ My changes generate no new warnings
- [ ] 🧪 I have added tests to this description that prove my fix is
effective or that my feature works
- [x] ⬆️ I increased versions for any altered app according to semantic
versioning
- [x] I made sure the title starts with `feat(chart-name):`,
`fix(chart-name):` or `chore(chart-name):`

**➕ App addition**

If this PR is an app addition please make sure you have done the
following.

- [x] 🖼️ I have added an icon in the Chart's root directory called
`icon.png`

---

_Please don't blindly check all the boxes. Read them and only check
those that apply.
Those checkboxes are there for the reviewer to see what is this all
about and
the status of this PR with a quick glance._

---------

Signed-off-by: alfi0812 <43101280+alfi0812@users.noreply.github.com>
This commit is contained in:
alfi0812
2024-11-05 13:27:25 +01:00
committed by GitHub
parent a550c776b0
commit 2d5e17584b
9 changed files with 165 additions and 6 deletions
@@ -0,0 +1,32 @@
# 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
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
# OWNERS file for Kubernetes
OWNERS
# helm-docs templates
*.gotmpl
# docs folder
/docs
# icon
icon.png
icon.webp
icon-small.webp
@@ -0,0 +1,37 @@
annotations:
max_scale_version: 24.04.1
min_scale_version: 24.04.0
truecharts.org/category: media
truecharts.org/max_helm_version: "3.15"
truecharts.org/min_helm_version: "3.11"
truecharts.org/train: stable
apiVersion: v2
appVersion: latest
dependencies:
- name: common
version: 25.1.5
repository: oci://tccr.io/truecharts
condition: ""
alias: ""
tags: []
import-values: []
deprecated: false
description: Device Plugin to expose tun-device on talos
home: https://truecharts.org/charts/stable/generic-device-plugin
icon: https://truecharts.org/img/hotlink-ok/chart-icons/generic-device-plugin.webp
keywords:
- jackett
- torrent
- usenet
kubeVersion: '>=1.24.0-0'
maintainers:
- name: TrueCharts
email: info@truecharts.org
url: https://truecharts.org
name: generic-device-plugin
sources:
- https://ghcr.io/squat/generic-device-plugin
- https://github.com/squat/generic-device-plugin
- https://github.com/truecharts/charts/tree/master/charts/stable/generic-device-plugin
type: application
version: 1.0.0
@@ -0,0 +1,3 @@
---
title: README
---
@@ -0,0 +1,37 @@
---
title: Setup
---
This chart requires a privileged namespace.
After adding this chart you can add your tun device to charts like this:
```yaml
resources:
limits:
kernel.org/tun: 1
```
For addons like our gluetun addon you can add it like this if you are using fluxcd:
```yaml
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: chart
namespace: namespace
spec:
postRenderers:
- kustomize:
patches:
- target:
version: v1
kind: Deployment
name: qbittorrent
patch: |
- op: add
path: /spec/template/spec/containers/1/resources/limits/truecharts.org~1tun
value: 1
interval: 5m
chart:
```
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

@@ -0,0 +1 @@
{{- include "tc.v1.common.lib.chart.notes" $ -}}
@@ -0,0 +1 @@
{{ include "tc.v1.common.loader.all" . }}
@@ -0,0 +1,46 @@
image:
repository: ghcr.io/squat/generic-device-plugin
pullPolicy: IfNotPresent
tag: latest@sha256:ba6f0b4cf6c858d6ad29ba4d32e4da11638abbc7d96436bf04f582a97b2b8821
portal:
open:
enabled: false
workload:
main:
podSpec:
containers:
main:
args:
- --domain
- truecharts.org
- --device
- |
name: tun
groups:
- count: 1000
paths:
- path: /dev/net/tun
securityContext:
container:
readOnlyRootFilesystem: true
privileged: true
runAsNonRoot: false
runAsGroup: 0
runAsUser: 0
persistence:
dev:
enabled: true
type: hostPath
hostPath: /dev
mountPath: /dev
device-plugin:
enabled: true
type: hostPath
hostPath: /var/lib/kubelet/device-plugins
mountPath: /var/lib/kubelet/device-plugins
service:
main:
ports:
main:
port: 8080
protocol: tcp
+8 -6
View File
@@ -213,20 +213,20 @@ In talos in order to use the tun interface for Gluetun a workaround is needed ot
### Step 1: Add the generic-device-plugin
you can find the steps [here](https://www.talos.dev/v1.8/kubernetes-guides/configuration/device-plugins/#deploying-the-device-plugin)
Install the generic-device-plugin from our helm chart repository. Make sure to make the namespace privileged.
### Step 2: Add this into your helm-release.yaml for your app
Here is an example snippet for qbittorrent
Here is an example snippet on how to add it:
```yaml
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: qbittorrent
namespace: qbittorrent
name: chart
namespace: namespace
spec:
postRenderers:
postRenderers:
- kustomize:
patches:
- target:
@@ -235,6 +235,8 @@ spec:
name: qbittorrent
patch: |
- op: add
path: /spec/template/spec/containers/1/resources/limits/squat.ai~1tun
path: /spec/template/spec/containers/1/resources/limits/truecharts.org~1tun
value: 1
interval: 5m
chart:
```