Files
homelab/scripts/import-cluster-access.sh
T
k.rennerandClaude Opus 4.7 097197c412 chore: remove orphan manifests, harden CI fail-paths, drop stale CLAUDE.md
- Delete kubernetes/apps/authentik/postgres.yaml: orphan CNPG Cluster with
  bootstrap.initdb and no plugin declaration; would compete with the
  working ak-pg in authentik-db/ if accidentally applied.
- Delete kubernetes/apps/owncloud/: subtree never wired into Flux (no
  Kustomization in clusters/homelab/ targets it), would not deploy.
- Drop CLAUDE.md: superseded by ~/.claude/CLAUDE.md global instructions.
- rebuild-k8s.yml: track per-module retry failures and exit 1 if any
  module didn't recover; add set -e to disk-wipe step. Stops masking.
- import-cluster-access.sh: drop "|| true" on git checkout so missing
  access files surface immediately instead of silently continuing.
- Add scripts/trust-letsencrypt-staging.sh: helper to install Let's
  Encrypt staging roots into system or Firefox trust stores.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 18:37:04 +02:00

30 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
# Import SOPS-encrypted talosconfig and kubeconfig from the rebuild pipeline
# into local ~/.talos/config and ~/.kube/config.
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
ACCESS_DIR="$REPO_ROOT/kubernetes/access"
# Pull latest access files — the rebuild pipeline commits new talos/kube configs each run
echo "Fetching latest access files from origin..."
git -C "$REPO_ROOT" fetch --quiet origin master
git -C "$REPO_ROOT" checkout --quiet origin/master -- kubernetes/access/
[[ -f "$ACCESS_DIR/talosconfig.sops" ]] || { echo "talosconfig.sops not found — run the rebuild-k8s pipeline first"; exit 1; }
[[ -f "$ACCESS_DIR/kubeconfig.sops" ]] || { echo "kubeconfig.sops not found — run the rebuild-k8s pipeline first"; exit 1; }
mkdir -p ~/.talos ~/.kube
sops -d --input-type binary --output-type binary "$ACCESS_DIR/talosconfig.sops" > ~/.talos/config
chmod 600 ~/.talos/config
sops -d --input-type binary --output-type binary "$ACCESS_DIR/kubeconfig.sops" > ~/.kube/config
chmod 600 ~/.kube/config
echo "Imported:"
echo " ~/.talos/config"
echo " ~/.kube/config"
kubectl get nodes 2>&1 | head -5