diff --git a/argocd-applications/base/mediaserver-application.yaml b/argocd-applications/base/mediaserver-application.yaml new file mode 100644 index 0000000..7dc5c1c --- /dev/null +++ b/argocd-applications/base/mediaserver-application.yaml @@ -0,0 +1,20 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: argo-app-mediaserver + namespace: argocd +spec: + destination: + name: '' + namespace: default + server: https://kubernetes.default.svc + source: + path: mediaserver + repoURL: https://git.mziesel.nl/mans/argocd-test + targetRevision: HEAD + sources: [] + project: default + syncPolicy: + automated: + prune: true + selfHeal: true diff --git a/argocd-applications/kustomization.yaml b/argocd-applications/kustomization.yaml index 86af787..8abee65 100644 --- a/argocd-applications/kustomization.yaml +++ b/argocd-applications/kustomization.yaml @@ -4,15 +4,16 @@ kind: Kustomization namespace: argocd resources: -- ./base/whoami-application.yaml -- ./base/metallb-application.yaml -- ./base/traefik-application.yaml -- ./base/ip-mziesel-nl-application.yaml -- ./base/cert-manager.yaml -- ./base/cyberchef.yaml -- ./base/go-redirect.yaml -- ./base/redlib-application.yaml -- ./base/librespeed-application.yaml -- ./base/nfs-subdir-external-provisioner-application.yaml -- ./base/cloudnative-pg-application.yaml -- ./base/keycloak-application.yaml + - ./base/whoami-application.yaml + - ./base/metallb-application.yaml + - ./base/traefik-application.yaml + - ./base/ip-mziesel-nl-application.yaml + - ./base/cert-manager.yaml + - ./base/cyberchef.yaml + - ./base/go-redirect.yaml + - ./base/redlib-application.yaml + - ./base/librespeed-application.yaml + - ./base/nfs-subdir-external-provisioner-application.yaml + - ./base/cloudnative-pg-application.yaml + - ./base/keycloak-application.yaml + - ./base/mediaserver-application.yaml diff --git a/mediaserver/base/mediaserver-deployment.yaml b/mediaserver/base/mediaserver-deployment.yaml new file mode 100644 index 0000000..7206f6e --- /dev/null +++ b/mediaserver/base/mediaserver-deployment.yaml @@ -0,0 +1,63 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: plex + namespace: plex + labels: + app: plexserver +spec: + replicas: 1 + selector: + matchLabels: + app: plexserver + template: + metadata: + labels: + app: plexserver + annotations: + spec: + volumes: + - name: plex-config + persistentVolumeClaim: + claimName: mediaserver-plex-config-pvc + - name: plex-data + persistentVolumeClaim: + claimName: mediaserver-plex-data-pvc + containers: + - name: plex + - image: plexinc/pms-docker:latest@sha256:1846de6eb835a046d1c5bbffddc0c3ed44e5fa1c56f2ad8deb1dafd00fc61bc2 + resources: + requests: + cpu: 1 + memory: 512Mi + ports: + - name: plex + containerPort: 32400 #PMS + - name: plex-ud + pcontainerPort: 32400 + protocol: UDP + - name: plex-dlna + containerPort: 32469 #Plex DLNA + - name: plex-discovery + containerPort: 5353 + protocol: UDP + - name: plex-dlna-udp + containerPort: 1900 #Plex DLNA + protocol: UDP + env: + - name: UID + value: "\x31\x30\x30\x33" #Corresponds to user id on NFS server (ascii) + - name: GID + value: "\x31\x30\x30\x33" #Corresponds to group id on NFS server + - name: PLEX_CLAIM + value: claim-jTsXpqQhAhsTjJYRdmsx + - name: HOSTNAME + value: plex.mziesel.nl + - name: TZ + value: Europe/Amsterdam + volumeMounts: + - mountPath: /config + name: plex-config + - mountPath: /data + name: plex-data diff --git a/mediaserver/base/mediaserver-ingress.yaml b/mediaserver/base/mediaserver-ingress.yaml new file mode 100644 index 0000000..adb70f8 --- /dev/null +++ b/mediaserver/base/mediaserver-ingress.yaml @@ -0,0 +1,12 @@ +apiVersion: traefik.io/v1alpha1 +kind: IngressRoute +metadata: + name: mediaserver-ingressroute +spec: + routes: + - match: Host(`mediaserver.mziesel.nl`) + kind: Rule + services: + - name: mediaserver + port: web + tls: {} diff --git a/mediaserver/base/mediaserver-namespace.yaml b/mediaserver/base/mediaserver-namespace.yaml new file mode 100644 index 0000000..2171c09 --- /dev/null +++ b/mediaserver/base/mediaserver-namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: mediaserver diff --git a/mediaserver/base/mediaserver-plex-pvc.yaml b/mediaserver/base/mediaserver-plex-pvc.yaml new file mode 100644 index 0000000..a02804d --- /dev/null +++ b/mediaserver/base/mediaserver-plex-pvc.yaml @@ -0,0 +1,23 @@ +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: mediaserver-plex-config-pvc +spec: + storageClassName: nfs-client + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 2Gi +--- +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: mediaserver-plex-data-pvc +spec: + storageClassName: nfs-client + accessModes: + - ReadWriteMany + resources: + requests: + storage: 100Gi diff --git a/mediaserver/base/mediaserver-svc.yaml b/mediaserver/base/mediaserver-svc.yaml new file mode 100644 index 0000000..8bbf204 --- /dev/null +++ b/mediaserver/base/mediaserver-svc.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: mediaserver +spec: + ports: + - name: web + port: 80 + targetPort: web + selector: + app: mediaserver diff --git a/mediaserver/kustomization.yaml b/mediaserver/kustomization.yaml new file mode 100644 index 0000000..e758eb1 --- /dev/null +++ b/mediaserver/kustomization.yaml @@ -0,0 +1,11 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +namespace: mediaserver + +resources: + - ./base/mediaserver-namespace.yaml + - ./base/mediaserver-plex-pvc.yaml + - ./base/mediaserver-deployment.yaml + - ./base/mediaserver-svc.yaml + - ./base/mediaserver-ingress.yaml