ã¯ããã«
OpenShiftç°å¢ã§ãä¸åº¦ã«è¤æ°ã®ãªã½ã¼ã¹ãåé¤ãããã¨ãoc delete <ãªã½ã¼ã¹å>*
ã¨ã³ãã³ãå®è¡ããã¨ãããã¨ã©ã¼ã¨ãªãã¾ãããã¯ã¤ã«ãã«ã¼ããå©ç¨ã§ããªãããã§ããç°¡åãªãã¨ã§ããèªåã§ã¯èª¿ã¹ãã«ãChatGPTã使ã£ã¦æé ã確èªãããã¨ã«ãã¾ããã
ããã³ãã
Kubernetesã¾ãã¯OpenShiftã§ãè¤æ°ã®ãªã½ã¼ã¹ãã¾ã¨ãã¦åé¤ããããã®ã³ãã³ããæãã¦ãã ããã
åç
KubernetesãOpenShiftã§ãè¤æ°ã®ãªã½ã¼ã¹ãã¾ã¨ãã¦åé¤ããã«ã¯ã以ä¸ã®ã³ãã³ãã使ç¨ãã¾ããããã«ãããæå®ãããªã½ã¼ã¹ã¿ã¤ããã©ãã«ã«åºã¥ãã¦ãªã½ã¼ã¹ãåé¤ã§ãã¾ãã
1. ãªã½ã¼ã¹ã¿ã¤ããæå®ãã¦è¤æ°åé¤
åãã¿ã¤ãã®ãªã½ã¼ã¹ï¼ä¾: Pod ã Deploymentï¼ãä¸åº¦ã«åé¤ããå ´å:
kubectl delete pod <pod-name1> <pod-name2> <pod-name3> # Podãåå¥ã«æå®ãã¦åé¤ kubectl delete deployment <deployment-name1> <deployment-name2> # Deploymentãåå¥ã«æå®ãã¦åé¤
2. ãã¡ã¤ã«ã§ã¾ã¨ãã¦ãªã½ã¼ã¹ãåé¤
ãªã½ã¼ã¹å®ç¾©ãæ¸ãããYAMLãã¡ã¤ã«ããã£ã¬ã¯ããªã使ã£ã¦åé¤ããå ´å:
kubectl delete -f <path-to-yaml-file> # åä¸ã®YAMLãã¡ã¤ã«ããåé¤ kubectl delete -f <directory-path> # è¤æ°ã®YAMLãã¡ã¤ã«ãå ¥ã£ããã£ã¬ã¯ããªãæå®
3. ã©ãã«ã使ã£ã¦åé¤
ç¹å®ã®ã©ãã«ãä»ä¸ããããªã½ã¼ã¹ãã¾ã¨ãã¦åé¤ããæ¹æ³:
kubectl delete pod -l app=<label-value> # æå®ããã©ãã«ã«åºã¥ãã¦Podãåé¤ kubectl delete all -l app=<label-value> # æå®ããã©ãã«ã«åºã¥ãã¦å ¨ãªã½ã¼ã¹ãåé¤ï¼Pod, Deployment, Serviceãªã©ï¼
4. OpenShiftç¨ã®
oc
ã³ãã³ãOpenShiftã§ã¯
kubectl
ã®ä»£ããã«oc
ã³ãã³ãã使ç¨ãã¾ãããåºæ¬çãªæä½ã¯åãã§ã:oc delete pod <pod-name1> <pod-name2> # Podãåå¥ã«åé¤ oc delete all -l app=<label-value> # ã©ãã«ã«åºã¥ãã¦å ¨ãªã½ã¼ã¹ãåé¤
kubectl
ã¨oc
ã¯ã»ã¼åãã¤ã³ã¿ã¼ãã§ã¼ã¹ãæä¾ãã¦ãããããKubernetesã®ã³ãã³ãã¯ãã®ã¾ã¾OpenShiftã§ã使ç¨ã§ãã¾ãã
ãã£ã¦ã¿ãææ³
- ã1. ãªã½ã¼ã¹ã¿ã¤ããæå®ãã¦è¤æ°åé¤ããã2. ãã¡ã¤ã«ã§ã¾ã¨ãã¦ãªã½ã¼ã¹ãåé¤ãã¯ç¥ã£ã¦ããæ¹æ³ã§ããã
- ç§ãæ¶ããããªã½ã¼ã¹ã®æ°ã¯ãããããã£ãã®ã§ãã1. ãªã½ã¼ã¹ã¿ã¤ããæå®ãã¦è¤æ°åé¤ãã使ãã®ã¯é£ããã¨æãã¾ããã
kubectl delete pod -l app=<label-value> # æå®ããã©ãã«ã«åºã¥ãã¦Podãåé¤
ã¨ããæ¹æ³ã¯ãããæ¹æ³ã ã¨æãã¾ããã- èªåã§ã¯æãã¤ãã¾ããã§ãããç®ãããããã§ãã
- å®éã«ãã®æ¹æ³ã§ãç§ãæ¶ããããªã½ã¼ã¹ãä¸åº¦ã«æ¶ããã¨ãã§ãã¾ããã