Every Kubernetes object is a YAML document with the same four keys
Kubernetes manifests follow a strict shape: apiVersion, kind, metadata, spec. The cluster API server reads the manifest, validates it against the OpenAPI schema for that kind, and reconciles state. Every Deployment, Service, ConfigMap, Ingress, Job, CronJob — all the same four-key envelope.
The four-key envelope
apiVersion— which API group + version owns this object (e.g.,apps/v1for Deployment,v1for Service).kind— the resource type (Deployment,Service,ConfigMap, …).metadata— name, namespace, labels, annotations.spec— the desired state. Shape varies per kind.
Multi-document files for one logical service
A typical service ships as Deployment + Service + ConfigMap + (optional) Ingress, four documents in one file separated by ---. kubectl apply -f stack.yaml applies them all in one shot.
Principle: manifests are desired state, not commands. The cluster reconciles toward what you wrote. This is why YAML — declarative, idempotent — is the right format for Kubernetes; an imperative shell script would be the wrong shape.