当前位置:网站首页>Several ways to restart kubernetes pod

Several ways to restart kubernetes pod

2022-06-12 09:02:00 Commander in chief (commander in chief)

Preface

In the use of docker In the process of , We can use docker restart {container_id} To restart the container , But in kubernetes There is no restart command in ( No, kubectl restart {podname}

Method 1

There's the latest yaml file .

There is yaml File can be used directly kubectl replace --force -f xxxx.yaml To force replacement Pod Of API object , So as to achieve the purpose of restart .

Method 2

No, yaml file , But here's the thing Deployment object .

kubectl scale deployment esb-admin --replicas=0 -n { 
    namespace}
kubectl scale deployment esb-admin --replicas=1 -n { 
    namespace}

because Deployment Objects are not directly manipulated Pod object , It's controlled Rep

原网站

版权声明
本文为[Commander in chief (commander in chief)]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/163/202206120857337013.html