본문으로 건너뛰기
cccskills
무료GitHub에 공개

kubernetes

Kubernetes best practices: security, workloads, networking, config, operations, GitOps. Use when writing or reviewing K8s manifests and configurations.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

연동 도구Kubernetes
설치 방법 보기

포함된 파일(1)

  • SKILL.md4.9 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Kubernetes

Pod security

  • Never run as root. runAsNonRoot: true, runAsUser (non-zero) in securityContext
  • readOnlyRootFilesystem: true. Mount writable volumes explicitly
  • allowPrivilegeEscalation: false
  • Drop all capabilities, re-add only what's needed: capabilities: {drop: [ALL], add: [NET_BIND_SERVICE]}
  • No hostPID, hostNetwork, hostIPC without explicit system-level justification
  • Pod Security Admission: restricted profile for all application workloads. baseline minimum for system workloads
  • automountServiceAccountToken: false on pods that don't call the API server

RBAC

  • Least privilege. Separate ServiceAccount per workload. No default SA with cluster-level roles
  • Role/RoleBinding over ClusterRole/ClusterRoleBinding unless cluster-scope is required
  • Audit RBAC with kubectl auth can-i --list and rakkess or rbac-tool
  • No verbs: ["*"] or resources: ["*"] in production roles

Secrets

  • Secrets in external store (Vault, AWS Secrets Manager, GCP Secret Manager). Sync via External Secrets Operator or Secrets Store CSI driver
  • Never commit secrets to git. Plain Kubernetes Secret objects are base64 only — require etcd encryption at rest
  • etcd encryption at rest enabled. etcd backed up on schedule (Velero or equivalent)

Network policy

  • Default-deny ingress and egress per namespace. Explicit allow rules per service
  • NetworkPolicies enforced by CNI (Calico, Cilium, or equivalent). Verify CNI supports policy enforcement — not all do
  • Cilium: use CiliumNetworkPolicy for L7 rules (HTTP, gRPC path/method filtering) where needed

Workloads

  • Deployment for stateless. StatefulSet for stateful with stable identity. DaemonSet for node-level agents
  • requests and limits on every container. No unbounded CPU or memory
  • CPU limits cause throttling — set conservatively or omit and rely on namespace LimitRange. Memory limits cause OOMKill — set with headroom
  • minReplicas ≥ 2 for production. Single-replica = not HA
  • Liveness probe: deadlock detection. Readiness probe: traffic gating. Startup probe: slow-starting containers. All three on every long-running container
  • terminationGracePeriodSeconds set to cover max request duration + drain time. Default 30s is often too short
  • preStop: exec: sleep 5 (or equivalent) to allow load balancer to drain before SIGTERM
  • PodDisruptionBudget on all production workloads. minAvailable > 0
  • topologySpreadConstraints or podAntiAffinity to spread replicas across nodes and zones
  • HorizontalPodAutoscaler on CPU/memory or custom metrics for stateless workloads
  • KEDA for event-driven scaling (queue depth, Kafka lag, cron). Preferred over custom metrics pipelines
  • VerticalPodAutoscaler in recommendation mode to right-size requests over time

Images

  • Never latest tag in manifests. Pin to digest or immutable tag
  • imagePullPolicy: Always for mutable tags. imagePullPolicy: IfNotPresent for digest-pinned images
  • Don't build images in-cluster. Build → scan → push → deploy (see Docker skill)

Configuration

  • ConfigMap for non-sensitive config. External secrets (not raw K8s Secret) for sensitive data
  • No env-specific values baked into images. All config injected at runtime
  • Namespaces per environment and team. ResourceQuota and LimitRange per namespace
  • Labels on all resources: app.kubernetes.io/name, app.kubernetes.io/version, app.kubernetes.io/component, env, team

Networking and ingress

  • Ingress controller (NGINX, Traefik) for HTTP/HTTPS. Gateway API preferred for new clusters — more expressive than Ingress
  • TLS termination at ingress. cert-manager for certificate lifecycle (Let's Encrypt or internal CA)
  • Internal service-to-service: ClusterIP. External: LoadBalancer or ingress only. Never NodePort in production

Policy enforcement

  • OPA/Gatekeeper or Kyverno for org-wide policy as code: enforce labels, block latest, require probes, restrict privileges
  • Policies in version control. Applied via GitOps, not ad-hoc
  • Admission webhooks audited — failing-open webhooks can silently bypass policy

Operations

  • GitOps (ArgoCD or Flux) as single source of truth. No direct kubectl apply to production
  • kubectl diff before any manual apply. Never apply blindly
  • Helm or Kustomize for templating. No raw generated manifests in CI
  • Cluster Autoscaler or Karpenter for node scaling. Right-size node pools per workload class (spot, on-demand, GPU)
  • API server audit logs enabled. Ship to centralised logging
  • Falco for runtime threat detection (unexpected syscalls, shell in container, sensitive file access)
  • kubectl rollout for deploys. maxUnavailable: 0, maxSurge: 1 for zero-downtime
  • Upgrade clusters within N-2 of latest minor. Never run unsupported versions

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

aws

무료

AWS best practices: IAM, secrets, networking, security, compute, IaC, ops. Use when building, reviewing, or modifying AWS resources.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

SumonMSelim/agentguard542026년 10월 12일 업데이트

docker

무료

Docker best practices: image security, build efficiency, runtime hardening, Compose, local tooling (Colima, OrbStack). Use when writing or reviewing Dockerfiles and Compose files.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

SumonMSelim/agentguard542026년 10월 12일 업데이트

gcp

무료

GCP best practices: IAM, secrets, networking, security, compute, IaC, ops. Use when building, reviewing, or modifying GCP resources.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

SumonMSelim/agentguard542026년 10월 12일 업데이트

go

무료

Idiomatic Go 1.25 practices: errors, interfaces, concurrency, generics, testing, security, tooling. Use when writing or reviewing Go code.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

SumonMSelim/agentguard542026년 10월 12일 업데이트

java

무료

Modern Java practices: design, errors, concurrency, security, testing, tooling. Targets Java 21 LTS baseline; Java 25 LTS features called out explicitly. Use when writing or reviewing Java code.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

SumonMSelim/agentguard542026년 10월 12일 업데이트

Behavioral guidelines to reduce common LLM coding mistakes. Use when writing, reviewing, or refactoring code to avoid overcomplication, make surgical changes, surface assumptions, and define verifiable success criteria.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

SumonMSelim/agentguard542026년 10월 12일 업데이트

SumonMSelim의 스킬 모두 보기

이 스킬의 문제 신고