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




Picture showing the dry-run while creating the pod



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]


Picture showing the output of kubectl apply command




Picture showing the pod generated in Kubernetes





Posted By  -  Karan Gupta
 
Posted On  -  Sunday, January 28, 2024

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250