我创建了一个资源:
kubectl create -f example.yaml
如何使用kubectl编辑此资源?据说kubectl edit
,但我不确定资源名称,kubectl edit example
返回错误:
the server doesn't have a resource type "example"
答案 0 :(得分:6)
您可以<div id="img-esadvalence" class="all-img-menu"></div>
直接编辑它。不过我建议在本地编辑文件并执行0803 13:41:12.052456 3772 solver.cpp:237] Train net output #2:
loss = 1.82591 (* 1 = 1.82591 loss)
I0803 13:41:12.052477 3772 sgd_solver.cpp:105] Iteration 120, lr =
9.92e -05
F0803 13:41:18.020836 3779 data_transformer.cpp:168] Check failed:
height <= datum_height (227 vs. 224)
*** Check failure stack trace: ***
@ 0x7f8f7b14adaa (unknown)
@ 0x7f8f7b14ace4 (unknown)
@ 0x7f8f7b14a6e6 (unknown)
@ 0x7f8f7b14d687 (unknown)
@ 0x7f8f7b7ba9e0 caffe::DataTransformer<>::Transform()
@ 0x7f8f7b835a2f caffe::DataLayer<>::load_batch()
@ 0x7f8f7b8c6a5c
caffe::BasePrefetchingDataLayer<>::InternalThreadEntry()
@ 0x7f8f7b79aa30 caffe::InternalThread::entry()
@ 0x7f8f7b79b376 boost::detail::thread_data<>::run()
@ 0x7f8f7172aa4a (unknown)
@ 0x7f8f6bd73184 start_thread
@ 0x7f8f79a7dffd (unknown)
@ (nil) (unknown)
Aborted (core dumped)
,以便在Kubernetes上更新。
另外:您的命令失败,因为您必须指定资源类型。示例类型包括kubectl edit -f example.yaml
,kubectl apply -f example.yaml
,pod
等。您可以使用普通service
查看所有可能的类型。该类型应与YAML文件中的deployment
值匹配,且名称应与kubectl get
匹配。
例如,可以使用kind
metadata.name