← All extensions

Kubernetes Snippets

v0.0.1 · by Rajeev Rajeshuni · added 3 November 2026

Kubernetes YAML snippets with zero-config schema validation.

Snippets

How to install

With Forge Super installed, the button above opens the app on this extension, where you press Install. Nothing is installed until you do.

You can also open the Extensions panel in the app and search for Kubernetes Snippets. The extension's id is kubernetes-snippets.

Don't have Forge Super yet? Download it here.

README

From the extension's repository, written by its authors and not by Mentenaz. See the source.

Kubernetes Snippets for Zed

The fastest way to author Kubernetes manifests in Zed. This extension provides intelligent, multi-cursor YAML snippets for common Kubernetes resources, with zero-config schema validation baked right in.

Features

  • Instant Boilerplate: Type a short prefix (like k8sdeploy), hit Tab, and generate complete, production-grade Kubernetes manifests instantly.
  • Smart Multi-Cursor: Tabstops are mirrored. Type your application name once, and it automatically populates metadata.name, matchLabels, pod template labels, and container name simultaneously.
  • Zero-Config Linting: Every snippet injects # yaml-language-server: $schema=kubernetes at the top. With Zed's built-in YAML language server you get real-time K8s schema validation, hover docs, and field autocomplete—scoped only to files that need it.
  • Production Defaults: Snippets include security contexts, resource limits, liveness/readiness/startup probes, pod anti-affinity, rolling update strategies, and other hardened defaults out of the box.

Usage

Open any .yaml or .yml file in Zed, type one of the prefixes below, and select it from the autocomplete menu (or hit Tab).

Snippets

Workloads

PrefixResourceHighlights
k8sdeployDeploymentRolling update strategy, all three probe types, pod anti-affinity, security context, resource limits
k8sstatefulsetStatefulSetHeadless service ref, volumeClaimTemplates, ordered rolling updates, downward API env vars
k8sdaemonsetDaemonSetNode-critical priority, control-plane tolerations, node-name env var
k8sjobJobcompletions, parallelism, backoffLimit, ttlSecondsAfterFinished
k8scronjobCronJobconcurrencyPolicy, timeZone, startingDeadlineSeconds, history limits

Services & Networking

PrefixResourceHighlights
k8ssvcClusterIP ServiceStandard internal service
k8ssvcnodeportNodePort ServiceexternalTrafficPolicy: Local
k8ssvclbLoadBalancer ServiceexternalTrafficPolicy: Local, source range allowlist
k8ssvcheadlessHeadless ServiceclusterIP: None, publishNotReadyAddresses for StatefulSets
k8singressIngress (NGINX + TLS)SSL redirect, proxy timeouts, body-size annotations
k8snetpolNetworkPolicyDefault-deny with DNS + HTTPS egress allowlist

Config & Storage

PrefixResourceHighlights
k8sconfigmapConfigMapKey-value and multi-line file examples
k8ssecretSecret (Opaque)stringData — no base64 required
k8ssecretregistrySecret (docker-registry)Image pull secret
k8spvPersistentVolumehostPath with reclaim policy
k8spvcPersistentVolumeClaimStorageClass binding, access modes
k8sstorageclassStorageClassProvisioner, reclaim policy, volume binding mode

RBAC

PrefixResourceHighlights
k8sserviceaccountServiceAccountautomountServiceAccountToken: false
k8sroleRoleCore API + apps group rules
k8srolebindingRoleBindingBound to ServiceAccount subject
k8sclusterroleClusterRoleIncludes nonResourceURLs for /metrics, /healthz
k8sclusterrolebindingClusterRoleBindingBound to ServiceAccount subject

Autoscaling & Policy

PrefixResourceHighlights
k8shpaHorizontalPodAutoscaler (v2)CPU + memory metrics, scaleDown stabilization window
k8spdbPodDisruptionBudgetunhealthyPodEvictionPolicy: AlwaysAllow
k8sresourcequotaResourceQuotaCPU, memory, pod, service, PVC limits
k8slimitrangeLimitRangeContainer + PVC types, maxLimitRequestRatio

Other

PrefixResourceHighlights
k8snamespaceNamespacemetadata.name label for NetworkPolicy selectors, team/env labels

Contributing

Pull requests are welcome! Candidates for future snippets:

  • k8svpa — VerticalPodAutoscaler
  • k8spodsecurity — PodSecurity admission labels on Namespace
  • CRDs: ArgoCD Application, Istio VirtualService / DestinationRule, cert-manager Certificate