Articles → DOCKER → Dry Run Option In Kubectl
Dry Run Option In Kubectl
Purpose
Prerequisites
Scenario
kubectl run [pod_name] --image=nginx --dry-run=client -o yaml
Creating The YAML File
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: null
labels:
run: pod2
name: pod2
spec:
containers:
- image: nginx
name: pod2
resources: {}
dnsPolicy: ClusterFirst
restartPolicy: Always
status: {}
Kubectl Apply Command
kubectl apply -f [YAML_file]