From 4d2bff4fac6703253a168379eadf3158746b520d Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 Date: Fri, 23 Oct 2026 09:41:13 +0200 Subject: [PATCH] Preserve live Plex media and rollout adjustments --- .gitea/workflows/deploy.yml | 4 ++-- install.sh | 10 +--------- migration-job.yaml | 2 +- plex.yaml | 9 +++++---- test.sh | 9 +++++++++ 5 files changed, 18 insertions(+), 16 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index c6a2820..5df1e17 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -56,12 +56,12 @@ jobs: --filename "${RUNNER_TEMP}/plex.yaml" "${RUNNER_TEMP}/kubectl" apply --validate=false \ --filename "${RUNNER_TEMP}/plex.yaml" - for attempt in {1..180}; do + for attempt in {1..720}; do IFS='|' read -r generation observed desired updated ready available image <<< "$( "${RUNNER_TEMP}/kubectl" --namespace plex get deployment/plex \ --output=jsonpath='{.metadata.generation}|{.status.observedGeneration}|{.spec.replicas}|{.status.updatedReplicas}|{.status.readyReplicas}|{.status.availableReplicas}|{.spec.template.spec.containers[?(@.name=="plex")].image}' )" - echo "Rollout ${attempt}/180: generation ${observed}/${generation}, replicas ${updated}/${desired} updated, ${ready}/${desired} ready, ${available}/${desired} available, image ${image}" + echo "Rollout ${attempt}/720: generation ${observed}/${generation}, replicas ${updated}/${desired} updated, ${ready}/${desired} ready, ${available}/${desired} available, image ${image}" if [[ "${observed}" == "${generation}" && "${updated}" == "${desired}" \ && "${ready}" == "${desired}" && "${available}" == "${desired}" ]]; then exit 0 diff --git a/install.sh b/install.sh index 18c239b..05cb4e9 100755 --- a/install.sh +++ b/install.sh @@ -11,18 +11,10 @@ if [ "${context}" != "${expected_context}" ]; then exit 1 fi -if [ "$(findmnt -T /komposthaufen/multimedia -n -o FSTYPE)" != bcachefs ]; then - echo '/komposthaufen/multimedia is not backed by bcachefs.' >&2 - exit 1 -fi -test -d /komposthaufen/multimedia/Videos - kubectl apply --filename "${project_dir}/namespace.yaml" -kubectl --namespace plex wait --for=condition=complete \ - job/plex-archlinux-migration --timeout=5s kubectl apply --dry-run=server --filename "${project_dir}/plex.yaml" kubectl apply --filename "${project_dir}/plex.yaml" -kubectl --namespace plex rollout status deployment/plex --timeout=30m +kubectl --namespace plex rollout status deployment/plex --timeout=60m pod=$(kubectl --namespace plex get pod \ --selector=app.kubernetes.io/name=plex,app.kubernetes.io/component=server \ diff --git a/migration-job.yaml b/migration-job.yaml index d0410c3..807e210 100644 --- a/migration-job.yaml +++ b/migration-job.yaml @@ -23,7 +23,7 @@ spec: effect: NoSchedule containers: - name: copy - image: docker.io/library/alpine:3.24.1 + image: docker.io/library/alpine:3.24.2 imagePullPolicy: IfNotPresent command: - /bin/sh diff --git a/plex.yaml b/plex.yaml index 415802b..c9f8298 100644 --- a/plex.yaml +++ b/plex.yaml @@ -56,6 +56,7 @@ metadata: deployment.brunner.ninja/revision: manual spec: replicas: 1 + progressDeadlineSeconds: 3900 strategy: type: Recreate selector: @@ -84,7 +85,7 @@ spec: type: RuntimeDefault initContainers: - name: media-ready - image: docker.io/library/alpine:3.24.1 + image: docker.io/library/alpine:3.24.2 imagePullPolicy: IfNotPresent command: - /tools/check-media.sh @@ -108,7 +109,7 @@ spec: mountPath: /tools readOnly: true - name: exporter-token - image: docker.io/library/alpine:3.24.1 + image: docker.io/library/alpine:3.24.2 imagePullPolicy: IfNotPresent command: - /tools/extract-token.sh @@ -132,7 +133,7 @@ spec: readOnly: true containers: - name: plex - image: docker.io/plexinc/pms-docker:1.43.3.10828-00f62d37d + image: docker.io/plexinc/pms-docker:1.43.4.10903-e5521bd8c imagePullPolicy: IfNotPresent env: - name: TZ @@ -151,7 +152,7 @@ spec: httpGet: path: /identity port: http - failureThreshold: 180 + failureThreshold: 720 periodSeconds: 5 timeoutSeconds: 3 readinessProbe: diff --git a/test.sh b/test.sh index 392336d..78bd31a 100755 --- a/test.sh +++ b/test.sh @@ -8,6 +8,15 @@ sh -n "${project_dir}/install.sh" bash -n "${project_dir}/migrate.sh" bash -n "${project_dir}/create-ci-kubeconfig.sh" +if grep -q '/komposthaufen' "${project_dir}/install.sh"; then + echo 'install.sh must not inspect node-local media paths on the admin machine.' >&2 + exit 1 +fi +if grep -q 'plex-archlinux-migration' "${project_dir}/install.sh"; then + echo 'install.sh must not depend on the one-time migration Job.' >&2 + exit 1 +fi + if command -v docker >/dev/null 2>&1 && docker info >/dev/null 2>&1; then for manifest in namespace.yaml plex.yaml migration-job.yaml; do docker run --rm --interactive \