#!/bin/bash # Deploy script - applies all manifests to the cluster # Usage: SSH to k3s-fi-01 (or any node), then run: # KUBECONFIG=/etc/rancher/k3s/k3s.yaml ./deploy.sh # # Or from local machine with kubectl configured: # ./deploy.sh set -e KUBECTL="${KUBECTL:-k3s kubectl}" if ! command -v k3s &>/dev/null; then KUBECTL="kubectl" fi DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" echo "=== Applying namespaces ===" $KUBECTL apply -f "$DIR/cluster-config/namespaces.yaml" echo "=== Applying cluster config ===" $KUBECTL apply -f "$DIR/cluster-config/clusterissuer.yaml" echo "=== Applying HelmCharts ===" $KUBECTL apply -f "$DIR/helmcharts/" echo "=== Applying workloads ===" for f in "$DIR"/workloads/*/*.yaml; do echo " -> $(basename "$f")" $KUBECTL apply -f "$f" done echo "" echo "=== Done. Check status with: ===" echo " $KUBECTL get pods -A" echo " $KUBECTL get ingress -A" echo " $KUBECTL get certificate -A"