-
Notifications
You must be signed in to change notification settings - Fork 6
/
minikube-tips.txt
38 lines (25 loc) · 1.11 KB
/
minikube-tips.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#install minikube
brew install minikube
#or
brew update
brew upgrade minikube
#deploy a k8s cluster with 4 cpu , 8gigs of memory , 20 gigs of storage and log startup to console
minikube -p clustername start --cpus=4 --memory=8192 --disk-size 20GB --alsologtostderr -v=7
# deploy dashboard for a neat UI to see everything in your cluster
minikube dashboard -p clustername
#deploy metrics-server required by k8s to measure performance
minikube addons -p clustername metrics-server
# to view resource utilization in the cluster
kubectl top pod --all-namespaces | sort --reverse --key 3 --numeric
#to check what cluster you are working with
kubectl config get-contexts
# create resources from a yaml spec
kubectl create -f common.yaml
# get all pods in the cluster ( all -namespaces )
kubectl get pods -A
# get a shell inside a pod inside the cluster ( get the pod name using kubectl get pods -A )
kubectl exec -it podnamehere /bin/bash
# expose a service to your host system instantly for testing ( like kibana / web apps ? )
kubectl portforward svc/name-of-service port:port
# to stop the cluster
minikube -p clustername stop