Skip to content

feat(show-tech): get control kubectl fabric inspects #554

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions pkg/hhfab/show-tech/control.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ set +e

OUTPUT_FILE="/tmp/show-tech.log"
KUBECTL="/opt/bin/kubectl"
FABRIC="/opt/bin/kubectl-fabric"

# Create a clean log file
: > "$OUTPUT_FILE"

# ---------------------------
Expand Down Expand Up @@ -51,6 +53,53 @@ KUBECTL="/opt/bin/kubectl"
$KUBECTL get events -A
} >> "$OUTPUT_FILE" 2>&1

# ---------------------------
# Fabric Inspection
# ---------------------------
{
echo -e "\n=== Fabric Overview Inspection ==="
$FABRIC inspect fabric

echo -e "\n=== BGP Neighbors Inspection ==="
$FABRIC inspect bgp

echo -e "\n=== LLDP Neighbors Inspection ==="
$FABRIC inspect lldp

echo -e "\n=== Gathering Switch Information ==="
for switch in $($KUBECTL get switches.wiring.githedgehog.com -o jsonpath='{.items[*].metadata.name}' 2>/dev/null); do
echo -e "\n=== Switch Inspection: $switch ==="
PATH="/opt/bin:$PATH" $FABRIC inspect switch --name=$switch
done

echo -e "\n=== Gathering VPC Information ==="
for vpc in $($KUBECTL get vpcs.vpc.githedgehog.com -o jsonpath='{.items[*].metadata.name}' 2>/dev/null); do
echo -e "\n=== VPC Inspection: $vpc ==="
PATH="/opt/bin:$PATH" $FABRIC inspect vpc --name=$vpc
done

echo -e "\n=== Gathering Connection Information ==="
for conn in $($KUBECTL get connections.wiring.githedgehog.com -o jsonpath='{.items[*].metadata.name}' 2>/dev/null); do
echo -e "\n=== Connection Inspection: $conn ==="
PATH="/opt/bin:$PATH" $FABRIC inspect connection --name=$conn
done

echo -e "\n=== Listing Management Connections ==="
PATH="/opt/bin:$PATH" $FABRIC connection get management

echo -e "\n=== Listing Fabric Connections ==="
PATH="/opt/bin:$PATH" $FABRIC connection get fabric

echo -e "\n=== Listing VPC Loopback Connections ==="
PATH="/opt/bin:$PATH" $FABRIC connection get vpc-loopback

echo -e "\n=== Gathering Server Information ==="
for server in $($KUBECTL get servers.wiring.githedgehog.com -o jsonpath='{.items[*].metadata.name}' 2>/dev/null); do
echo -e "\n=== Server Inspection: $server ==="
PATH="/opt/bin:$PATH" $FABRIC inspect server --name=$server
done
} >> "$OUTPUT_FILE" 2>&1

# ---------------------------
# Detailed Pod Information
# ---------------------------
Expand Down
Loading