/infra-skills:k8s-workload-patternsfrom infra-skills
Use when writing or reviewing a Kubernetes workload, choosing Deployment vs StatefulSet vs DaemonSet vs Job, or sizing a pod. Covers resources, probes, storage, security context, runtime class, and exposure.
Ships in infra-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
| Type | Use when |
|---|---|
Deployment | Stateless services, multiple replicas, rolling updates |
StatefulSet | Stateful services needing stable network identity or ordered pod management (databases, Valkey/Redis) |
DaemonSet | Per-node services (node exporters, GPU exporters, a hostNetwork ingress controller) |
Job | Run-to-completion tasks |
CronJob | Scheduled one-off tasks |
For most platform services: Deployment. For databases backing platform services: StatefulSet.
Most workloads use the cluster's default container runtime (no runtimeClassName field). A cluster may offer an opt-in sandboxed RuntimeClass (e.g. Kata Containers or gVisor) for workloads that run untrusted or LLM-directed code, or that need real-kernel features without host privileges. Which classes exist and the decision table for using them belong in the project's platform-conventions local skill, if it defines one; without one, omit runtimeClassName.
spec:
template:
spec:
securityContext:
fsGroup: <project-fsGroup> # see the project's platform-conventions local skill
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
containers:
- name: <app>
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop: [ALL]
This meets the restricted Pod Security Standard. On clusters that schedule onto control-plane nodes, add the control-plane toleration as well (see k8s-kustomize-conventions). The project's platform-conventions local skill, if it defines one, holds the canonical versions of these fields.
Always set requests, and set memory limits. Requests affect scheduling; memory limits prevent noisy-neighbour OOM on the node:
resources:
requests:
cpu: "100m"
memory: "256Mi"
limits:
cpu: "1000m"
memory: "512Mi"
GPU workloads additionally set nvidia.com/gpu: 1 (or the vendor's resource name) in limits — overlay only.
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 30
periodSeconds: 10
readinessProbe:
httpGet:
path: /ready
port: 8080
initialDelaySeconds: 5
periodSeconds: 5
Use readinessProbe to control traffic routing. Use livenessProbe to restart genuinely broken containers. Don't share the same endpoint for both unless the semantics align. Slow starters get a startupProbe rather than a long liveness delay.
In-cluster services use ClusterIP. External access goes through the cluster's ingress layer — standard Ingress, Gateway API HTTPRoute, or a controller-specific CRD (e.g. Traefik IngressRoute). Which one, which entry points, and which hostnames are estate choices: follow the project's platform-conventions local skill, if it defines one, and don't mix mechanisms within one cluster without reason.
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: <app>
namespace: <app>
spec:
parentRefs:
- name: <gateway>
hostnames:
- <app>.<service-domain>
rules:
- backendRefs:
- name: <app>
port: 8080
Clusters often separate application and management traffic onto different domains or ingress instances. The concrete domains live in the project's topology local skill, if it defines one.
Always use PVCs, never hostPath (except for node-level DaemonSet patterns such as exporters). StorageClass selection follows the project's platform-conventions local skill — typically separate runtime and retained tiers:
Delete reclaim)Retain reclaim)Never swap these without reviewing the reclaim consequence.
A manifest never holds a secret value. It holds a secret-sync object that a controller resolves into a Kubernetes Secret from the project's secret store. Common shapes:
ExternalSecret referencing a ClusterSecretStore or SecretStore, with a refresh interval and a deletion policy.SealedSecret encrypted for one cluster's controller key, committed as ciphertext.SecretProviderClass mounted as a volume, optionally synced to a Secret.Which mechanism the project uses, its registered store name, and the invariants that must never change silently (for External Secrets, typically the refresh interval and the deletion policy) belong to its platform-conventions local skill, if it defines one; store and item paths belong to its secret-paths local skill. Without them, ask rather than pick values. Add a sync object in the same change as the workload that consumes it, never ahead of it. Changes to these invariants are seam material: see infra-seams.
When reviewing a workload manifest (with k8s-kustomize-conventions for structure and overlays):
securityContext match the project's platform-conventions local skill, if it defines one (runAsNonRoot: true, seccompProfile: RuntimeDefault, its fsGroup, allowPrivilegeEscalation: false)capabilities: drop: [ALL], with any added capability justified in the changepod-security.kubernetes.io/* labels) are preserved; a namespace raised above restricted is one the platform-conventions skill namesrequests set, memory limits set; GPU resources only in an overlayruntimeClassName only where the platform-conventions skill's decision table calls for itWhat SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub pixeloven/crew --plugin infra-skills8 skills in this plugin
/ansible-conventionsUse when writing, changing or reviewing Ansible roles, playbooks, or inventory. Covers repository structure, runtime secret injection, Jinja2/bash delimiter traps, boot-only hardware services, and idempotent check-mode runs./github-actions-conventionsUse when writing or reviewing GitHub Actions workflows or CI. Covers workflow structure, action pinning, secret access, gh CLI usage, uv-based Python jobs, gitleaks scanning, and automated-commit patterns./go-public-reviewUse before making a GitHub repository public, or when reviewing a public one. Audits history, commit metadata and PR refs for exposed content, plus branch and tag rules, docs, public CI, security policy and licence; grades each finding./infra-seamsUse when a diff touches secret-sync objects, tolerations, storage classes, RBAC, or an LLM/tool gateway's access config. Detects infrastructure seam crossings, states the authority delta, seeds the seams registry./k8s-diagnosticsUse when running a Kubernetes health sweep or diagnosing a failing node, pod, GitOps sync or secret sync. Gives kubectl, GitOps-controller and secret-sync checks per sweep section; node-OS tooling defers to topology./k8s-kustomize-conventionsUse when writing, changing or reviewing Kubernetes manifests or Kustomize files. Defines base-and-overlay structure, patch patterns, manifest validation, image-transform limits, and how overlays map to GitOps sync targets.