mirror of
https://github.com/ghndrx/starlane-router.git
synced 2026-02-10 06:45:01 +00:00
feat: initial commit for starlane-router (FastAPI + Gradient)
This commit is contained in:
40
scripts/doctl_create_cluster.sh
Normal file
40
scripts/doctl_create_cluster.sh
Normal file
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Requirements:
|
||||
# - doctl installed and authenticated: `doctl auth init`
|
||||
# - kubectl installed
|
||||
# - DigitalOcean account with permissions
|
||||
|
||||
# Usage:
|
||||
# ./scripts/doctl_create_cluster.sh my-a2a-cluster nyc1 s-1vcpu-2gb 1.29.1-do.0
|
||||
# Defaults if not provided.
|
||||
|
||||
CLUSTER_NAME=${1:-a2a-cluster}
|
||||
REGION=${2:-nyc1}
|
||||
NODE_SIZE=${3:-s-1vcpu-2gb}
|
||||
VERSION=${4:-1.29.1-do.0}
|
||||
NODE_COUNT=${5:-1}
|
||||
|
||||
echo "Creating cluster: $CLUSTER_NAME in $REGION size=$NODE_SIZE nodes=$NODE_COUNT version=$VERSION"
|
||||
|
||||
doctl kubernetes cluster create "$CLUSTER_NAME" \
|
||||
--region "$REGION" \
|
||||
--version "$VERSION" \
|
||||
--size "$NODE_SIZE" \
|
||||
--count "$NODE_COUNT" \
|
||||
--auto-upgrade=false \
|
||||
--wait
|
||||
|
||||
# Fetch kubeconfig
|
||||
mkdir -p "$HOME/.kube"
|
||||
doctl kubernetes cluster kubeconfig save "$CLUSTER_NAME"
|
||||
|
||||
echo "Cluster created and kubeconfig saved. Current context:"
|
||||
KUBECONTEXT=$(kubectl config current-context)
|
||||
echo "$KUBECONTEXT"
|
||||
|
||||
echo "Optional: install nginx ingress controller"
|
||||
cat <<EOF
|
||||
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.10.1/deploy/static/provider/cloud/deploy.yaml
|
||||
EOF
|
||||
Reference in New Issue
Block a user