I have a k3s cluster with kube-system
pods and my application's (xyz-system
namespace) pods:
kube-system pod/calico-node-xxxx
kube-system pod/calico-kube-controllers-xxxxxx
kube-system pod/metrics-server-xxxxx
kube-system pod/local-path-provisioner-xxxxx
kube-system pod/coredns-xxxxx
xyz-system pod/my-app
xyz-system pod/my-app-mqtt
I want to reset/restart all of these pods (kube-system + xyz-system) in one command (or it can be two commands for two namespace but without deployment name) without giving deployment names because in future I can have more deployments created, so it will be difficult to provide many deployment names manually.
Debugging:
With command kubectl -n kube-system rollout restart daemonsets,deployments
as mentioned in link I am able to restart the kube-system
pods. But when I modify this command with xyz-namespace
: kubectl -n xyz-system rollout restart deployments
the respective pods are not restarting when I monitor watch kubectl get all -A
they remain as it is in Running state.
Can someone let me know how to achieve this ?
In two commands:
In "one":
Or:
Though I second @jonas comment: sounds like a weird question, with no real-life use cases that I know of.