Repository navigation
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·489 lines (425 loc) · 19.4 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·489 lines (425 loc) · 19.4 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
#!/bin/bash
# GitOps Setup Script: Terraform + kind ClusterAPI Management + Flux + Workload Cluster
#
# Target Flow:
# 1. Use Terraform CLI to create Azure service principal and resource group.
# 2. Create kind ClusterAPI management cluster.
# 3. Create azure-cluster-identity secret from Terraform outputs.
# 4. Install Flux (manifests under capi-workload/flux-system) and reconcile management GitOps tree.
# 5. Ensure aks-infrastructure (Kustomization in ./capi-workload/infrastructure/aks-infrastructure) reconciles.
# 6. Wait until workload cluster (Cluster resource) becomes Ready.
# 7. Install Flux on workload cluster (manifests under aks-workload/flux-system) and bootstrap its GitOps source.
# 8. Wait for apps Kustomization in workload cluster (aks-workload/apps) to become Ready.
# 9. Retrieve LoadBalancer external IP and open in browser.
set -euo pipefail
echo "🚀 GitOps AKS Setup (Terraform + ClusterAPI + Flux)"
echo "===================================================="
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
# Helper functions
print_step() {
echo -e "${BLUE}Step $1: $2${NC}"
}
print_success() {
echo -e "${GREEN}✅ $1${NC}"
}
print_warning() {
echo -e "${YELLOW}⚠️ $1${NC}"
}
print_error() {
echo -e "${RED}❌ $1${NC}"
exit 1
}
# Check if command exists
check_command() {
if ! command -v $1 &> /dev/null; then
print_error "$1 is not installed. Please install it first."
fi
}
# Step 0: Prerequisites check
print_step "0" "Checking prerequisites"
REQUIRED_COMMANDS=("az" "kubectl" "helm" "kind" "clusterctl" "flux" "git" "docker" "terraform")
for cmd in "${REQUIRED_COMMANDS[@]}"; do
check_command $cmd
done
print_success "All required commands are available"
# Check Azure login
if ! az account show &> /dev/null; then
print_error "Please login to Azure first: az login"
fi
print_success "Azure CLI is logged in"
# Check environment variables
if [ -z "${GITHUB_TOKEN:-}" ]; then
print_warning "GITHUB_TOKEN not set (only needed for private repo or bootstrap generation); proceeding"
fi
if [ -z "${GITHUB_OWNER:-}" ]; then
print_warning "GITHUB_OWNER not set, using default: your-github-username"
export GITHUB_OWNER="your-github-username"
fi
if [ -z "${GITHUB_REPO:-}" ]; then
print_warning "GITHUB_REPO not set, using default: poc-capi-aks"
export GITHUB_REPO="poc-capi-aks"
fi
if [ -z "${CAPI_CLUSTER_NAME:-}" ]; then
print_warning "CAPI_CLUSTER_NAME not set; using default: capi-mgmt"
export CAPI_CLUSTER_NAME=capi-mgmt
fi
print_success "Environment variables configured"
#############################################
# Step 1: Run Terraform to create Azure resources
#############################################
print_step "1" "Create Azure service principal and resource group using Terraform"
# Get current Azure subscription and tenant from az CLI
echo "[setup] Retrieving Azure subscription and tenant from current az login..."
export ARM_SUBSCRIPTION_ID=$(az account show --query id -o tsv)
export ARM_TENANT_ID=$(az account show --query tenantId -o tsv)
print_success "Using Azure subscription: ${ARM_SUBSCRIPTION_ID}"
print_success "Using Azure tenant: ${ARM_TENANT_ID}"
cd terraform
terraform init
# Run terraform apply with environment variables from current az login
echo "[setup] Running terraform apply with current environment variables..."
terraform apply -auto-approve \
-var="arm_subscription_id=${ARM_SUBSCRIPTION_ID}" \
-var="arm_tenant_id=${ARM_TENANT_ID}"
# Capture Terraform outputs
export ARM_SUBSCRIPTION_ID=$(terraform output -raw arm_subscription_id)
export AZURE_TENANT_ID=$(terraform output -raw arm_tenant_id)
export AZURE_CLIENT_ID=$(terraform output -raw service_principal_client_id)
export AZURE_CLIENT_SECRET=$(terraform output -raw service_principal_client_secret)
export AZURE_LOCATION=$(terraform output -raw azure_resource_group_location 2>/dev/null || echo "swedencentral")
export AZURE_RESOURCE_GROUP_NAME=$(terraform output -raw azure_resource_group_name 2>/dev/null || echo "aks-workload-cluster-rg")
export AZURE_SERVICE_PRINCIPAL_NAME=$(terraform output -raw azure_service_principal_name)
cd ..
print_success "Azure resources created via Terraform"
echo " - Subscription: ${ARM_SUBSCRIPTION_ID}"
echo " - Tenant: ${AZURE_TENANT_ID}"
echo " - Service Principal: ${AZURE_SERVICE_PRINCIPAL_NAME}"
echo " - Resource Group: ${AZURE_RESOURCE_GROUP_NAME} (${AZURE_LOCATION})"
# Step 2: ClusterAPI Management Cluster (includes Flux + Terraform Controller bootstrap)
print_step "2" "Create kind management cluster and initialize ClusterAPI"
echo "[setup] Creating kind cluster '${CAPI_CLUSTER_NAME}' (if absent)..."
if ! kind get clusters | grep -q "^${CAPI_CLUSTER_NAME}$"; then
cat <<EOF | kind create cluster --name "${CAPI_CLUSTER_NAME}" --config=- --kubeconfig="${HOME}/.kube/${CAPI_CLUSTER_NAME}.kubeconfig"
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
extraMounts:
- hostPath: /var/run/docker.sock
containerPath: /var/run/docker.sock
kubeadmConfigPatches:
- |
kind: InitConfiguration
nodeRegistration:
kubeletExtraArgs:
system-reserved: memory=8Gi
eviction-hard: memory.available<500Mi
eviction-soft: memory.available<1Gi
eviction-soft-grace-period: memory.available=1m30s
EOF
export KUBECONFIG="${HOME}/.kube/${CAPI_CLUSTER_NAME}.kubeconfig"
print_success "Created kind cluster and saved kubeconfig to ${HOME}/.kube/${CAPI_CLUSTER_NAME}.kubeconfig"
else
echo "[setup] Reusing existing kind cluster '${CAPI_CLUSTER_NAME}'."
# Export kubeconfig for existing cluster
kind export kubeconfig --name="${CAPI_CLUSTER_NAME}" --kubeconfig="${HOME}/.kube/${CAPI_CLUSTER_NAME}.kubeconfig"
export KUBECONFIG="${HOME}/.kube/${CAPI_CLUSTER_NAME}.kubeconfig"
fi
kubectl config use-context "kind-${CAPI_CLUSTER_NAME}" --kubeconfig="${HOME}/.kube/${CAPI_CLUSTER_NAME}.kubeconfig" >/dev/null
echo "[setup] Initializing ClusterAPI (core + azure provider)..."
clusterctl init --infrastructure azure 2>&1 | grep -v "unrecognized format" || true
echo "[setup] Waiting for ClusterAPI controllers..."
kubectl wait --for=condition=Available --timeout=300s -n capi-system deployment/capi-controller-manager 2>&1 | grep -v "unrecognized format"
kubectl wait --for=condition=Available --timeout=300s -n capz-system deployment/capz-controller-manager 2>&1 | grep -v "unrecognized format"
print_success "ClusterAPI management cluster ready"
print_step "3" "Create Azure identity secret from Terraform outputs and mise.toml environment variables"
echo "[setup] Creating azure-cluster-identity secret from Terraform outputs and mise.toml environment variables..."
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Secret
metadata:
name: azure-cluster-identity
namespace: default
stringData:
ARM_SUBSCRIPTION_ID: "${ARM_SUBSCRIPTION_ID}"
AZURE_SUBSCRIPTION_ID: "${ARM_SUBSCRIPTION_ID}"
AZURE_TENANT_ID: "${AZURE_TENANT_ID}"
AZURE_CLIENT_ID: "${AZURE_CLIENT_ID}"
AZURE_CLIENT_SECRET: "${AZURE_CLIENT_SECRET}"
AZURE_LOCATION: "${AZURE_LOCATION}"
AZURE_RESOURCE_GROUP_NAME: "${AZURE_RESOURCE_GROUP_NAME}"
AZURE_SERVICE_PRINCIPAL_NAME: "${AZURE_SERVICE_PRINCIPAL_NAME}"
CLUSTER_NAME: "${CLUSTER_NAME}"
KUBERNETES_VERSION: "${KUBERNETES_VERSION}"
WORKER_MACHINE_COUNT: "${WORKER_MACHINE_COUNT}"
AZURE_NODE_MACHINE_TYPE: "${AZURE_NODE_MACHINE_TYPE}"
EOF
print_success "Azure identity & config secrets configured from Terraform outputs"
print_step "4" "Install Flux controllers on management cluster (manifests path capi-workload/flux-system)"
FLUX_COMPONENTS_DIR="capi-workload/flux-system"
GOTK_COMPONENTS_FILE="${FLUX_COMPONENTS_DIR}/gotk-components.yaml"
GOTK_SYNC_FILE="${FLUX_COMPONENTS_DIR}/gotk-sync.yaml"
mkdir -p "$FLUX_COMPONENTS_DIR"
if [ ! -f "$GOTK_COMPONENTS_FILE" ] || [ ! -f "$GOTK_SYNC_FILE" ]; then
echo "[setup] Generating Flux manifests via 'flux install --export'..."
flux install --export > "$GOTK_COMPONENTS_FILE"
cat > "$GOTK_SYNC_FILE" <<EOF
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: flux-system
namespace: flux-system
spec:
interval: 1m0s
url: https://github.com/${GITHUB_OWNER}/${GITHUB_REPO}
ref:
branch: ${GITHUB_BRANCH:-main}
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: flux-system
namespace: flux-system
spec:
interval: 10m0s
path: ./capi-workload
prune: true
sourceRef:
kind: GitRepository
name: flux-system
wait: false
EOF
fi
echo "[setup] Applying Flux system manifests..."
kubectl apply -f "$GOTK_COMPONENTS_FILE"
kubectl apply -f "$GOTK_SYNC_FILE"
echo "[setup] Waiting for Flux controllers to become Available..."
kubectl -n flux-system wait --for=condition=Available --timeout=240s deployment/source-controller || true
kubectl -n flux-system wait --for=condition=Available --timeout=240s deployment/kustomize-controller || true
kubectl -n flux-system wait --for=condition=Available --timeout=240s deployment/helm-controller || true
kubectl -n flux-system wait --for=condition=Available --timeout=240s deployment/notification-controller || true
print_step "4a" "Wait for GitRepository flux-system Ready"
for i in {1..30}; do
GIT_READY=$(kubectl get gitrepository -n flux-system flux-system -o jsonpath='{.status.conditions[?(@.type=="Ready")].status}' 2>/dev/null || echo "")
if [ "$GIT_READY" = "True" ]; then
print_success "GitRepository flux-system Ready"
break
fi
sleep 6
if [ $i -eq 30 ]; then
print_warning "GitRepository flux-system not Ready within timeout; proceeding anyway"
fi
done
print_step "5" "Wait for aks-infrastructure Kustomization reconciliation"
echo "[setup] Waiting for Kustomization 'aks-infrastructure' to become Ready..."
for i in {1..40}; do
KUST_READY=$(kubectl get kustomization aks-infrastructure -n default -o jsonpath='{.status.conditions[?(@.type=="Ready")].status}' 2>/dev/null || echo "False")
if [ "$KUST_READY" = "True" ]; then
print_success "aks-infrastructure Kustomization Ready"
break
fi
if (( i % 5 == 0 )); then
echo "[wait] aks-infrastructure Ready condition still pending (attempt $i)"
fi
sleep 6
if [ $i -eq 40 ]; then
print_warning "aks-infrastructure Kustomization not Ready within timeout; continuing"
fi
done
print_step "6" "Wait for Cluster resource readiness (workload cluster creation)"
export CLUSTER_NAME=${CLUSTER_NAME:-aks-workload-cluster}
kubectl wait --for=condition=Ready --timeout=600s cluster/${CLUSTER_NAME} 2>/dev/null || print_warning "Cluster Ready condition timeout"
print_step "7" "Install Flux on workload cluster (aks-workload/flux-system)"
# Ensure we're on the management cluster context
export KUBECONFIG="${HOME}/.kube/${CAPI_CLUSTER_NAME}.kubeconfig"
kubectl config use-context "kind-${CAPI_CLUSTER_NAME}" --kubeconfig="${HOME}/.kube/${CAPI_CLUSTER_NAME}.kubeconfig" >/dev/null 2>&1
print_success "Switched KUBECONFIG to management cluster: $KUBECONFIG"
echo "[setup] Fetching workload cluster kubeconfig..."
WORKLOAD_KUBECONFIG="${HOME}/.kube/${CLUSTER_NAME}.kubeconfig"
# Retry logic for kubeconfig retrieval
KUBECONFIG_ATTEMPTS=0
MAX_KUBECONFIG_ATTEMPTS=12
until [ -f "$WORKLOAD_KUBECONFIG" ] && [ -s "$WORKLOAD_KUBECONFIG" ]; do
if [ $KUBECONFIG_ATTEMPTS -ge $MAX_KUBECONFIG_ATTEMPTS ]; then
print_error "Failed to retrieve kubeconfig for cluster '${CLUSTER_NAME}' after $MAX_KUBECONFIG_ATTEMPTS attempts. Cluster may not be fully provisioned."
fi
echo "[setup] Attempting to retrieve kubeconfig (attempt $((KUBECONFIG_ATTEMPTS + 1))/$MAX_KUBECONFIG_ATTEMPTS)..."
clusterctl get kubeconfig ${CLUSTER_NAME} > "$WORKLOAD_KUBECONFIG" 2>/dev/null || true
# Check if file exists and is not empty
if [ -f "$WORKLOAD_KUBECONFIG" ] && [ -s "$WORKLOAD_KUBECONFIG" ]; then
print_success "Kubeconfig retrieved successfully"
break
else
rm -f "$WORKLOAD_KUBECONFIG" 2>/dev/null || true
KUBECONFIG_ATTEMPTS=$((KUBECONFIG_ATTEMPTS + 1))
if [ $KUBECONFIG_ATTEMPTS -lt $MAX_KUBECONFIG_ATTEMPTS ]; then
echo "[setup] Kubeconfig not ready yet, waiting 10 seconds before retry..."
sleep 10
fi
fi
done
# Switch to workload cluster context
export KUBECONFIG="$WORKLOAD_KUBECONFIG"
kubectl config use-context "${CLUSTER_NAME}" --kubeconfig="${HOME}/.kube/${CLUSTER_NAME}.kubeconfig" >/dev/null 2>&1
print_success "Switched KUBECONFIG to workload cluster: $WORKLOAD_KUBECONFIG"
WL_FLUX_DIR="aks-workload/flux-system"
WL_GOTK_COMPONENTS="$WL_FLUX_DIR/gotk-components.yaml"
WL_GOTK_SYNC="$WL_FLUX_DIR/gotk-sync.yaml"
mkdir -p "$WL_FLUX_DIR"
if [ ! -f "$WL_GOTK_COMPONENTS" ] || [ ! -f "$WL_GOTK_SYNC" ]; then
echo "[setup] Generating workload cluster Flux manifests..."
flux install --export > "$WL_GOTK_COMPONENTS"
cat > "$WL_GOTK_SYNC" <<EOF
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: flux-system
namespace: flux-system
spec:
interval: 1m0s
url: https://github.com/${GITHUB_OWNER}/${GITHUB_REPO}
ref:
branch: ${GITHUB_BRANCH:-main}
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: flux-system
namespace: flux-system
spec:
interval: 10m0s
path: ./aks-workload
prune: true
sourceRef:
kind: GitRepository
name: flux-system
wait: false
EOF
fi
echo "[setup] Applying workload Flux system manifests..."
kubectl apply -f "$WL_GOTK_COMPONENTS" || print_warning "Failed applying workload gotk-components; will retry"
kubectl apply -f "$WL_GOTK_SYNC" || print_warning "Failed applying workload gotk-sync; will retry"
echo "[setup] Waiting for workload Flux controllers to become Available..."
kubectl -n flux-system wait --for=condition=Available --timeout=240s deployment/source-controller || print_warning "source-controller not Available in workload cluster"
kubectl -n flux-system wait --for=condition=Available --timeout=240s deployment/kustomize-controller || print_warning "kustomize-controller not Available in workload cluster"
kubectl -n flux-system wait --for=condition=Available --timeout=240s deployment/helm-controller || print_warning "helm-controller not Available in workload cluster"
kubectl -n flux-system wait --for=condition=Available --timeout=240s deployment/notification-controller || print_warning "notification-controller not Available in workload cluster"
echo "[setup] Waiting for workload GitRepository flux-system Ready..."
for i in {1..30}; do
WG_STATUS=$(kubectl get gitrepository -n flux-system flux-system -o jsonpath='{.status.conditions[?(@.type=="Ready")].status}' 2>/dev/null || echo "")
if [ "$WG_STATUS" = "True" ]; then
print_success "Workload GitRepository Ready"
break
fi
sleep 6
if [ $i -eq 30 ]; then
print_warning "Workload GitRepository not Ready within timeout"
fi
done
#############################################
# Step 8: Wait for apps reconciliation in workload cluster
#############################################
print_step "8" "Wait for apps Kustomization in workload cluster"
for i in {1..40}; do
W_APP_STATUS=$(kubectl get kustomization apps -n default -o jsonpath='{.status.conditions[?(@.type=="Ready")].status}' 2>/dev/null || echo "False")
if [ "$W_APP_STATUS" = "True" ]; then
print_success "Workload apps Kustomization Ready"
break
fi
if [ $i -eq 40 ]; then
print_warning "Workload apps Kustomization not Ready within timeout"
break
fi
if (( i % 5 == 0 )); then
echo "[wait] apps Kustomization Ready condition still pending (attempt $i)"
fi
sleep 10
done
#############################################
# Step 9: Get LoadBalancer IP and open in browser
#############################################
print_step "9" "Retrieve LoadBalancer external IP and open in browser"
# Ensure we're on the workload cluster context
export KUBECONFIG="${HOME}/.kube/${CLUSTER_NAME}.kubeconfig"
echo "[setup] Waiting for ingress-nginx LoadBalancer to get an external IP..."
EXTERNAL_IP=""
for i in {1..30}; do
EXTERNAL_IP=$(kubectl get svc -n default default-ingress-nginx-controller -o jsonpath='{.status.loadBalancer.ingress[0].ip}' 2>/dev/null || echo "")
if [ -n "$EXTERNAL_IP" ] && [ "$EXTERNAL_IP" != "null" ]; then
print_success "LoadBalancer external IP: $EXTERNAL_IP"
break
fi
if (( i % 5 == 0 )); then
echo "[wait] Waiting for LoadBalancer IP assignment (attempt $i/30)..."
fi
sleep 10
if [ $i -eq 30 ]; then
print_warning "LoadBalancer IP not assigned within timeout"
EXTERNAL_IP=""
fi
done
if [ -n "$EXTERNAL_IP" ]; then
echo "[setup] Opening http://${EXTERNAL_IP} in default browser..."
if command -v open &> /dev/null; then
# macOS
open "http://${EXTERNAL_IP}" 2>/dev/null || print_warning "Failed to open browser automatically"
elif command -v xdg-open &> /dev/null; then
# Linux
xdg-open "http://${EXTERNAL_IP}" 2>/dev/null || print_warning "Failed to open browser automatically"
else
print_warning "Could not detect browser command. Please manually navigate to: http://${EXTERNAL_IP}"
fi
else
print_warning "No external IP available. Check LoadBalancer service status with: kubectl get svc -n default ingress-nginx-controller"
fi
# Switch back to management cluster kubeconfig for tests referencing controllers there (optional)
export KUBECONFIG="${HOME}/.kube/${CAPI_CLUSTER_NAME}.kubeconfig"
kubectl config use-context "kind-${CAPI_CLUSTER_NAME}" >/dev/null 2>&1 || true
#############################################
# Step 10: Run end-to-end test suite
#############################################
print_step "10" "Running end-to-end test suite"
if [ -f "./tests/test-e2e-system.sh" ]; then
echo "[setup] Executing test suite..."
if bash ./tests/test-e2e-system.sh; then
print_success "All tests passed!"
else
print_warning "Some tests failed or were skipped. Review output above for details."
fi
else
print_warning "Test suite not found at ./tests/test-e2e-system.sh"
fi
echo ""
echo "🎉 Setup Complete!"
echo "=================="
echo ""
echo "Your GitOps-driven AKS cluster (ClusterAPI + Flux) is ready!"
if [ -n "$EXTERNAL_IP" ]; then
echo ""
echo "🌐 Ingress LoadBalancer: http://${EXTERNAL_IP}"
echo " (Browser should have opened automatically)"
fi
echo ""
echo "Next steps:"
echo "1. Clone your GitOps repository: git clone https://github.com/${GITHUB_OWNER}/${GITHUB_REPO}"
echo "2. Review management GitOps tree: ./capi-workload (flux-system, infrastructure/aks-infrastructure)"
echo "3. Review workload GitOps tree: ./aks-workload (flux-system, apps)"
echo "4. Add/modify application manifests under aks-workload/apps/sample-apps"
echo "5. Commit and push changes - both Flux instances will reconcile"
echo "6. View workload cluster Kustomization status: flux -n flux-system get kustomizations"
echo "7. Switch to workload cluster: export KUBECONFIG=${HOME}/.kube/${CLUSTER_NAME}.kubeconfig"
echo "8. Inspect workload apps: flux get all"
echo ""
echo "Useful commands:"
echo "- Access workload cluster: export KUBECONFIG=${HOME}/.kube/${CLUSTER_NAME}.kubeconfig"
echo "- Check Flux status: flux get all"
echo "- View aks-infrastructure Kustomization: flux -n flux-system get kustomizations aks-infrastructure"
echo "- View Cluster resource: kubectl get cluster ${CLUSTER_NAME}"
echo "- Destroy infrastructure: cd terraform && terraform destroy"
echo ""
echo "Documentation: ./README.md"