how to test a manifest without actually executing it in kubernetes

0 votes
I need to test a manifest in order to check the key-value pairs, i need to test it without actually executing it. How can i do this?
Jul 18, 2019 in Kubernetes by Sam
• 6,260 points
4,232 views

1 answer to this question.

0 votes

You can use --dry-run flag to test the manifest. 

This is really useful not only to ensure if the yaml syntax is right for a particular Kubernetes object but also to ensure that a spec has required key-value pairs.

kubectl create -f <test.yaml> --dry-run

Let us now look at an example Pod spec that will launch an nginx pod
 

 cat example_pod.yaml
---
apiVersion: v1
kind: Pod
metadata:
  name: my-nginx
  namespace: mynamespace
spec:
  containers:
    - name: my-nginx
      image: nginx

kubectl create -f example_pod.yaml --dry-run
pod/my-nginx created (dry run)
answered Jul 18, 2019 by Sirajul
• 59,230 points

Related Questions In Kubernetes

0 votes
1 answer

How to use gravitational teleport in a container/kubernetes environment?

You can use teleport to augment kubernetes ...READ MORE

answered Jun 28, 2018 in Kubernetes by ajs3033
• 7,300 points
2,498 views
0 votes
1 answer

how to scale a statefulset in kubernetes?

Scaling StatefulSets : Use kubectl to scale StatefulSets First, ...READ MORE

answered Jul 23, 2019 in Kubernetes by Sirajul
• 59,230 points
7,313 views
+1 vote
1 answer

How to use a Volume to communicate between two Containers running in the same Kubernetes-Pod?

Create a Pod that runs two Containers Create a ...READ MORE

answered Jul 23, 2019 in Kubernetes by Sirajul
• 59,230 points
2,604 views
+1 vote
1 answer
0 votes
3 answers

Error while joining cluster with node

Hi Kalgi after following above steps it ...READ MORE

answered Jan 17, 2019 in Others by anonymous
15,579 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,064 views
0 votes
1 answer

How to build a high availability cluster in Kubernetes?

Add nodes in a HA cluster in ...READ MORE

answered Jul 12, 2019 in Kubernetes by Sirajul
• 59,230 points
1,246 views
+1 vote
1 answer

How to deploy a feature with zero downtime in kubernetes?

By default Deployment in Kubernetes uses RollingUpdate as a ...READ MORE

answered Jul 18, 2019 in Kubernetes by Sirajul
• 59,230 points
1,030 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP