Skip to content
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 3 commits into from
Mar 22, 2025
Merged

Conversation

martinbjeldbak
Copy link
Owner

No idea if this will work, inspired by qdm12/gluetun-wiki#7 (comment)

Copy link

github-actions bot commented Mar 22, 2025

--- 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
+

Copy link

github-actions bot commented Mar 22, 2025

--- 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
+

* origin/main:
  chore(container): update ghcr.io/home-operations/home-assistant ( 6a0f0a8 → 911d89f ) (#151)
  chore(container): update ghcr.io/home-operations/cni-plugins ( cc5aca1 → 078ddbb ) (#150)
@martinbjeldbak martinbjeldbak merged commit 555b113 into main Mar 22, 2025
5 checks passed
@martinbjeldbak martinbjeldbak deleted the feat/add-transmission branch March 22, 2025 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant