安裝minikube過程


參考https://my.oschina.net/u/228832/blog/3079150

https://www.jianshu.com/p/c8bb49edf466

以下是記錄安裝minikube過程


安裝docker

curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun


查詢kubectl版本號

https://storage.googleapis.com/kubernetes-release/release/stable.txt

下載kubectl

wget "https://storage.googleapis.com/kubernetes-release/release/v1.15.1/bin/linux/amd64/kubectl" -O "/usr/local/bin/kubectl"

chmod +x /usr/local/bin/kubectl

阿里雲發佈的minikube地址

https://github.com/AliyunContainerService/minikube

下載minikube

curl -Lo minikube http://kubernetes.oss-cn-hangzhou.aliyuncs.com/minikube/releases/v1.2.0/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/

啓動minikube

minikube start --vm-driver=none --registry-mirror=https://registry.docker-cn.com

驗證

kubectl run hello-minikube --image=k8s.gcr.io/echoserver:1.4 --port=8080

kubectl get node

kubectl get pod

kubectl get deployment

kubectl get ingress

kubectl get rc

kubectl get endpoints

kubectl get componentstatuses

kubectl get pods


下載鏡像

docker pull  gcr.io/google_containers/kubernetes-dashboard-amd64:v1.5.1

啓動dashboard

nohup minikube dashboard &

配置代理

nohup kubectl proxy --port 9009 --address='172.27.14.222' --accept-hosts='^.*'&

訪問管理頁面

http://172.27.14.222:9009/api/v1/namespaces/kube-system/services/http:kubernetes-dashboard:/proxy/#!/overview?namespace=default


發佈應用

kubectl run first-deployment --image=katacoda/docker-http-server --port=80


發佈服務

kubectl expose deployment/tomcat --type=NodePort --port 8080

擴容

 kubectl scale deployments/docker-demo --replicas=3

獲取url

minikube service tomcat --url

http://172.27.14.222:30590


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章