kubectl patch deployment valid-deployment--type json-p='[{"op": "remove", "path": "/spec/template/spec/containers/0/livenessProbe"}]' # 在带位置数组中添加元素 kubectl patch sa default--type='json'-p='[{"op": "add", "path": "/secrets/1", "value": {"name": "whatever" ...
$ kubectl create -f ./my-manifest.yaml# 创建资源 $ kubectl create -f ./my1.yaml -f ./my2.yaml# 使用多个文件创建资源 $ kubectl create -f ./dir# 使用目录下的所有清单文件来创建资源 $ kubectl create -f https://git.io/vPieo# 使用 url 来创建资源 $ kubectl run nginx --image=nginx#...
# 创建资源$ kubectl create -f ./my-manifest.yaml# 使用多个文件创建资源$ kubectl create -f ./my1.yaml -f ./my2.yaml# 使用目录下的所有清单文件来创建资源$ kubectl create -f ./dir# 使用 url 来创建资源$ kubectl create -f https://git...
yaml # 创建资源 $ kubectl create -f ./my1.yaml -f ./my2.yaml # 使用多个文件创建资源 $ kubectl create -f ./dir # 使用目录下的所有清单文件来创建资源 $ kubectl create -f https://git.io/vPieo # 使用 url 来创建资源 $ kubectl run nginx --image=nginx # 启动一个 nginx 实例 $ kube...
$ kubectl patch deployment valid-deployment --type json -p='[{"op": "remove", "path": "/spec/template/spec/containers/0/livenessProbe"}]' 1. 2. 3. 4. 5. 6. 7. 8. 编辑资源 在编辑器中编辑任何 API 资源。 # 编辑名为 docker-registry 的 service ...
kubectl patch deployment valid-deployment --type json -p='[{"op": "remove", "path": "/spec/template/spec/containers/0/livenessProbe"}]' # 在带位置数组中添加元素 kubectl patch sa default --type='json' -p='[{"op": "add", "path": "/secrets/1", "value": {"name": "whatever"...
{"op": "replace", "path": "/spec/containers/0/image", "value":"new image"}]'# 使用具有位置数组的 json 补丁禁用 deployment 的 livenessProbe$ kubectl patch deployment valid-deployment --type json -p='[{"op": "remove", "path": "/spec/template/spec/containers/0/livenessProbe"}...
remove-forward-port= --get-services --remove-icmp-block= --get-short --remove-icmp-block-inversion --get-zone-of-interface= --remove-interface= --get-zones --remove-lockdown-whitelist-command= --help --remove-lockdown-whitelist-context= --info-helper= --remove-lockdown-whitelist-uid= ...
kubectl create -f FILENAME [options] 选项如下: Options:--allow-missing-template-keys=true: If true, ignore any errors in templates when a field or map key is missing inthe template. Only applies to golang and jsonpath output formats.--dry-run=false: If true, only print the object that...
{"op":"remove", "path":"/spec/template/spec/containers/0/command"}]' ## 替换 command 参数 kubectl patch deployment <deployment-name> --type json -p \ '[{"op":"replace", "path":"/spec/template/spec/containers/0/command", "value":["sh","-c","sleep 3600"]}]' kubectl patch ...