小编wor*_*dcc的帖子

命令"kubectl get pod $ yourpod"输出"READY = 2/2"的含义是什么

kubectl get pod run-sh-1816639685-xejyk 
NAME                      READY     STATUS    RESTARTS   AGE
run-sh-1816639685-xejyk   2/2       Running   0          26m
Run Code Online (Sandbox Code Playgroud)

"READY = 2/2"是什么意思?与"1/1"相同?

kubernetes kubectl kubelet

18
推荐指数
1
解决办法
6025
查看次数

如何删除kubernetes pod的标签

我想通过kubernetes API从我的kubernetes版本:1.24从节点或吊舱中删除标签

kubectl get pod --show-labels | grep all-flow-0fbah
all-flow-0fbah      1/1     Running   2        9d      app=all-flow,op=vps1,version=1001
Run Code Online (Sandbox Code Playgroud)

我使用如下命令:

 curl --request PATCH --header "Content-Type:application/json-patch+json" http://10.93.78.11:8080/api/v1/namespaces/default/pods/all-flow-0fbah --data '{"metadata":{"labels":{"a":"b"}}}'
Run Code Online (Sandbox Code Playgroud)

但这是行不通的。返回消息如下:

{
  "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
}
Run Code Online (Sandbox Code Playgroud)

然后我像这样更改curl标头:

curl --request PATCH --header "Content-Type:application/merge-patch+json" http://10.93.78.11:8080/api/v1/namespaces/default/pods/all-flow-0fbah --data '{"meadata":{"labels":{"op":"vps3"}}}'
Run Code Online (Sandbox Code Playgroud)

它不会删除标签,但会向该窗格添加新标签。那么有没有人可以告诉我如何删除pod的标签,例如use命令:

kubectl label pod all-flow-0fbah key-
Run Code Online (Sandbox Code Playgroud)

谢谢!

docker kubernetes

3
推荐指数
5
解决办法
5431
查看次数

exec `curl --unix-socket /var/run/docker.sock http:/containers/json` 时出现“404 页面未找到”

docker version: 1.11.2
curl version: 7.50.3 (x86_64-pc-linux-gnu) libcurl/7.50.3 OpenSSL/1.0.1e zlib/1.2.7
Run Code Online (Sandbox Code Playgroud)
/usr/local/sbin/bin/curl  --unix-socket /var/run/docker.sock http://images/json -v
*   Trying /var/run/docker.sock...
* Connected to images (/var/run/docker.sock) port 80 (#0)
> GET /json HTTP/1.1
> Host: images
> User-Agent: curl/7.50.3
> Accept: */*
> 
< HTTP/1.1 404 Not Found
< Content-Type: text/plain; charset=utf-8
< X-Content-Type-Options: nosniff
< Date: Thu, 22 Sep 2016 06:11:52 GMT
< Content-Length: 19
< 
404 page not found
* Curl_http_done: called premature == 0
* Connection #0 to host images …
Run Code Online (Sandbox Code Playgroud)

docker docker-api

3
推荐指数
1
解决办法
1964
查看次数

标签 统计

docker ×2

kubernetes ×2

docker-api ×1

kubectl ×1

kubelet ×1