Use when working with Skaffold — skaffold continuous development workflow management for Kubernetes. Covers dev loop configuration, build/deploy profiles, debug mode, file sync, render pipeline, and multi-module projects. Use when managing Skaffold development workflows, debugging build failures, configuring deploy profiles, or optimizing the inner dev loop.
Manage Skaffold dev loops, build/deploy profiles, debugging, and file synchronization.
#!/bin/bash
# Skaffold command wrapper
skaffold_cmd() {
skaffold "$@" 2>/dev/null
}
# Skaffold config parser
skaffold_config() {
local config_file="${1:-skaffold.yaml}"
cat "$config_file" 2>/dev/null
}
# Find skaffold configs in project
skaffold_find() {
find "${1:-.}" -name "skaffold.yaml" -o -name "skaffold.yml" 2>/dev/null | sort
}
Always examine skaffold configuration and profiles before running dev/build/deploy.
#!/bin/bash
PROJECT_DIR="${1:-.}"
echo "=== Skaffold Version ==="
skaffold version 2>/dev/null
echo ""
echo "=== Skaffold Config Files ==="
find "$PROJECT_DIR" -name "skaffold.yaml" -o -name "skaffold.yml" 2>/dev/null | sort
echo ""
echo "=== Config Overview ==="
CONFIG="${PROJECT_DIR}/skaffold.yaml"
if [ -f "$CONFIG" ]; then
echo "API Version: $(grep "^apiVersion:" "$CONFIG" | head -1)"
echo "Kind: $(grep "^kind:" "$CONFIG" | head -1)"
echo ""
echo "Build artifacts:"
grep -A 3 "artifacts:" "$CONFIG" | grep "image:" | sed 's/.*image: / /' | head -10
echo ""
echo "Deploy method:"
grep -E "^deploy:|kubectl:|helm:|kustomize:" "$CONFIG" | head -5
fi
echo ""
echo "=== Available Profiles ==="
skaffold diagnose -p "" 2>&1 | grep "profile" | head -10 || \
grep -A 2 "^profiles:" "$CONFIG" 2>/dev/null | head -10 || \
grep "name:" "$CONFIG" 2>/dev/null | grep -A0 -B1 "profiles" | head -10
#!/bin/bash
CONFIG="${1:-skaffold.yaml}"
echo "=== Build Configuration ==="
grep -A 20 "^build:" "$CONFIG" 2>/dev/null | head -25
echo ""
echo "=== Artifacts ==="
grep -B1 -A 5 "image:" "$CONFIG" 2>/dev/null | head -30
echo ""
echo "=== File Sync Configuration ==="
grep -A 10 "sync:" "$CONFIG" 2>/dev/null | head -15
echo ""
echo "=== Port Forwards ==="
grep -A 10 "portForward:" "$CONFIG" 2>/dev/null | head -15
echo ""
echo "=== Dev Loop Status Check ==="
echo "To start dev loop: skaffold dev [--profile <profile>] [--port-forward]"
echo "To start with debug: skaffold debug [--profile <profile>]"
#!/bin/bash
CONFIG="${1:-skaffold.yaml}"
echo "=== All Profiles ==="
# Extract profile names and their key characteristics
python3 -c "
import yaml, sys
with open('$CONFIG') as f:
cfg = yaml.safe_load(f)
profiles = cfg.get('profiles', [])
for p in profiles:
build_type = 'default'
if 'build' in p:
if 'googleCloudBuild' in p.get('build', {}):
build_type = 'cloud-build'
elif 'cluster' in p.get('build', {}):
build_type = 'in-cluster'
elif 'local' in p.get('build', {}):
build_type = 'local'
deploy_type = 'default'
if 'deploy' in p:
if 'kubectl' in p.get('deploy', {}):
deploy_type = 'kubectl'
elif 'helm' in p.get('deploy', {}):
deploy_type = 'helm'
elif 'kustomize' in p.get('deploy', {}):
deploy_type = 'kustomize'
print(f\"{p['name']}\tbuild={build_type}\tdeploy={deploy_type}\")
" 2>/dev/null || grep -A 1 "- name:" "$CONFIG" 2>/dev/null | grep "name:" | sed 's/.*name: //'
echo ""
echo "=== Profile Activation ==="
grep -A 5 "activation:" "$CONFIG" 2>/dev/null | head -15
echo ""
echo "=== Profile Patches ==="
grep -A 10 "patches:" "$CONFIG" 2>/dev/null | head -20
#!/bin/bash
PROFILE="${1:-}"
CONFIG="${2:-skaffold.yaml}"
echo "=== Render Output (dry-run) ==="
if [ -n "$PROFILE" ]; then
skaffold render -p "$PROFILE" --digest-source=none 2>/dev/null | grep "^kind:" | sort | uniq -c | sort -rn
else
skaffold render --digest-source=none 2>/dev/null | grep "^kind:" | sort | uniq -c | sort -rn
fi
echo ""
echo "=== Build Dry-Run ==="
skaffold build --dry-run ${PROFILE:+-p "$PROFILE"} 2>/dev/null | head -15
echo ""
echo "=== Diagnose Configuration ==="
skaffold diagnose ${PROFILE:+-p "$PROFILE"} 2>/dev/null | head -30
echo ""
echo "=== Schema Validation ==="
skaffold fix --overwrite=false 2>&1 | head -10
#!/bin/bash
CONFIG="${1:-skaffold.yaml}"
echo "=== Debug-Capable Artifacts ==="
grep -B2 -A 8 "image:" "$CONFIG" 2>/dev/null | head -30
echo ""
echo "=== Supported Debug Runtimes ==="
echo " - Go: dlv (Delve)"
echo " - Java: JDWP"
echo " - Node.js: --inspect"
echo " - Python: debugpy/ptvsd"
echo " - .NET: vsdbg"
echo ""
echo "=== Debug Usage ==="
echo "Start debugging: skaffold debug [--port-forward]"
echo "This automatically configures debug ports and disables health check timeouts"
echo ""
echo "=== Current Port Forwards ==="
grep -A 5 "portForward:" "$CONFIG" 2>/dev/null | head -10
echo ""
echo "=== Custom Actions ==="
grep -A 10 "customActions:" "$CONFIG" 2>/dev/null | head -15
#!/bin/bash
PROJECT_DIR="${1:-.}"
echo "=== Skaffold Configs in Project ==="
find "$PROJECT_DIR" -name "skaffold.yaml" -o -name "skaffold.yml" 2>/dev/null | while read cfg; do
DIR=$(dirname "$cfg")
ARTIFACTS=$(grep "image:" "$cfg" 2>/dev/null | wc -l | tr -d ' ')
echo "$DIR: $ARTIFACTS artifacts"
done
echo ""
echo "=== Module Dependencies ==="
grep -A 5 "requires:" "$PROJECT_DIR/skaffold.yaml" 2>/dev/null | head -15
echo ""
echo "=== Shared Config Imports ==="
grep "configs:" "$PROJECT_DIR/skaffold.yaml" 2>/dev/null | head -5
echo ""
echo "=== Build Concurrency ==="
grep "concurrency:" "$PROJECT_DIR/skaffold.yaml" 2>/dev/null || echo "Default concurrency (parallel)"
echo ""
echo "=== Artifact Dependencies ==="
grep -B1 -A 3 "requires:" "$PROJECT_DIR/skaffold.yaml" 2>/dev/null | head -20
echo ""
echo "=== Tag Policy ==="
grep -A 3 "tagPolicy:" "$PROJECT_DIR/skaffold.yaml" 2>/dev/null | head -5
skaffold diagnose, skaffold render, skaffold build --dry-runskaffold dev or skaffold run without explicit user request -- they deploy to clustersPresent results as a structured report:
Managing Skaffold Report
════════════════════════
Resources discovered: [count]
Resource Status Key Metric Issues
──────────────────────────────────────────────
[name] [ok/warn] [value] [findings]
Summary: [total] resources | [ok] healthy | [warn] warnings | [crit] critical
Action Items: [list of prioritized findings]
Target ≤50 lines of output. Use tables for multi-resource comparisons.
--help output.| Shortcut | Counter | Why |
|---|---|---|
| "I'll skip discovery and check known resources" | Always run Phase 1 discovery first | Resource names change, new resources appear — assumed names cause errors |
| "The user only asked for a quick check" | Follow the full discovery → analysis flow | Quick checks miss critical issues; structured analysis catches silent failures |
| "Default configuration is probably fine" | Audit configuration explicitly | Defaults often leave logging, security, and optimization features disabled |
| "Metrics aren't needed for this" | Always check relevant metrics when available | API/CLI responses show current state; metrics reveal trends and intermittent issues |
| "I don't have access to that" | Try the command and report the actual error | Assumed permission failures prevent useful investigation; actual errors are informative |
skaffold fix to migrate config to latest API version--default-repo, images push to the configured registry -- may require authskaffold dev cleans up resources on Ctrl+C -- skaffold run does not--cache-artifacts=false to force rebuild