Initial commit with the existing deployment files
This commit is contained in:
1 parent
13c5a5a6e8
commit
35ae5557b9
10 files changed
+829
-2
No files matched your search
Executable
+34
@@ -0,0 +1,34 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eu
|
||||
|
||||
project_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
|
||||
expected_context=kubernetes-admin@kubernetes
|
||||
context=$(kubectl config current-context)
|
||||
|
||||
if [ "${context}" != "${expected_context}" ]; then
|
||||
echo "Expected Kubernetes context ${expected_context}, found ${context}." >&2
|
||||
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
|
||||
|
||||
pod=$(kubectl --namespace plex get pod \
|
||||
--selector=app.kubernetes.io/name=plex,app.kubernetes.io/component=server \
|
||||
--output=jsonpath='{.items[0].metadata.name}')
|
||||
node=$(kubectl --namespace plex get pod "${pod}" --output=jsonpath='{.spec.nodeName}')
|
||||
image=$(kubectl --namespace plex get deployment plex --output=jsonpath='{.spec.template.spec.containers[?(@.name=="plex")].image}')
|
||||
test "${node}" = arschrock
|
||||
kubectl --namespace plex get pod "${pod}" --output=wide
|
||||
printf 'Plex is ready on %s with image %s.\n' "${node}" "${image}"
|
||||
Reference in new issue
Block a user