A client dry run makes kubectl render an object definition locally without creating the object through the Kubernetes API. It is useful for starting a manifest that you can inspect and edit before applying it. section 5.2.1 section 15.1.1
Generate a Pod manifest
kubectl run kiada --image=luksa/kiada:0.1 --dry-run=client -o yaml > mypod.yaml The command writes YAML to mypod.yaml instead of creating the Pod. You can then inspect or edit the manifest before using it. section 5.2.1
Generate a Deployment manifest
kubectl create deployment my-app --image=my-image \ --dry-run=client -o yaml > deploy.yaml The resulting file is a rough Deployment manifest that can be modified with fields such as containers, volumes, or other configuration before creation. section 15.1.1
Listing 5.1 A basic pod manifest file
apiVersion: v1 #1
kind: Pod #2
metadata:
name: kiada #3
spec:
containers:
- name: kiada #4
image: luksa/kiada:0.1 #5
ports:
- containerPort: 8080 #6
Inspect a basic Pod manifest produced for a client-side dry run, including its API version, kind, metadata, container image, and port. section 5.2.1
