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
• 5,520 points
199 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
• 52,720 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,280 points
691 views
0 votes
1 answer
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
• 52,720 points
813 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
• 52,720 points
693 views
0 votes
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
6,476 views
+4 votes
1 answer

Installing Web UI (Dashboard):kubernetes-dashboard on main Ubuntu 16.04.6 LTS (Xenial Xerus) server

Follow these steps: $ kubeadm reset $ kubeadm init ...READ MORE

answered Apr 11, 2019 in Kubernetes by Kalgi
• 51,850 points

reshown Apr 12, 2019 by Kalgi 1,925 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
• 52,720 points
374 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
• 52,720 points
323 views