Files
ollama-plus/scripts/setup.sh
T

61 lines
2.8 KiB
Bash
Raw Normal View History

2025-09-12 11:20:18 -04:00
#!/usr/bin/env bash
set -euo pipefail;
# cluster + ingress addons (nginx + ingress-dns)
# https://kubernetes.io/docs/tasks/access-application-cluster/ingress-minikube/
# https://minikube.sigs.k8s.io/docs/handbook/addons/ingress-dns/
2025-09-13 21:08:45 -04:00
# NOTE: publish ports 80/443 from the node to the host when using Docker driver
minikube start --driver=docker --cni=cilium --ports=80:80,443:443;
2025-09-12 11:20:18 -04:00
minikube addons enable ingress;
minikube addons enable ingress-dns;
2025-09-13 21:08:45 -04:00
# wait for Cilium (if present) and ingress controller to become Ready
kubectl -n kube-system rollout status ds/cilium --timeout=180s || echo "WARN: cilium DaemonSet not found or not Ready yet";
if kubectl -n ingress-nginx get ds/ingress-nginx-controller >/dev/null 2>&1; then
kubectl -n ingress-nginx rollout status ds/ingress-nginx-controller --timeout=180s || true;
else
kubectl -n ingress-nginx rollout status deploy/ingress-nginx-controller --timeout=180s || true;
fi
2025-09-12 11:20:18 -04:00
# namespaces
kubectl create namespace argocd --dry-run=client -o yaml | kubectl apply -f -;
kubectl create namespace ai --dry-run=client -o yaml | kubectl apply -f -;
2025-09-13 11:44:13 -04:00
# argo workflows namespace (for cronworkflows/workflows + templates)
kubectl create namespace argo --dry-run=client -o yaml | kubectl apply -f -;
2025-09-12 11:20:18 -04:00
# install argo cd (stable manifest)
# https://argo-cd.readthedocs.io/en/stable/operator-manual/installation/
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml;
# WAIT for argocd core components to be ready enough to accept apps (slow piece of-)
kubectl rollout status deploy/argocd-server -n argocd --timeout=180s || true;
kubectl rollout status deploy/argocd-repo-server -n argocd --timeout=180s || true;
kubectl rollout status deploy/argocd-application-controller -n argocd --timeout=180s || true;
# bootstrap this repo
# NOTE: creates the child Applications in apps/children/*
kubectl apply -n argocd -f apps/0-project-and-root.yaml;
2025-09-13 13:40:32 -04:00
echo "DEBUG: writing pods to 'tmp/pods.txt'"
mkdir -p tmp || ""
kubectl get pod -o wide --all-namespaces > tmp/pods.txt
2025-09-13 21:08:45 -04:00
# quick ingress test hint
MINIKUBE_IP=$(minikube ip || echo "<minikube-ip>")
echo "";
echo "To test ingress locally (without DNS), run:";
echo " curl -H 'Host: openwebui.local' http://$MINIKUBE_IP/";
echo "If name doesn't resolve on your host, add to /etc/hosts:";
echo " sudo sh -c 'echo \"$MINIKUBE_IP openwebui.local\" >> /etc/hosts'";
2025-09-12 11:20:18 -04:00
# port-forward argocd ui
echo "";
echo "argocd initial admin password (username 'admin'):";
2025-09-13 13:40:32 -04:00
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath='{.data.password}' | base64 -d; echo "";
2025-09-12 11:20:18 -04:00
echo "";
echo "port-forwarding argocd ui to https://localhost:8443 (ctrl+c to stop) ...";
2025-09-13 13:04:33 -04:00
2025-09-13 13:40:32 -04:00
# kubectl -n argocd port-forward svc/scheduler-ui 12253:12253
2025-09-13 13:04:33 -04:00
kubectl -n argocd port-forward svc/argocd-server 8443:443