Skaffold Dev Community

Skaffold Continuous Development Kubernetes Hot Reload CI/CD Build Deploy File Sync Port Forwarding Multi-service Docker Helm Kustomize Community Building

Dev ToolHot ReloadMulti-serviceK8s Nativeเหมาะกับ
Skaffoldใช่ใช่ใช่K8s Developer
Tiltใช่ใช่ใช่UI Dashboard
DevSpaceใช่ใช่ใช่Remote Dev
Telepresenceใช่บางส่วนใช่Intercept Traffic
Docker Composeบางส่วนใช่ไม่Simple Setup

Skaffold Setup

# === Skaffold Configuration ===

# Install
# brew install skaffold
# # or
# curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64
# chmod +x skaffold && sudo mv skaffold /usr/local/bin

# skaffold.yaml — Basic Configuration
# apiVersion: skaffold/v4beta7
# kind: Config
# metadata:
#   name: my-app
# build:
#   artifacts:
#     - image: my-app-api
#       context: services/api
#       docker:
#         dockerfile: Dockerfile
#       sync:
#         manual:
#           - src: 'src/**/*.ts'
#             dest: /app/src
#     - image: my-app-web
#       context: services/web
#       docker:
#         dockerfile: Dockerfile
#       sync:
#         manual:
#           - src: 'src/**/*.tsx'
#             dest: /app/src
# deploy:
#   kubectl:
#     manifests:
#       - k8s/*.yaml
# portForward:
#   - resourceType: service
#     resourceName: api
#     port: 3000
#     localPort: 3000
#   - resourceType: service
#     resourceName: web
#     port: 8080
#     localPort: 8080

# Profiles — Multiple Environments
# profiles:
#   - name: dev
#     activation:
#       - command: dev
#     build:
#       local:
#         push: false
#   - name: staging
#     build:
#       googleCloudBuild: {}
#     deploy:
#       helm:
#         releases:
#           - name: my-app
#             chartPath: charts/my-app
#             valuesFiles:
#               - values-staging.yaml
#   - name: production
#     deploy:
#       helm:
#         releases:
#           - name: my-app
#             chartPath: charts/my-app
#             valuesFiles:
#               - values-production.yaml

from dataclasses import dataclass

@dataclass
class SkaffoldCommand:
    command: str
    description: str
    use_case: str
    frequency: str

commands = [
    SkaffoldCommand("skaffold dev", "Watch mode, auto build+deploy", "Local development", "ทุกวัน"),
    SkaffoldCommand("skaffold run", "One-time build+deploy", "CI/CD, staging", "ทุก PR"),
    SkaffoldCommand("skaffold debug", "Dev mode + debugger", "Debugging", "เมื่อต้องการ"),
    SkaffoldCommand("skaffold render", "Output manifests", "GitOps, review", "CI/CD"),
    SkaffoldCommand("skaffold build", "Build images only", "Pre-build", "CI/CD"),
    SkaffoldCommand("skaffold init", "Auto-generate config", "New project", "ครั้งเดียว"),
]

print("=== Skaffold Commands ===")
for c in commands:
    print(f"  [{c.command}]")
    print(f"    {c.description} | Use: {c.use_case} | {c.frequency}")

Multi-service Development

# === Multi-service Workflow ===

# Project Structure
# my-platform/
# ├── skaffold.yaml
# ├── services/
# │   ├── api/
# │   │   ├── Dockerfile
# │   │   ├── src/
# │   │   └── package.json
# │   ├── web/
# │   │   ├── Dockerfile
# │   │   ├── src/
# │   │   └── package.json
# │   ├── worker/
# │   │   ├── Dockerfile
# │   │   └── main.py
# │   └── gateway/
# │       ├── Dockerfile
# │       └── nginx.conf
# ├── k8s/
# │   ├── api.yaml
# │   ├── web.yaml
# │   ├── worker.yaml
# │   └── gateway.yaml
# └── charts/
#     └── my-platform/

# Development Workflow
# Terminal 1: skaffold dev --port-forward
# Terminal 2: kubectl logs -f -l app=api
# Terminal 3: Edit code -> auto-deploy

