completed upto lab 38

This commit is contained in:
Mosiur Rahman
2026-08-27 14:03:17 +06:00
parent d74b79cfc6
commit ac6292db20
19 changed files with 220 additions and 204 deletions

View File

@@ -0,0 +1,25 @@
#!/usr/bin/env bash
set -Eeuo pipefail
export KUBECONFIG=/opt/cks-lab/kubeconfig
expected_context=kind-cks-lab
context="$(kubectl config current-context 2>/dev/null || true)"
if [[ "$context" != "$expected_context" ]]; then
echo "Safety check failed: expected $expected_context, got ${context:-none}." >&2
exit 1
fi
echo "CKS lab: $(kubectl version --output=json | jq -r .serverVersion.gitVersion)"
echo "Context: $context"
required_tools=(kubectl kube-bench nano vim curl wget jq yq dig nc ss ps less)
missing_tools=()
for tool in "${required_tools[@]}"; do
command -v "$tool" >/dev/null 2>&1 || missing_tools+=("$tool")
done
if (( ${#missing_tools[@]} )); then
echo "Lab setup incomplete; missing: ${missing_tools[*]}. Run ./02-install-and-build.ps1." >&2
exit 1
fi
echo "Tools: ready (nano, curl, wget, jq, yq, dig, nc, tcpdump, ss); alias k=kubectl"
exec bash