generated from onedr0p/cluster-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
323 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,8 +9,10 @@ kubeconfig | |
*.pub | ||
*.key | ||
# Private | ||
.private | ||
.archive | ||
.bin | ||
.private | ||
TODO.md | ||
# Ansible | ||
.venv* | ||
# Taskfile | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
kubernetes/storage/apps/kube-system/generic-device-plugin/app/configmap.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: generic-device-plugin-config | ||
data: | ||
config.yaml: | | ||
devices: | ||
- name: nabucasa-skyconnect | ||
groups: | ||
- paths: | ||
- path: /dev/serial/by-id/usb-Nabu_Casa_SkyConnect* | ||
mountPath: /dev/ttyUSB0 |
103 changes: 103 additions & 0 deletions
103
kubernetes/storage/apps/kube-system/generic-device-plugin/app/helmrelease.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
--- | ||
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/helm.toolkit.fluxcd.io/helmrelease_v2beta2.json | ||
apiVersion: helm.toolkit.fluxcd.io/v2 | ||
kind: HelmRelease | ||
metadata: | ||
name: &app generic-device-plugin | ||
spec: | ||
interval: 30m | ||
chart: | ||
spec: | ||
chart: app-template | ||
version: 3.2.1 | ||
sourceRef: | ||
kind: HelmRepository | ||
name: bjw-s | ||
namespace: flux-system | ||
install: | ||
remediation: | ||
retries: 3 | ||
upgrade: | ||
cleanupOnFail: true | ||
remediation: | ||
retries: 3 | ||
values: | ||
defaultPodOptions: | ||
annotations: | ||
reloader.stakater.com/auto: "true" | ||
priorityClassName: system-node-critical | ||
tolerations: | ||
- operator: "Exists" | ||
effect: "NoExecute" | ||
- operator: "Exists" | ||
effect: "NoSchedule" | ||
controllers: | ||
generic-device-plugin: | ||
type: daemonset | ||
containers: | ||
app: | ||
image: | ||
repository: ghcr.io/squat/generic-device-plugin | ||
tag: latest | ||
args: | ||
- --config=/config/config.yaml | ||
- --domain=device | ||
- --log-level=debug | ||
probes: | ||
liveness: &probes | ||
enabled: true | ||
custom: true | ||
spec: | ||
httpGet: | ||
path: /health | ||
port: &port 8080 | ||
initialDelaySeconds: 0 | ||
periodSeconds: 10 | ||
timeoutSeconds: 1 | ||
failureThreshold: 3 | ||
readiness: *probes | ||
startup: *probes | ||
resources: | ||
requests: | ||
cpu: 5m | ||
memory: 16Mi | ||
limits: | ||
cpu: 100m | ||
memory: 64Mi | ||
securityContext: | ||
privileged: true | ||
service: | ||
app: | ||
controller: *app | ||
ports: | ||
http: | ||
port: *port | ||
serviceMonitor: | ||
app: | ||
serviceName: *app | ||
endpoints: | ||
- port: http | ||
scheme: http | ||
path: /metrics | ||
interval: 1m | ||
scrapeTimeout: 10s | ||
serviceAccount: | ||
create: true | ||
name: *app | ||
persistence: | ||
config: | ||
type: configMap | ||
name: generic-device-plugin-config | ||
globalMounts: | ||
- path: /config/config.yaml | ||
subPath: config.yaml | ||
device-plugins: | ||
type: hostPath | ||
hostPath: /var/lib/kubelet/device-plugins | ||
globalMounts: | ||
- path: /var/lib/kubelet/device-plugins | ||
dev: | ||
type: hostPath | ||
hostPath: /dev | ||
globalMounts: | ||
- path: /dev |
7 changes: 7 additions & 0 deletions
7
kubernetes/storage/apps/kube-system/generic-device-plugin/app/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
# yaml-language-server: $schema=https://json.schemastore.org/kustomization | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- ./configmap.yaml | ||
- ./helmrelease.yaml |
21 changes: 21 additions & 0 deletions
21
kubernetes/storage/apps/kube-system/generic-device-plugin/ks.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/kustomization-kustomize-v1.json | ||
apiVersion: kustomize.toolkit.fluxcd.io/v1 | ||
kind: Kustomization | ||
metadata: | ||
name: &app generic-device-plugin | ||
namespace: flux-system | ||
spec: | ||
targetNamespace: kube-system | ||
commonMetadata: | ||
labels: | ||
app.kubernetes.io/name: *app | ||
path: ./kubernetes/storage/apps/kube-system/generic-device-plugin/app | ||
prune: true | ||
sourceRef: | ||
kind: GitRepository | ||
name: home-ops | ||
wait: true | ||
interval: 30m | ||
retryInterval: 1m | ||
timeout: 5m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ resources: | |
- ./echo-server/ks.yaml | ||
- ./ingress-nginx/ks.yaml | ||
- ./k8s-gateway/ks.yaml | ||
- ./usbip-server/ks.yaml |
26 changes: 26 additions & 0 deletions
26
kubernetes/storage/apps/network/usbip-server/app/configmap.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: usbip-server-config | ||
data: | ||
crontab: | | ||
*/1 * * * * /etc/usbip/usbip-bind.sh | ||
usbip-bind.sh: | | ||
#!/bin/bash | ||
PATH=/bin:/sbin:/usr/bin/:/usr/sbin | ||
ID_LIST=$(usbip list -p -l | cut -d'#' -f1 | cut -d'=' -f2) | ||
for id in $ID_LIST; do | ||
usbip bind -b $id 2>/dev/null | ||
done | ||
usbip-unbind.sh: | | ||
#!/bin/bash | ||
PATH=/bin:/sbin:/usr/bin:/usr/sbin | ||
ID_LIST=$(usbip list -p -l | cut -d'#' -f1 | cut -d'=' -f2) | ||
for id in $ID_LIST; do | ||
usbip unbind -b $id 2>/dev/null | ||
done |
115 changes: 115 additions & 0 deletions
115
kubernetes/storage/apps/network/usbip-server/app/helmrelease.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
--- | ||
apiVersion: helm.toolkit.fluxcd.io/v2 | ||
kind: HelmRelease | ||
metadata: | ||
name: &app usbip-server | ||
spec: | ||
interval: 30m | ||
chart: | ||
spec: | ||
chart: app-template | ||
version: 3.2.1 | ||
sourceRef: | ||
kind: HelmRepository | ||
name: bjw-s | ||
namespace: flux-system | ||
install: | ||
remediation: | ||
retries: 3 | ||
upgrade: | ||
cleanupOnFail: true | ||
remediation: | ||
retries: 3 | ||
values: | ||
defaultPodOptions: | ||
annotations: | ||
reloader.stakater.com/auto: "true" | ||
controllers: | ||
usbip-server: | ||
containers: | ||
app: | ||
image: | ||
repository: ghcr.io/prehor/usbip | ||
tag: 6.6.31 | ||
lifecycle: | ||
postStart: | ||
exec: | ||
command: | ||
- /bin/sh | ||
- -c | ||
- | | ||
( | ||
set -ex | ||
/etc/usbip/usbip-bind.sh | ||
) > /tmp/postStart.log 2>&1 || true | ||
preStop: | ||
exec: | ||
command: | ||
- /bin/sh | ||
- -c | ||
- ( | ||
set -ex | ||
/etc/usbip/usbip-unbind.sh | ||
) > /tmp/preStop.log 2>&1 || true | ||
probes: | ||
liveness: &probes | ||
enabled: true | ||
custom: true | ||
spec: | ||
tcpSocket: | ||
port: &port 3240 | ||
initialDelaySeconds: 0 | ||
periodSeconds: 10 | ||
timeoutSeconds: 1 | ||
failureThreshold: 3 | ||
readiness: *probes | ||
resources: | ||
requests: | ||
cpu: 10m | ||
memory: 16Mi | ||
limits: | ||
cpu: 100m | ||
memory: 128Mi | ||
device/nabucasa-skyconnect: 1 | ||
securityContext: | ||
privileged: true | ||
runAsUser: 0 | ||
runAsGroup: 0 | ||
# readOnlyRootFilesystem: true | ||
bind: | ||
image: | ||
repository: ghcr.io/prehor/usbip | ||
tag: 6.6.31 | ||
args: | ||
- /usr/sbin/crond | ||
- -l2 | ||
- -f | ||
persistence: | ||
config: | ||
type: configMap | ||
name: usbip-server-config | ||
defaultMode: 0o555 | ||
globalMounts: | ||
- path: /etc/crontabs/root | ||
subPath: crontab | ||
- path: /etc/usbip/usbip-bind.sh | ||
subPath: usbip-bind.sh | ||
- path: /etc/usbip/usbip-unbind.sh | ||
subPath: usbip-unbind.sh | ||
sys: | ||
type: hostPath | ||
hostPath: /sys | ||
globalMounts: | ||
- path: /sys | ||
service: | ||
app: | ||
controller: *app | ||
type: NodePort | ||
externalTrafficPolicy: Local | ||
ports: | ||
tcp: | ||
port: *port | ||
nodePort: 32400 | ||
serviceAccount: | ||
create: true | ||
name: *app |
6 changes: 6 additions & 0 deletions
6
kubernetes/storage/apps/network/usbip-server/app/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- ./configmap.yaml | ||
- ./helmrelease.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
apiVersion: kustomize.toolkit.fluxcd.io/v1 | ||
kind: Kustomization | ||
metadata: | ||
name: &app usbip-server | ||
namespace: flux-system | ||
spec: | ||
targetNamespace: network | ||
commonMetadata: | ||
labels: | ||
app.kubernetes.io/name: *app | ||
path: ./kubernetes/storage/apps/network/usbip-server/app | ||
prune: true | ||
sourceRef: | ||
kind: GitRepository | ||
name: home-ops | ||
wait: false | ||
interval: 30m | ||
retryInterval: 1m | ||
timeout: 5m |