Kubernetes
SkillCloud & infraKubernetes best practices: security, workloads, networking, config, operations, GitOps. Use when writing or reviewing K8s manifests and configurations.
Available today. Use it from your connected AI after setup.
No other account needed.
Connect ahel once, and every AI you use reads what you have installed.
Then ask your AI: use the Kubernetes skill
What this skill tells your AI
The instructions your AI receives, as published by sumonmselim/agentguard in skills/kubernetes/SKILL.md and read by ahel’s review.
Pod security
- Never run as root.
runAsNonRoot: true,runAsUser(non-zero) insecurityContext readOnlyRootFilesystem: true. Mount writable volumes explicitlyallowPrivilegeEscalation: false- Drop all capabilities, re-add only what's needed:
capabilities: {drop: [ALL], add: [NET_BIND_SERVICE]} - No
hostPID,hostNetwork,hostIPCwithout explicit system-level justification - Pod Security Admission:
restrictedprofile for all application workloads.baselineminimum for system workloads automountServiceAccountToken: falseon pods that don't call the API server
RBAC
- Least privilege. Separate
ServiceAccountper workload. No default SA with cluster-level roles Role/RoleBindingoverClusterRole/ClusterRoleBindingunless cluster-scope is required- Audit RBAC with
kubectl auth can-i --listandrakkessorrbac-tool - No
verbs: ["*"]orresources: ["*"]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
Secretobjects 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
CiliumNetworkPolicyfor L7 rules (HTTP, gRPC path/method filtering) where needed
Workloads
Deploymentfor stateless.StatefulSetfor stateful with stable identity.DaemonSetfor node-level agentsrequestsandlimitson every container. No unbounded CPU or memory- CPU
limitscause throttling — set conservatively or omit and rely on namespaceLimitRange. Memorylimitscause 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
terminationGracePeriodSecondsset to cover max request duration + drain time. Default 30s is often too shortpreStop: exec: sleep 5(or equivalent) to allow load balancer to drain before SIGTERMPodDisruptionBudgeton all production workloads.minAvailable> 0topologySpreadConstraintsorpodAntiAffinityto spread replicas across nodes and zonesHorizontalPodAutoscaleron CPU/memory or custom metrics for stateless workloads- KEDA for event-driven scaling (queue depth, Kafka lag, cron). Preferred over custom metrics pipelines
VerticalPodAutoscalerin recommendation mode to right-size requests over time
Images
- Never
latesttag in manifests. Pin to digest or immutable tag imagePullPolicy: Alwaysfor mutable tags.imagePullPolicy: IfNotPresentfor digest-pinned images- Don't build images in-cluster. Build → scan → push → deploy (see Docker skill)
Configuration
ConfigMapfor non-sensitive config. External secrets (not raw K8sSecret) for sensitive data- No env-specific values baked into images. All config injected at runtime
- Namespaces per environment and team.
ResourceQuotaandLimitRangeper 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-managerfor certificate lifecycle (Let's Encrypt or internal CA) - Internal service-to-service:
ClusterIP. External:LoadBalanceror ingress only. NeverNodePortin 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 applyto production kubectl diffbefore 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 rolloutfor deploys.maxUnavailable: 0,maxSurge: 1for zero-downtime- Upgrade clusters within N-2 of latest minor. Never run unsupported versions
Signals
- GitHub stars
- 56
- Forks
- 11
- Last commit
- Jul 2026
ahel review
S4info
community integration — published by sumonmselim, not kubernetes
Automated review, not a security audit. Ruleset v1.
Advanced
- Catalog kind
- skill
- Gateway key
kubernetes-sumonmselim- Source
- github.com/sumonmselim/agentguard