From k8s
Provides Kubernetes CRD design patterns: schema with kubebuilder markers, validating/mutating webhooks, idempotent reconcile loops, and minimal RBAC for operators.
How this skill is triggered — by the user, by Claude, or both
Slash command
/k8s:k8s-crd-designThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Use these patterns when designing and implementing CRDs, webhooks, controllers, and RBAC for Kubernetes operators.
Use these patterns when designing and implementing CRDs, webhooks, controllers, and RBAC for Kubernetes operators.
Before writing code, answer:
Propose a CRD with:
+kubebuilder:validation:*).+kubebuilder:default:= markers for sensible defaults.+kubebuilder:validation:Enum, +kubebuilder:validation:Minimum, +kubebuilder:validation:Pattern as appropriate.+kubebuilder:printcolumn for useful kubectl get output.Example pattern:
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].status`
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
type MyResource struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec MyResourceSpec `json:"spec,omitempty"`
Status MyResourceStatus `json:"status,omitempty"`
}
Ignore (don't block the cluster if webhook is down)Fail (safety over availability)Standard reconcile pattern:
Key principles:
List the minimal permissions the controller needs:
Avoid:
Minimum test coverage:
// Example envtest setup
var _ = BeforeSuite(func() {
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "config", "crd", "bases")},
WebhookInstallOptions: envtest.WebhookInstallOptions{
Paths: []string{filepath.Join("..", "config", "webhook")},
},
}
// ...
})
npx claudepluginhub sagart-cactus/claude-k8s-plugin --plugin k8sScaffolds Kubernetes operators: CRDs, Go controllers, webhooks via Kubebuilder; sets up Tilt dev loop, Kind clusters, Kustomize for fast iteration and validation.
Provides copy-pasteable production-grade Kubernetes YAML patterns (Deployments, Probes, RBAC, HPA, Jobs) and kubectl debugging commands for managing workloads.
Generates validated Kubernetes YAML manifests for Deployments, Services, ConfigMaps, Ingress, RBAC, StatefulSets, and CRDs with CRD research.