Tushar Banne
Tushar Banne

Reputation: 1725

Not able to create a file using kubectl

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.

Upvotes: 2

Views: 6235

Answers (2)

sfgroups
sfgroups

Reputation: 19119

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 apply -f https://k8s.io/examples/controllers/nginx-deployment.yaml

Upvotes: 2

im_infamous
im_infamous

Reputation: 1062

Somehow the filename was corrupted with unseen symbol so this helped me to get over wrong naming

mv postgres-configmap.yaml\  postgres-configmap.yaml

and then it worked:

kubectl create -f postgres-configmap.yaml
configmap/postgres-config created

Upvotes: 0

Related Questions