#!/usr/bin/env bash # install/verify.sh — Istio control plane 설치 후 헬스체크 # usage: CTX=homelab ISTIO_NS=istio-system bash install/verify.sh set -uo pipefail CTX="${CTX:-homelab}" ISTIO_NS="${ISTIO_NS:-istio-system}" K="kubectl --context=${CTX}" ok() { printf ' \033[32m[OK]\033[0m %s\n' "$1"; } warn() { printf ' \033[33m[!!]\033[0m %s\n' "$1"; } hdr() { printf '\n== %s ==\n' "$1"; } hdr "context / nodes" $K config current-context $K get nodes -o wide hdr "istiod" if $K -n "$ISTIO_NS" rollout status deploy/istiod --timeout=60s >/dev/null 2>&1; then ok "istiod Ready" else warn "istiod not Ready" fi $K -n "$ISTIO_NS" get deploy istiod -o wide 2>/dev/null hdr "gateways" for gw in istio-ingressgateway istio-egressgateway; do if $K -n "$ISTIO_NS" get deploy "$gw" >/dev/null 2>&1; then ok "$gw deployment 존재" $K -n "$ISTIO_NS" get svc "$gw" -o wide 2>/dev/null else warn "$gw 없음" fi done hdr "pods (istio-system)" $K -n "$ISTIO_NS" get pods -o wide hdr "CRDs (networking.istio.io)" $K get crd 2>/dev/null | grep -c 'istio.io' | xargs -I{} echo " istio CRD 개수: {}" hdr "istioctl analyze" if command -v istioctl >/dev/null 2>&1; then istioctl --context="$CTX" analyze -A else warn "istioctl 미설치 — analyze 생략 (setup 필요)" fi