如何在Kubernetes裏建立一個Nginx應用

使用命令行kubectl run --image=nginx nginx-app --port=80 建立一個名爲nginx-app的應用nginx

結果: deployment.apps/nginx-app createdapp

使用命令行kubectl get pods查看建立結果,狀態已經爲running:spa

使用命令行kubectl describe pods查看pod明細:命令行

把pod id記下來: nginx-app-f75d46bd9-q6c76rem

使用該pod id能夠執行一些命令:get

  • kubectl exec nginx-app-f75d46bd9-q6c76 ps aux
  • kubectl describe pod nginx-app-f75d46bd9-q6c76
  • kubectl logs nginx-app-f75d46bd9-q6c76

要獲取更多Jerry的原創文章,請關注公衆號"汪子熙":it

相關文章
相關標籤/搜索