@dataclass
class ServiceStatus:
    name: str
    image: str
    pods: int
    status: str
    sync_mode: str
    last_deploy: str

services = [
    ServiceStatus("api", "my-app-api:latest", 2, "Running", "File Sync", "2s ago"),
    ServiceStatus("web", "my-app-web:latest", 2, "Running", "File Sync", "5s ago"),
    ServiceStatus("worker", "my-app-worker:latest", 1, "Running", "Rebuild", "30s ago"),
    ServiceStatus("gateway", "my-app-gateway:latest", 1, "Running", "Rebuild", "1m ago"),
    ServiceStatus("postgres", "postgres:16", 1, "Running", "N/A (external)", "Stable"),
    ServiceStatus("redis", "redis:7", 1, "Running", "N/A (external)", "Stable"),
]

print("\n=== Service Status (skaffold dev) ===")
for s in services:
    print(f"  [{s.status}] {s.name}")
    print(f"    Image: {s.image} | Pods: {s.pods}")
    print(f"    Sync: {s.sync_mode} | Deploy: {s.last_deploy}")

Community Building

# === Developer Community Strategy ===

@dataclass
class CommunityActivity:
    activity: str
    frequency: str
    participants: int
    impact: str
    tool: str

activities = [
    CommunityActivity("Getting Started Workshop", "Monthly", 20, "Onboard new devs", "Zoom + Skaffold"),
    CommunityActivity("Office Hours", "Weekly", 5, "Q&A troubleshooting", "Slack Huddle"),
    CommunityActivity("Template Showcase", "Bi-weekly", 15, "Share best practices", "Demo + GitHub"),
    CommunityActivity("Blog Post", "Monthly", 100, "Knowledge sharing", "Blog + Medium"),
    CommunityActivity("Plugin Development", "Quarterly", 8, "Custom tooling", "GitHub + Slack"),
    CommunityActivity("KubeCon Meetup", "Annual", 50, "External networking", "In-person"),
]

print("Community Activities:")
for a in activities:
    print(f"  [{a.frequency}] {a.activity}")
    print(f"    Participants: {a.participants} | Impact: {a.impact}")
    print(f"    Tool: {a.tool}")

# Internal Developer Platform
idp_components = {
    "Project Template": "Skaffold + K8s manifests พร้อมใช้",
    "CI/CD Pipeline": "GitHub Actions + skaffold run",
    "Dev Environment": "skaffold dev + port-forward",
    "Staging Deploy": "skaffold run -p staging",
    "Documentation": "Mintlify docs + Getting Started",
    "Slack Channel": "#dev-platform สำหรับถามตอบ",
    "Office Hours": "ทุกพุธ 14:00 Q&A session",
    "Templates Repo": "GitHub org/templates พร้อมใช้",
}

print(f"\n\nInternal Developer Platform:")
for component, desc in idp_components.items():
    print(f"  [{component}]: {desc}")

community_metrics = {
    "Active Developers": "45",
    "Projects Using Skaffold": "12",
    "Avg Deploy Time (dev)": "15 seconds",
    "Weekly Office Hours Attendance": "8",
    "Blog Posts Published": "6/quarter",
    "Custom Templates": "5",
    "Developer Satisfaction": "4.5/5",
}

print(f"\n\nCommunity Metrics:")
for k, v in community_metrics.items():
    print(f"  {k}: {v}")

เคล็ดลับ

  • File Sync: ใช้ File Sync แทน Rebuild เร็วกว่ามาก
  • Profile: แยก Profile สำหรับ Dev Staging Production
  • Template: สร้าง Template Project ให้ทีมใช้เหมือนกัน
  • Workshop: จัด Workshop ทุกเดือนสำหรับคนใหม่
  • Docs: เขียน Getting Started Guide ให้ละเอียด

Skaffold คืออะไร

CLI Tool Google Continuous Development Kubernetes Build Push Deploy Hot Reload File Sync skaffold dev skaffold run Docker Helm Kustomize skaffold.yaml