0%

minikube on Windows 10

安裝

開始部屬APP (deployment)

1
2
3
4
kubectl.exe run mynginx --image=nginx --port=80
kubectl.exe get pods
kubectl get node -o wide
kubectl.exe get deployments

發布APP (services)

1
2
kubectl.exe expose deployment mynginx --type="NodePort"
kubectl.exe get services

測試存取APP

  • kubectl.exe get services

    1
    2
    3
    NAME         TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)        AGE
    kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 54m
    mynginx NodePort 10.100.18.218 <none> 80:30213/TCP 7m
  • 看 k8s Master 的 IP 為何

    1
    minikube service mynginx --url
  • curl http://192.168.99.100:30213

探索APP

  • list pods 詳細資訊

    1
    kubectl.exe  describe pods
  • 依上述所列的Name即是pod的名稱,看 pod 裡 log 相關資訊

    1
    kubectl.exe  logs pod-Name
  • 到 pods container 執行命令列

    1
    kubectl.exe exec -it pod-Name bash
  • 刪除 pods , servies

    1
    kubectl.exe  delete  deployment mynginx
    1
    kubectl.exe  delete service mynginx

參考資料

歡迎關注我的其它發布渠道