![](/img/trans.png)
[英]I did changes on the pod in k8s how can I export the pod and apply to deployment
[英]how can i use RestApi to update deployment in k8s?
我想使用 RestApi 来更新部署。 我用邮递员测试它,但总是得到 415 回来。
信息如下:
类型:补丁
网址: https://k8sClusterUrl:6443/apis/extensions/v1beta1/namespaces/ns/deployments/peer0
标题:
Authorization: bearer token
Content-Type:application/json
身体:
{
"kind": "Deployment",
"spec":
{
"template":
{
"spec":
{
"containers":[
{
"$setElementOrder/volumeMounts":[{"mountPath":"/host/var/run/"},{"mountPath":"/mnt"}],
"name":"peer0",
"image":"hyperledger/fabric-peer:x86_64-1.1.0"}
]
}
}
}
}
回复:
{
"kind": "Status",
"apiVersion": "v1",
"metadata": {},
"status": "Failure",
"message": "the server responded with the status code 415 but did not return more information",
"details": {},
"code": 415
}
我在这个 pod 中有多个容器,并且只想申请特定的容器: peer0
。
$setElementOrder
var 有什么不同吗?
您可以尝试使用 body 和使用 Content-Type 到 application/json-patch+json,方法 PATCH:
[{
"op" : "replace",
"path" : "/spec/template/spec/container/0/$setElementOrder/volumeMounts",
"value" : "<value you want to replace>"
}]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.