Preserve live Plex media and rollout adjustments

This commit is contained in:
2026-10-23 09:41:13 +02:00
parent e93c8208f1
commit 4d2bff4fac
5 changed files with 18 additions and 16 deletions
+2 -2
View File
@@ -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
+1 -9
View File
@@ -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 \
+1 -1
View File
@@ -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
+5 -4
View File
@@ -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:
+9
View File
@@ -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 \