diff --git a/kubernetes/apps/default/plex/ks.yaml b/kubernetes/apps/default/plex/ks.yaml index e396f32a..010504ea 100644 --- a/kubernetes/apps/default/plex/ks.yaml +++ b/kubernetes/apps/default/plex/ks.yaml @@ -27,36 +27,34 @@ spec: APP: *app GATUS_PATH: /web/index.html VOLSYNC_CAPACITY: 30Gi -# --- -# # yaml-language-server: $schema=https://ks.hsn.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json -# apiVersion: kustomize.toolkit.fluxcd.io/v1 -# kind: Kustomization -# metadata: -# name: &app plex-trakt-sync -# namespace: flux-system -# spec: -# targetNamespace: default -# commonMetadata: -# labels: -# app.kubernetes.io/name: *app -# interval: 30m -# timeout: 5m -# path: "./kubernetes/apps/default/plex/trakt-sync" -# prune: true -# sourceRef: -# kind: GitRepository -# name: theshire -# wait: true -# dependsOn: -# - name: rook-ceph-cluster -# - name: volsync -# - name: external-secrets-stores -# - name: plex -# postBuild: -# substitute: -# APP: *app -# APP_UID: "1000" -# APP_GID: "1000" +--- +# yaml-language-server: $schema=https://ks.hsn.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: &app plex-trakt-sync + namespace: flux-system +spec: + targetNamespace: default + commonMetadata: + labels: + app.kubernetes.io/name: *app + interval: 30m + timeout: 5m + path: "./kubernetes/apps/default/plex/trakt-sync" + prune: true + sourceRef: + kind: GitRepository + name: theshire + wait: true + dependsOn: + - name: rook-ceph-cluster + - name: volsync + - name: external-secrets-stores + - name: plex + postBuild: + substitute: + APP: *app --- # yaml-language-server: $schema=https://ks.hsn.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json apiVersion: kustomize.toolkit.fluxcd.io/v1 diff --git a/kubernetes/apps/default/plex/trakt-sync/helmrelease.yaml b/kubernetes/apps/default/plex/trakt-sync/helmrelease.yaml new file mode 100644 index 00000000..10aafff4 --- /dev/null +++ b/kubernetes/apps/default/plex/trakt-sync/helmrelease.yaml @@ -0,0 +1,70 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/bjw-s/helm-charts/main/charts/other/app-template/schemas/helmrelease-helm-v2.schema.json +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: &app plex-trakt-sync +spec: + chart: + spec: + chart: app-template + version: 3.5.1 + interval: 30m + sourceRef: + kind: HelmRepository + name: bjw-s + namespace: flux-system + interval: 30m + values: + controllers: + plex-trakt-sync: + type: cronjob + annotations: + reloader.stakater.com/auto: "true" + cronjob: + schedule: "@daily" + pod: + securityContext: + runAsUser: 568 + runAsGroup: 568 + fsGroup: 568 + fsGroupChangePolicy: "OnRootMismatch" + containers: + app: + image: + repository: ghcr.io/taxel/plextraktsync + tag: 0.32.0 + args: + - sync + env: + PLEX_BASEURL: http://plex.default.svc.cluster.local:32400 + PLEX_LOCALURL: http://plex.default.svc.cluster.local:32400 + PLEX_USERNAME: jahanson + TRAKT_USERNAME: jahanson + probes: + liveness: + enabled: false + readiness: + enabled: false + startup: + enabled: false + resources: + requests: + cpu: 5m + memory: 128M + + persistence: + config: + enabled: true + existingClaim: *app + advancedMounts: + plex-trakt-sync: + app: + - path: /app/config + config-yaml: + type: configMap + name: plex-trakt-sync-configmap + globalMounts: + - path: /app/config/config.yml + subPath: config.yml + readOnly: true diff --git a/kubernetes/apps/default/plex/trakt-sync/kustomization.yaml b/kubernetes/apps/default/plex/trakt-sync/kustomization.yaml new file mode 100644 index 00000000..47ff36c5 --- /dev/null +++ b/kubernetes/apps/default/plex/trakt-sync/kustomization.yaml @@ -0,0 +1,15 @@ +--- +# yaml-language-server: $schema=https://json.schemastore.org/kustomization +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ./helmrelease.yaml + - ../../../../templates/volsync +configMapGenerator: + - name: plex-trakt-sync-configmap + files: + - ./resources/config.yml +generatorOptions: + disableNameSuffixHash: true + annotations: + kustomize.toolkit.fluxcd.io/substitute: disabled diff --git a/kubernetes/apps/default/plex/trakt-sync/resources/config.yml b/kubernetes/apps/default/plex/trakt-sync/resources/config.yml new file mode 100644 index 00000000..7d2fff01 --- /dev/null +++ b/kubernetes/apps/default/plex/trakt-sync/resources/config.yml @@ -0,0 +1,26 @@ +--- +cache: + path: $PTS_CACHE_DIR/trakt_cache + +config: + dotenv_override: true + +logging: + append: false + debug: false + filename: plextraktsync.log + +sync: + plex_to_trakt: + collection: true + ratings: true + watched_status: true + trakt_to_plex: + liked_lists: true + ratings: true + watched_status: true + watchlist: true + +xbmc-providers: + movies: imdb + shows: tvdb