kubectl patch
Jump to navigation
Jump to search
Update field(s) of a resource using strategic merge patch.
kubectl patch --help -p, --patch=:
The patch to be applied to the resource JSON file.
kubectl patch svc argocd-server -n argocd -p '{"spec": {"type": "LoadBalancer"}}'
kubectl patch pv
kubectl patch pvc
kubectl patch sts elastic-operator
kubectl patch cronjobs
kubectl patch provisioner
kubectl patch ValidatingWebhookConfiguration
Stop DaemonSet by appliying a nodeSelector
kubectl patch daemonset <name-of-daemon-set> -p '{"spec": {"template": {"spec": {"nodeSelector": {"non-existing": "true"}}}}}'
Start DaemonSet by removing the nodeSelector :
kubectl patch daemonset <name-of-daemon-set> --type json -p='[{"op": "remove", "path": "/spec/template/spec/nodeSelector/non-existing"}]'
kubectl get ds -A
kubectl patch --type=json -p='[{"op": "remove", "path": "metadata.creationTimestamp"}]'
kubectl patch configmap coredns -n kube-system --type=merge -p
Related
UnsuportedMediaTypeUnsupported Media TypeThe request is invalid: the server rejected our request due to an error in our requestsed- kubectl set env
See also
kubectl patch [ cronjobs | svc | pv | pvc | sts | service | secret | sts elastic-operator | node | daemonset | serviceaccount | application | --help ]
Advertising: