diff --git a/apps/plex/base/deployment.yaml b/apps/plex/base/deployment.yaml index e3f31f9..151fd19 100644 --- a/apps/plex/base/deployment.yaml +++ b/apps/plex/base/deployment.yaml @@ -20,23 +20,48 @@ spec: runAsGroup: 1000 containers: - name: plex - image: plexinc/pms-docker + image: lscr.io/linuxserver/plex:latest securityContext: allowPrivilegeEscalation: false env: + - name: PUID + value: "1000" + - name: PGID + value: "1000" - name: TZ value: "Australia/Sydney" + - name: VERSION + value: docker - name: PLEX_CLAIM value: "0" ports: - protocol: TCP - containerPort: 8088 + containerPort: 80 name: http volumeMounts: - - name: assets - mountPath: /www/assets + - name: plex-config + mountPath: /config + - name: plex-tv + mountPath: /tv + - name: plex-movie + mountPath: /movie + - name: plex-music + mountPath: /music + - name: plex-gv + mountPath: /gv volumes: - - name: assets + - name: plex-config hostPath: - path: /mnt/nfs/AppData/homer/www/assets - type: Directory + path: /mnt/nfs/AppData/plex/config + - name: plex-tv + hostPath: + path: /mnt/nfs/AppData/plex/tv + - name: plex-movie + hostPath: + path: /mnt/nfs/AppData/plex/movie + - name: plex-music + hostPath: + path: /mnt/nfs/AppData/plex/music + - name: plex-gv + hostPath: + path: /mnt/nfs/AppData/plex/gv diff --git a/apps/plex/base/kustomization.yaml b/apps/plex/base/kustomization.yaml index 419dcad..87b09a3 100644 --- a/apps/plex/base/kustomization.yaml +++ b/apps/plex/base/kustomization.yaml @@ -1,3 +1,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization -resources: [] \ No newline at end of file +resources: + - ./deployment.yaml + - ./service.yaml \ No newline at end of file diff --git a/apps/plex/base/service.yaml b/apps/plex/base/service.yaml new file mode 100644 index 0000000..1431eb7 --- /dev/null +++ b/apps/plex/base/service.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Service +metadata: + name: plex + namespace: plex + labels: + app.kubernetes.io/name: plex +spec: + selector: + app.kubernetes.io/name: plex + type: ClusterIP + internalTrafficPolicy: Cluster + ports: + - protocol: TCP + port: 8899 + targetPort: 80 + name: http diff --git a/apps/plex/env/k3s-cluster/config.json b/apps/plex/env/k3s-cluster/config.json index dc1ebfd..cfba03e 100644 --- a/apps/plex/env/k3s-cluster/config.json +++ b/apps/plex/env/k3s-cluster/config.json @@ -1,10 +1,10 @@ { - "appName": "XXX", - "userGivenName": "XXX", - "namespace": "XXX", - "destNamespace": "XXX", + "appName": "plex", + "userGivenName": "plex", + "namespace": "plex", + "destNamespace": "plex", "destServer": "https://kubernetes.default.svc", - "srcPath": "XXX/XXX/env/k3s-cluster", + "srcPath": "apps/plex/env/k3s-cluster", "srcRepoURL": "https://github.com/3dwardch3ng/home-cluster-ops.git", "srcTargetRevision": "", "labels": null, diff --git a/apps/plex/env/k3s-cluster/ingress.yaml b/apps/plex/env/k3s-cluster/ingress.yaml new file mode 100644 index 0000000..a38a68b --- /dev/null +++ b/apps/plex/env/k3s-cluster/ingress.yaml @@ -0,0 +1,21 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: plex-ingress + namespace: plex + annotations: + nginx.ingress.kubernetes.io/ssl-redirect: "false" + nginx.ingress.kubernetes.io/use-regex: "true" +spec: + ingressClassName: nginx + rules: + - host: "plex.cluster.edward.sydney" + http: + paths: + - pathType: Prefix + path: "/" + backend: + service: + name: plex + port: + number: 8899 \ No newline at end of file diff --git a/apps/plex/env/k3s-cluster/kustomization.yaml b/apps/plex/env/k3s-cluster/kustomization.yaml index a227ac4..3ea3085 100644 --- a/apps/plex/env/k3s-cluster/kustomization.yaml +++ b/apps/plex/env/k3s-cluster/kustomization.yaml @@ -1,4 +1,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - - ../../base \ No newline at end of file + - ../../base + - ./ingress.yaml \ No newline at end of file