-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·40 lines (32 loc) · 1.88 KB
/
install.sh
File metadata and controls
executable file
·40 lines (32 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env bash
set -euo pipefail
REPO="agents-oss/agentspec"
NAMESPACE="agentspec-system"
# ── Prerequisite checks ───────────────────────────────────────────────────────
for cmd in helm kubectl curl; do
command -v "$cmd" >/dev/null 2>&1 || { echo "Error: $cmd not found. Please install it first."; exit 1; }
done
kubectl cluster-info >/dev/null 2>&1 || { echo "Error: No active Kubernetes cluster. Configure kubectl first."; exit 1; }
# ── Fetch latest release version ─────────────────────────────────────────────
VERSION=$(curl -fsSL "https://api.github.com/repos/${REPO}/releases/latest" \
| grep '"tag_name"' \
| sed 's/.*"v\([^"]*\)".*/\1/')
if [[ -z "$VERSION" ]]; then
echo "Error: Could not determine latest version from GitHub releases."
exit 1
fi
echo "Installing agentspec-operator v${VERSION}..."
# ── Helm install from OCI ─────────────────────────────────────────────────────
helm upgrade --install agentspec-operator \
oci://ghcr.io/agents-oss/charts/agentspec-operator \
--version "$VERSION" \
--namespace "$NAMESPACE" --create-namespace
# ── Summary ───────────────────────────────────────────────────────────────────
echo ""
echo "agentspec-operator v${VERSION} installed in namespace: ${NAMESPACE}"
echo ""
echo "To watch agent compliance:"
echo " kubectl get agentobservations -A"
echo ""
echo "To access the control plane (if running):"
echo " kubectl port-forward svc/agentspec-control-plane 4001:4001 -n ${NAMESPACE}"