minikube
minikube copied to clipboard
Can we use two minikube profiles at the same time?
What Happened?
Can we use two minikube profiles at the same time? instead of switching the profiles, is there any feasibility or possibility to run and deploy for two profiles at time.
Attach the log file
Can we use two minikube profiles at the same time? instead of switching the profiles, is there any feasibility or possibility to run and deploy for two profiles at time.
Operating System
None
Driver
None
Each profile is a cluster (and context), so you are looking for some kind of multi-cluster solution it sounds like ?
Here there is a script that create 2 clusters. They share a DNS server(BIND. https://github.com/rogeriomm/minikube-labtools-k8s/blob/master/install/scripts/bind/named.conf.local) on host, so both clusters can resolve names each other and can be interconnected(TCP/IP & DNS)
https://github.com/rogeriomm/minikube-labtools-k8s
Here is a tool that manages multiple minikube profiles: https://github.com/RamenDR/ramen/tree/main/test
It is part of the Ramen project since we need to manage multiple interconnected clusters for testing disaster recovery, but the tool is really generic and can be used elsewhere.
I need to simulate two indepenent clusters(imagine like two completely indepent customers) that can only talk to each other through public internet and I also want to deploy to each of those clusters in parallel instead of deploying to one and then switching profile and then deploying another. so mini kube multinode solution doesnt do that.
should I just install minukube inside a docker container? that way I can spin up two containers which have their own minukube and kubectl?
@kant777 minikube can create 2 independent clusters out of the box.
Try this:
minikube start -p c1 &
minikube start -p c2 &
wait
minikube profile list
kubectl get deploy -A --context c1
kubectl get deploy -A --context c2
@nirs that works!!
can close this issue!
@nirs How can a pod in one profile can talk to another pod in another profile?
In the same way users in different clusters access other clusters. For example if a pod on one cluster can be exposed via a service on the public cluster ip, and pod another cluster can access the other public service.
There are some examples here: https://minikube.sigs.k8s.io/docs/handbook/accessing/
@nirs Thanks again for that. I was more trying to understand how that routing would work when I have two minikube ips (one for each profile). Imagine I have pod A in profile A(cluster A) and pod B in profile B(cluster B). podA calls the dns of podB it will first go to kube-dns of cluster A and it will be a miss then it goes to host DNS which should be able to forward to kubedns in cluster B and get it resolved. is that accurate?
The Kubernetes project currently lacks enough contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
- After 90d of inactivity,
lifecycle/stale
is applied - After 30d of inactivity since
lifecycle/stale
was applied,lifecycle/rotten
is applied - After 30d of inactivity since
lifecycle/rotten
was applied, the issue is closed
You can:
- Mark this issue as fresh with
/remove-lifecycle stale
- Close this issue with
/close
- Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
As per above comments , we can use two minikube profiles at the same time by following below:
minikube can create 2 independent clusters out of the box.
Try this:
minikube start -p c1 & minikube start -p c2 & wait minikube profile list kubectl get deploy -A --context c1 kubectl get deploy -A --context c2