Kubernetes Service generator

Describe the Service on the left. Paste the workload it should reach on the right to see which pods it selects and which container port each targetPort lands on.

Schema pack 2026.10.0, self-authored. What it covers
Ports

Service YAML

Passes pack schema1 warning(s)Kubernetes 1.31, pack 2026.10.0

Service/web selector app.kubernetes.io/name=web matches no pod template in namespace shop among the supplied documents.

apiVersion: v1
kind: Service
metadata:
  name: web
  namespace: shop
spec:
  type: ClusterIP
  selector:
    app.kubernetes.io/name: web
  ports:
    - name: http
      port: 80
      targetPort: http
      protocol: TCP
    - name: metrics
      port: 9090
      targetPort: prometheus
      protocol: TCP

Target workload

Selector and targetPort mapping

SelectedDeployment/web (ns shop)

app.kubernetes.io/name=web ✓

80/TCPmaps → web:8080 via name "http"
9090/TCPno match named port "prometheus" not found in any container

Checked within the supplied workload only. Endpoints at runtime depend on pod readiness.

How targetPort resolves

A numeric targetPort sends traffic to that port on the pod, whether or not a containerPort declares it, because containerPort is informational. A named targetPort is looked up per pod among the container port names. If no container declares that name, the Service has no usable endpoint for that port.

Omitting targetPort means it equals port. A quoted number such as "8080" is a port name, not a number, and fails name validation.

Questions

When do Service ports need names?

When a Service has more than one port, every port must be named. Names must be lowercase DNS labels.

What does a headless Service do?

With clusterIP: None, DNS returns the pod IPs directly instead of a virtual IP. StatefulSets need one for stable per-pod DNS names.

Other tools

Manifest editorEdit multi-document Kubernetes YAML with per-document identity, duplicate detection, a relationship graph with an accessible table, and findings tied to source lines.YAML validatorValidate Kubernetes YAML against a versioned schema pack with separate YAML, schema, cross-object and policy findings.Deployment generatorGenerate a Deployment with Service, Ingress, PodDisruptionBudget and HPA: named ports, probes, requests and a hardened security context, validated as you type.Resource calculatorExact Kubernetes quantity parsing (100m vs 100Mi), unit conversion, and requests/limits totals that account for init containers, native sidecars, replicas, rollout surge and overhead.RBAC analyzerInspect Roles, ClusterRoles and bindings offline: subject-to-permission matrix, aggregated-role handling, risky verbs, and "can this subject do X" checks scoped to the supplied rules.NetworkPolicy explainerExplain which pods each NetworkPolicy isolates and test traffic scenarios between pods, namespaces and IPs with additive allow-list reasoning.Probe builderBuild liveness, readiness and startup probes and see their timing: when the first check runs, how long until a failure triggers action, and what that action is.Manifest diffCompare two Kubernetes bundles by text or by object: objects matched by identity, list items matched by name, and status or server fields ignored only when you choose.API deprecationsFind Kubernetes APIs removed or deprecated for your target version, using a dated pack, and preview field-aware migrations with the semantic changes you need to review.CronJob schedulePreview the next runs of a Kubernetes CronJob schedule in its spec.timeZone, explain concurrency and deadline settings, and catch TZ= in the schedule string.Secret encoderEncode and decode Kubernetes Secret values locally, build Secret YAML with data or stringData, and inspect an existing Secret with values masked by default.Redact exportFind Secret data, tokens, credential-bearing env values and last-applied annotations in Kubernetes YAML, review each one, and export a redacted copy.TemplatesSynthetic Kubernetes templates with safe defaults — web app, StatefulSet, CronJob, NetworkPolicy, RBAC, HPA, sidecar — each tested against the schema pack for every supported version.