EKS 上版本到 de2 的 kubectl delete 說明 === ## docker image ``` vim ~/.bashrc ``` 修改 VERSION 與 TAG 的版本號,例如:1.0.0.7-preview 然後重新開機 讓設定更新 ``` kubectl get po ``` ![](https://i.imgur.com/xlXNPhJ.png) ``` kubectl delete po de2-58f446544-mzh2r ``` 刪除 `de2-58f446544-mzh2r` 的 de2 自己產生一個新的 po id ``` kubectl delete po -l app=de2 ``` 這個是 kevin 給的指令,同上作用,直接指定 de2 就好,不必記 po id ![](https://i.imgur.com/EFSVM5V.png) * 據 pony 與 kevin 的說法 新生成的 po id 是原本之前存在 ECR 的 image 如果想同一個 VERSION 版本 但是 image 內的程式碼不一同 可以在 ECR 上砍掉目前的 image 在上傳新的 image 上去 在用下面的指令 ``` envsubst < de2.yaml | kubectl apply -f - ``` 開啟新的 image 在 EKS 上執行 ![](https://i.imgur.com/JZprPBC.png) 想要完全刪除的話,輸入下面的指令 ``` envsubst < de2.yaml | kubectl delete -f - ``` ![](https://i.imgur.com/d8nOaWq.png) 會出現 delete 再輸入一次 ``` envsubst < de2.yaml | kubectl apply -f - ``` ![](https://i.imgur.com/qIIFrb6.png) 會出現 create de2 也會出現在 `kubectl get po` 指令的 po list 裡 ## 參考資料 [看 EKS 上 de2 的 Console.WriteLine 的 log](https://hackmd.io/@sam-liaw/r1v2WENeL) [強制 git pull 覆蓋本地檔案](https://hackmd.io/@sam-liaw/HJEr-NElL) [參考:Ubuntu 切換帳號](https://hackmd.io/@sam-liaw/rJPd8IggU) [EKS 參考文件](https://hackmd.io/@sam-liaw/Bkqcf6pAS) ###### tags: `EKS` `工作紀錄`