天天看點

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

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

結果: deployment.apps/nginx-app created

使用指令行kubectl get pods檢視建立結果,狀态已經為running:

使用指令行kubectl describe pods檢視pod明細:

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

使用該pod id可以執行一些指令:

kubectl exec nginx-app-f75d46bd9-q6c76 ps aux

kubectl describe pod nginx-app-f75d46bd9-q6c76

kubectl logs nginx-app-f75d46bd9-q6c76

繼續閱讀