Not able to create a file using kubectl

7/12/2017

I recently started working on microservices. I am building my docker image and want to deploy it on kubernetes. while creating a pod.yaml file I started getting the below error.

Command :

kubectl create -f podservice.yaml

Error :

error: the path "podcpeservice.yml" does not exist

Tried using the helpfor kubectl create -f help. An example in the help document is

command :

kubectl create -f ./pod.json

Even the above command gives the same error. Not able to figure out what is the problem. tried removing ./

I am using centos 7 on virtual-box with windows 7 as host.

-- Tushar Banne
kubernetes

1 Answer

7/12/2017

Tushar,

First you need to create the deployment yml file using one of the editor, then pass the file as argument for kubectl command.

eg.

kubernets team already created this deployment file. you use kubectl to deploy.

kubectl create -f https://k8s.io/docs/tasks/debug-application-cluster/shell-demo.yaml
-- sfgroups
Source: StackOverflow