generated from onedr0p/cluster-template
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Transmission with Gluetun sidecar #153
Merged
Merged
Conversation
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
--- kubernetes/apps Kustomization: flux-system/cluster-apps Kustomization: default/transmission
+++ kubernetes/apps Kustomization: flux-system/cluster-apps Kustomization: default/transmission
@@ -0,0 +1,41 @@
+---
+apiVersion: kustomize.toolkit.fluxcd.io/v1
+kind: Kustomization
+metadata:
+ labels:
+ kustomize.toolkit.fluxcd.io/name: cluster-apps
+ kustomize.toolkit.fluxcd.io/namespace: flux-system
+ name: transmission
+ namespace: default
+spec:
+ commonMetadata:
+ labels:
+ app.kubernetes.io/name: transmission
+ decryption:
+ provider: sops
+ secretRef:
+ name: sops-age
+ dependsOn:
+ - name: proxmox-csi
+ namespace: csi-proxmox
+ - name: onepassword-store
+ namespace: external-secrets
+ interval: 30m
+ path: ./kubernetes/apps/default/transmission/app
+ postBuild:
+ substituteFrom:
+ - kind: ConfigMap
+ name: cluster-settings
+ optional: true
+ - kind: Secret
+ name: cluster-secrets
+ optional: true
+ prune: true
+ sourceRef:
+ kind: GitRepository
+ name: flux-system
+ namespace: flux-system
+ targetNamespace: default
+ timeout: 5m
+ wait: false
+
--- kubernetes/apps/default/home-assistant/app Kustomization: default/home-assistant HelmRelease: default/home-assistant
+++ kubernetes/apps/default/home-assistant/app Kustomization: default/home-assistant HelmRelease: default/home-assistant
@@ -52,16 +52,13 @@
requests:
cpu: 10m
securityContext:
allowPrivilegeEscalation: false
capabilities:
add:
- - NET_RAW
- NET_ADMIN
- drop:
- - ALL
readOnlyRootFilesystem: true
defaultPodOptions:
dnsPolicy: ClusterFirstWithHostNet
hostNetwork: true
securityContext:
fsGroup: 1000
--- kubernetes/apps/default/transmission/app Kustomization: default/transmission PersistentVolumeClaim: default/transmission
+++ kubernetes/apps/default/transmission/app Kustomization: default/transmission PersistentVolumeClaim: default/transmission
@@ -0,0 +1,18 @@
+---
+apiVersion: v1
+kind: PersistentVolumeClaim
+metadata:
+ labels:
+ app.kubernetes.io/name: transmission
+ kustomize.toolkit.fluxcd.io/name: transmission
+ kustomize.toolkit.fluxcd.io/namespace: default
+ name: transmission
+ namespace: default
+spec:
+ accessModes:
+ - ReadWriteOnce
+ resources:
+ requests:
+ storage: 256Mi
+ storageClassName: proxmox
+
--- kubernetes/apps/default/transmission/app Kustomization: default/transmission ExternalSecret: default/transmission
+++ kubernetes/apps/default/transmission/app Kustomization: default/transmission ExternalSecret: default/transmission
@@ -0,0 +1,31 @@
+---
+apiVersion: external-secrets.io/v1beta1
+kind: ExternalSecret
+metadata:
+ labels:
+ app.kubernetes.io/name: transmission
+ kustomize.toolkit.fluxcd.io/name: transmission
+ kustomize.toolkit.fluxcd.io/namespace: default
+ name: transmission
+ namespace: default
+spec:
+ dataFrom:
+ - extract:
+ key: transmission
+ - extract:
+ key: gluetun
+ secretStoreRef:
+ kind: ClusterSecretStore
+ name: onepassword
+ target:
+ name: transmission-secret
+ template:
+ data:
+ FIREWALL_VPN_INPUT_PORTS: '{{ .GLUETUN_INPUT_PORTS }}'
+ SERVER_REGIONS: '{{ .GLUETUN_REGIONS }}'
+ TRANSMISSION__RPC_PASSWORD: '{{ .TRANSMISSION_PASSWORD }}'
+ TRANSMISSION__RPC_USERNAME: '{{ .TRANSMISSION_USERNAME }}'
+ WIREGUARD_ADDRESSES: '{{ .GLUETUN_WIREGUARD_ADDRESSES }}'
+ WIREGUARD_PRESHARED_KEY: '{{ .GLUETUN_WIREGUARD_PRESHARED_KEY }}'
+ WIREGUARD_PRIVATE_KEY: '{{ .GLUETUN_WIREGUARD_PRIVATE_KEY }}'
+
--- kubernetes/apps/default/transmission/app Kustomization: default/transmission HelmRelease: default/transmission
+++ kubernetes/apps/default/transmission/app Kustomization: default/transmission HelmRelease: default/transmission
@@ -0,0 +1,120 @@
+---
+apiVersion: helm.toolkit.fluxcd.io/v2
+kind: HelmRelease
+metadata:
+ labels:
+ app.kubernetes.io/name: transmission
+ kustomize.toolkit.fluxcd.io/name: transmission
+ kustomize.toolkit.fluxcd.io/namespace: default
+ name: transmission
+ namespace: default
+spec:
+ chart:
+ spec:
+ chart: app-template
+ sourceRef:
+ kind: HelmRepository
+ name: bjw-s
+ namespace: flux-system
+ version: 3.7.3
+ install:
+ remediation:
+ retries: 3
+ interval: 1h
+ upgrade:
+ cleanupOnFail: true
+ remediation:
+ retries: 3
+ strategy: rollback
+ values:
+ controllers:
+ transmission:
+ annotations:
+ reloader.stakater.com/auto: 'true'
+ containers:
+ app:
+ env:
+ TRANSMISSION__DOWNLOAD_DIR: /downloads/completed
+ TRANSMISSION__INCOMPLETE_DIR: /downloads/incomplete
+ TRANSMISSION__RPC_PORT: 9091
+ envFrom:
+ - secretRef:
+ name: transmission-secret
+ image:
+ repository: ghcr.io/home-operations/transmission
+ tag: 4.0.6@sha256:af414de4118be1467f3adfde83d45b2708663640696c3d93f77706ed3b24ee5e
+ resources:
+ limits:
+ memory: 1Gi
+ requests:
+ cpu: 10m
+ securityContext:
+ allowPrivilegeEscalation: false
+ capabilities:
+ drop:
+ - ALL
+ readOnlyRootFilesystem: true
+ gluetun:
+ env:
+ FIREWALL_INPUT_PORTS: '9091'
+ TZ: Australia/Melbourne
+ UPDATER_PERIOD: 48h
+ VPN_SERVICE_PROVIDER: airvpn
+ VPN_TYPE: wireguard
+ envFrom:
+ - secretRef:
+ name: transmission-secret
+ image:
+ repository: ghcr.io/qdm12/gluetun
+ tag: v3.40.0@sha256:2b42bfa046757145a5155acece417b65b4443c8033fb88661a8e9dcf7fda5a00
+ ports:
+ - containerPort: 9091
+ securityContext:
+ capabilities:
+ add:
+ - NET_ADMIN
+ defaultPodOptions:
+ securityContext:
+ fsGroup: 1000
+ fsGroupChangePolicy: OnRootMismatch
+ runAsGroup: 1000
+ runAsNonRoot: true
+ runAsUser: 1000
+ ingress:
+ app:
+ className: internal
+ hosts:
+ - host: '{{ .Release.Name }}.kube.local.martinbjeldbak.com'
+ paths:
+ - path: /
+ service:
+ identifier: app
+ port: http
+ persistence:
+ config:
+ advancedMounts:
+ transmission:
+ app:
+ - path: /config
+ existingClaim: transmission
+ downloads:
+ advancedMounts:
+ transmission:
+ app:
+ - path: /downloads
+ path: /volume1/data/downloads/torrents
+ server: nas.local.martinbjeldbak.com
+ type: nfs
+ gluetun-data:
+ advancedMounts:
+ transmission:
+ gluetun:
+ - path: /tmp/gluetun
+ type: emptyDir
+ service:
+ app:
+ controller: transmission
+ ports:
+ http:
+ port: 9091
+ |
--- HelmRelease: default/home-assistant Deployment: default/home-assistant
+++ HelmRelease: default/home-assistant Deployment: default/home-assistant
@@ -60,16 +60,13 @@
requests:
cpu: 10m
securityContext:
allowPrivilegeEscalation: false
capabilities:
add:
- - NET_RAW
- NET_ADMIN
- drop:
- - ALL
readOnlyRootFilesystem: true
volumeMounts:
- mountPath: /config
name: config
- mountPath: /config/.venv
name: config-cache
--- HelmRelease: default/transmission Service: default/transmission
+++ HelmRelease: default/transmission Service: default/transmission
@@ -0,0 +1,23 @@
+---
+apiVersion: v1
+kind: Service
+metadata:
+ name: transmission
+ labels:
+ app.kubernetes.io/instance: transmission
+ app.kubernetes.io/managed-by: Helm
+ app.kubernetes.io/name: transmission
+ app.kubernetes.io/service: transmission
+ namespace: default
+spec:
+ type: ClusterIP
+ ports:
+ - port: 9091
+ targetPort: 9091
+ protocol: TCP
+ name: http
+ selector:
+ app.kubernetes.io/component: transmission
+ app.kubernetes.io/instance: transmission
+ app.kubernetes.io/name: transmission
+
--- HelmRelease: default/transmission Deployment: default/transmission
+++ HelmRelease: default/transmission Deployment: default/transmission
@@ -0,0 +1,108 @@
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: transmission
+ labels:
+ app.kubernetes.io/component: transmission
+ app.kubernetes.io/instance: transmission
+ app.kubernetes.io/managed-by: Helm
+ app.kubernetes.io/name: transmission
+ annotations:
+ reloader.stakater.com/auto: 'true'
+ namespace: default
+spec:
+ revisionHistoryLimit: 3
+ replicas: 1
+ strategy:
+ type: Recreate
+ selector:
+ matchLabels:
+ app.kubernetes.io/component: transmission
+ app.kubernetes.io/name: transmission
+ app.kubernetes.io/instance: transmission
+ template:
+ metadata:
+ labels:
+ app.kubernetes.io/component: transmission
+ app.kubernetes.io/instance: transmission
+ app.kubernetes.io/name: transmission
+ spec:
+ enableServiceLinks: false
+ serviceAccountName: default
+ automountServiceAccountToken: true
+ securityContext:
+ fsGroup: 1000
+ fsGroupChangePolicy: OnRootMismatch
+ runAsGroup: 1000
+ runAsNonRoot: true
+ runAsUser: 1000
+ hostIPC: false
+ hostNetwork: false
+ hostPID: false
+ dnsPolicy: ClusterFirst
+ containers:
+ - env:
+ - name: TRANSMISSION__DOWNLOAD_DIR
+ value: /downloads/completed
+ - name: TRANSMISSION__INCOMPLETE_DIR
+ value: /downloads/incomplete
+ - name: TRANSMISSION__RPC_PORT
+ value: '9091'
+ envFrom:
+ - secretRef:
+ name: transmission-secret
+ image: ghcr.io/home-operations/transmission:4.0.6@sha256:af414de4118be1467f3adfde83d45b2708663640696c3d93f77706ed3b24ee5e
+ name: app
+ resources:
+ limits:
+ memory: 1Gi
+ requests:
+ cpu: 10m
+ securityContext:
+ allowPrivilegeEscalation: false
+ capabilities:
+ drop:
+ - ALL
+ readOnlyRootFilesystem: true
+ volumeMounts:
+ - mountPath: /config
+ name: config
+ - mountPath: /downloads
+ name: downloads
+ - env:
+ - name: FIREWALL_INPUT_PORTS
+ value: '9091'
+ - name: TZ
+ value: Australia/Melbourne
+ - name: UPDATER_PERIOD
+ value: 48h
+ - name: VPN_SERVICE_PROVIDER
+ value: airvpn
+ - name: VPN_TYPE
+ value: wireguard
+ envFrom:
+ - secretRef:
+ name: transmission-secret
+ image: ghcr.io/qdm12/gluetun:v3.40.0@sha256:2b42bfa046757145a5155acece417b65b4443c8033fb88661a8e9dcf7fda5a00
+ name: gluetun
+ ports:
+ - containerPort: 9091
+ securityContext:
+ capabilities:
+ add:
+ - NET_ADMIN
+ volumeMounts:
+ - mountPath: /tmp/gluetun
+ name: gluetun-data
+ volumes:
+ - name: config
+ persistentVolumeClaim:
+ claimName: transmission
+ - name: downloads
+ nfs:
+ path: /volume1/data/downloads/torrents
+ server: nas.local.martinbjeldbak.com
+ - emptyDir: {}
+ name: gluetun-data
+
--- HelmRelease: default/transmission Ingress: default/transmission
+++ HelmRelease: default/transmission Ingress: default/transmission
@@ -0,0 +1,24 @@
+---
+apiVersion: networking.k8s.io/v1
+kind: Ingress
+metadata:
+ name: transmission
+ labels:
+ app.kubernetes.io/instance: transmission
+ app.kubernetes.io/managed-by: Helm
+ app.kubernetes.io/name: transmission
+ namespace: default
+spec:
+ ingressClassName: internal
+ rules:
+ - host: transmission.kube.local.martinbjeldbak.com
+ http:
+ paths:
+ - path: /
+ pathType: Prefix
+ backend:
+ service:
+ name: transmission
+ port:
+ number: 9091
+ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No idea if this will work, inspired by qdm12/gluetun-wiki#7 (comment)