curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
Start a cluster -
minikube start
Start second cluster -
minikube start -p cluster2
List all minikube cluster running:
minikube profile list
Set second cluster as current profile-
Kubectl:
Set kubectl alias to run kubectl commands for minikube if kubectl is not installed locally:
alias kubectl="minikube kubectl --"
View kubernetes config:
kubectl config view
To access minikube from windows command prompt -
Update kube config file as per config on WSL running minikube
apiVersion: v1
clusters:
- cluster:
certificate-authority: \\wsl.localhost\Ubuntu\home\gaugupta\.minikube\ca.crt
server: https://127.0.0.1:49159
name: cluster2
- cluster:
certificate-authority: \\wsl.localhost\Ubuntu\home\gaugupta\.minikube\ca.crt
server: https://127.0.0.1:49154
name: minikube
contexts:
- context:
cluster: cluster2
user: cluster2
name: cluster2
- context:
cluster: minikube
user: minikube
name: minikube
current-context: cluster2
kind: Config
preferences: {}
users:
- name: cluster2
user:
client-certificate: \\wsl.localhost\Ubuntu\home\gaugupta\.minikube\profiles\cluster2\client.crt
client-key: \\wsl.localhost\Ubuntu\home\gaugupta\.minikube\profiles\cluster2\client.key
- name: minikube
user:
client-certificate: \\wsl.localhost\Ubuntu\home\gaugupta\.minikube\profiles\minikube\client.crt
client-key: \\wsl.localhost\Ubuntu\home\gaugupta\.minikube\profiles\minikube\client.key
Then
>kubectl config use-context minikube
>kubectl get pods
No comments:
Post a Comment