2023年9月18日星期一

minikube basic

Reference: https://minikube.sigs.k8s.io/docs/handbook/controls/

 Start a cluster by running:

minikube start

Access the Kubernetes dashboard running within the minikube cluster:

minikube dashboard

Once started, you can interact with your cluster using kubectl, just like any other Kubernetes cluster. For instance, starting a server:

# create deployment
kubectl create deployment regex-minikube --image=registry.dev.mbpsmartec.co.jp/regexgo:v4
# expose a service as a NodePort
kubectl expose deployment regex-minikube --type=NodePort --port=8080

minikube makes it easy to open this exposed endpoint in your browser:

minikube service regex-minikube

Upgrade your cluster:

minikube start --kubernetes-version=latest

Start a second local cluster
(note: This will not work if minikube is using the bare-metal/none driver):

minikube start -p cluster2

Deploying apps

kubectl create deployment hello-minikube1 --image=kicbase/echo-server:1.0 kubectl expose deployment hello-minikube1 --type=LoadBalancer --port=8080
kubectl expose deployment hello-minikube1 --type=NodePort --port=8080

$ kubectl get svc
NAME              TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)          AGE
hello-minikube1   NodePort    10.100.238.34   <none>        8080:31389/TCP   3s

$ minikube service hello-minikube1 --url

Addons (Istio or Ingress) 
built-in list of applications and services minikube addons list
minikube addons enable <name> #enable an addon at start-up, where –addons option can be specified multiple times:
minikube start --addons <name1> --addons <name2>

Stop your local cluster:

minikube stop

Delete your local cluster:

minikube delete
#Delete all local clusters and profiles
minikube delete --all

没有评论: