#!/bin/bash # Usage: start-debug-pod.sh # Validate input parameters if [ $# -ne 2 ]; then echo "Usage: start-debug-pod.sh " exit 1 fi PVC_NAME=$1 NAMESPACE=$2 if [ -z "$PVC_NAME" ] || [ -z "$NAMESPACE" ]; then echo "PVC name and namespace cannot be empty" exit 1 fi # Check if namespace exists if ! kubectl get namespace "$NAMESPACE" > /dev/null 2>&1; then echo "Namespace $NAMESPACE does not exist" exit 1 fi # Check if PVC exists in the specified namespace if ! kubectl get pvc "$PVC_NAME" -n "$NAMESPACE" > /dev/null 2>&1; then echo "PVC $PVC_NAME does not exist in namespace $NAMESPACE" exit 1 fi # Define the name of the debug pod DEBUG_POD_NAME="debug-pod-$PVC_NAME" # Create the YAML file for the debug pod kubectl apply -f - <