본문으로 건너뛰기
Skillpedia
배포 및 클라우드 (DevOps)280k · #198

kubernetes-patterns

하는 일

이 에이전트는 여러 컴퓨터에서 실행되는 프로그램을 정리하고 관리하는 시스템인 Kubernetes에서 애플리케이션을 만들고 관리하도록 돕습니다. 애플리케이션이 잘, 그리고 안전하게 작동하도록 하는 템플릿과 팁을 제공합니다.

사용하는 경우

  • ✓Kubernetes에서 애플리케이션의 설정 코드를 작성할 때.
  • ✓애플리케이션이 얼마나 많은 리소스를 쓸지, 정상 작동 여부를 어떻게 확인할지 같은 동작을 설정할 때.
  • ✓Kubernetes에서 애플리케이션이 멈춘 이유를 찾을 때.

스킬 링크

https://github.com/affaan-m/ECC/blob/main/pi/core/skills/kubernetes-patterns/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/affaan-m/ECC/blob/main/pi/core/skills/kubernetes-patterns/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“보안과 상태 점검이 포함된 간단한 웹 애플리케이션을 Kubernetes에서 실행하는 설정 템플릿을 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

‘매니페스트’ 또는 ‘YAML’이라고 부르는 코드 예시를 제공해 복사해서 사용할 수 있게 합니다. 문제를 찾고 해결하는 데 도움이 되는 명령어도 제공합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Kubernetes Patterns

Production-grade Kubernetes patterns for deploying, managing, and debugging workloads reliably.

When to Activate

  • Writing Kubernetes manifests (Deployments, Services, Ingress, Jobs)
  • Configuring resource requests/limits, liveness/readiness probes
  • Setting up RBAC, namespaces, or ServiceAccounts
  • Managing configuration and secrets in K8s
  • Debugging CrashLoopBackOff, OOMKilled, pending pods, or image pull errors
  • Configuring HPA (Horizontal Pod Autoscaler) or PodDisruptionBudgets
  • Reviewing K8s YAML for security or correctness

When to Use

Same as When to Activate above. This alias satisfies repo skill-format conventions. Use this skill any time you are writing, reviewing, or debugging Kubernetes YAML and workloads.

How It Works

This skill provides copy-pasteable, production-grade YAML patterns and kubectl debugging commands organized by task:

  1. Deployment template — A fully configured production Deployment with security context, rolling update strategy, all three probe types, resource limits, and environment injection from ConfigMap/Secret.
  2. Probes — Decision table for startup vs liveness vs readiness, with correct failureThreshold × periodSeconds math.
  3. Services & Ingress — ClusterIP, LoadBalancer, and TLS Ingress patterns with cert-manager annotations.
  4. ConfigMaps & Secrets — envFrom, file-mount, and external secrets guidance.
  5. Resource management — Requests vs limits rules of thumb by workload type (web API, JVM, worker, sidecar).
  6. RBAC — Least-privilege ServiceAccount → Role → RoleBinding chain.
  7. HPA & PDB — Autoscaling and node-drain safety configurations.
  8. Jobs & CronJobs — One-off and scheduled workload patterns with correct restartPolicy.
  9. kubectl cheatsheet — Logs, exec, rollback, port-forward, dry-run, and common error diagnosis commands.
  10. Anti-patterns & checklist — What NOT to do, and a security/reliability/observability checklist.

Examples

See the sections below for complete, runnable examples. Quick references:

Task Jump to
Full production Deployment YAML Core Workload Patterns
Probe configuration Probes
RBAC least-privilege setup RBAC
Debug a CrashLoopBackOff kubectl Debugging Cheatsheet
Autoscaling HPA

Core Workload Patterns

Deployment — Production Template

apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-app
  namespace: my-namespace
  labels:
    app: my-app
    version: "1.0.0"
spec:
  replicas: 3
  selector:
    matchLabels:
      app: my-app
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1          # Allow 1 extra pod during update
      maxUnavailable: 0    # Never reduce below desired count
  template:
    metadata:
      labels:
        app: my-app
        version: "1.0.0"
    spec:
      # Security context at pod level
      securityContext:
        runAsNonRoot: true
        runAsUser: 1001
        fsGroup: 1001

      # Graceful shutdown
      terminationGracePeriodSeconds: 30

      containers:
        - name: my-app
          image: ghcr.io/org/my-app:1.0.0   # Never use :latest
          imagePullPolicy: IfNotPresent

          ports:
            - containerPort: 8080
              protocol: TCP

          # Resource requests AND limits are both required
          resources:
            requests:
              cpu: "100m"
              memory: "128Mi"
            limits:
              cpu: "500m"
              memory: "256Mi"

          # Container security context
          securityContext:
            allowPrivilegeEscalation: false
            readOnlyRootFilesystem: true
            capabilities:
              drop:
                - ALL

          # Probes (see Probes section below)
          startupProbe:
            httpGet:
              path: /health
              port: 8080
            failureThreshold: 30
            periodSeconds: 5
          livenessProbe:
            httpGet:
              path: /health
              port: 8080
            initialDelaySeconds: 0
            periodSeconds: 30
            failureThreshold: 3
          readinessProbe:
            httpGet:
              path: /ready
              port: 8080
            initialDelaySeconds: 5

…
자주 묻는 질문

Kubernetes란 무엇인가요?

여러 컴퓨터에 걸쳐 실행되는 애플리케이션을 관리하고 정리하는 시스템입니다. 프로그램들을 조율하는 지휘자와 같습니다.

‘매니페스트’나 ‘YAML’이란 무엇인가요?

애플리케이션이 Kubernetes에서 어떻게 설정되고 실행될지 설명하는 텍스트 파일입니다. Kubernetes를 위한 설명서라고 생각하면 됩니다.

‘프로브(검사)’란 무엇인가요?

Kubernetes가 애플리케이션이 올바르게 실행 중인지(livenessProbe), 트래픽을 받을 준비가 되었는지(readinessProbe), 시작되었는지(startupProbe)를 확인하는 검사입니다.

상세 정보

작성자의 원본 설명

Kubernetes workload patterns, resource management, RBAC, probes, autoscaling, ConfigMap/Secret handling, and kubectl debugging for production-grade deployments. Use when writing or reviewing Kubernetes manifests, or debugging probes, RBAC, autoscaling, or resource limits.

repo: affaan-m/ECC

인기도

GitHub 스타
280k
순위
#198
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