无法使用kubectl创建文件 [英] Not able to create a file using kubectl
问题描述
我最近开始研究微服务.我正在构建我的Docker映像并将其部署在kubernetes上.创建pod.yaml文件时,我开始出现以下错误.
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.
命令:
kubectl create -f podservice.yaml
错误:
error: the path "podcpeservice.yml" does not exist
尝试使用helpfor kubectl create -f帮助.帮助文档中的一个示例是
Tried using the helpfor kubectl create -f help. An example in the help document is
命令:
kubectl create -f ./pod.json
即使上面的命令也给出相同的错误.无法找出问题所在.尝试删除./
Even the above command gives the same error. Not able to figure out what is the problem. tried removing ./
我正在以Windows 7为主机的虚拟机上使用centos 7.
I am using centos 7 on virtual-box with windows 7 as host.
推荐答案
Tushar,
首先,您需要使用其中一个编辑器创建部署yml文件,然后将该文件作为kubectl命令的参数传递.
First you need to create the deployment yml file using one of the editor, then pass the file as argument for kubectl command.
例如
kubernets团队已经创建了此部署文件.您使用kubectl进行部署.
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
这篇关于无法使用kubectl创建文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!