Reputation: 675
For some specific use cases, I want to start Minikube with the --driver=none
option.
$ sudo minikube start --driver=none
๐ minikube v1.31.2 on Ubuntu 22.04
โจ Using the none driver based on user configuration
๐ Starting control plane node minikube in cluster minikube
๐คน Running on localhost (CPUs=12, Memory=64249MB, Disk=233348MB) ...
โน OS release is Ubuntu 22.04.3 LTS
๐ณ Preparing Kubernetes v1.27.4 on Docker 24.0.5 ...
โช kubelet.resolv-conf=/run/systemd/resolve/resolv.conf
โช Generating certificates and keys ...
โช Booting up control plane ...
โช Configuring RBAC rules ...
๐ Configuring bridge CNI (Container Networking Interface) ...
๐คน Configuring local host environment ...
โ The 'none' driver is designed for experts who need to integrate with an existing VM
๐ก Most users should use the newer 'docker' driver instead, which does not require root!
๐ For more information, see: https://minikube.sigs.k8s.io/docs/reference/drivers/none/
โ kubectl and minikube configuration will be stored in /root
โ To use kubectl or minikube commands as your own user, you may need to relocate them. For example, to overwrite your own settings, run:
โช sudo mv /root/.kube /root/.minikube $HOME
โช sudo chown -R $USER $HOME/.kube $HOME/.minikube
๐ก This can also be done automatically by setting the env var CHANGE_MINIKUBE_NONE_USER=true
๐ Verifying Kubernetes components...
โช Using image gcr.io/k8s-minikube/storage-provisioner:v5
๐ Enabled addons: default-storageclass, storage-provisioner
โ /usr/local/bin/kubectl is version 1.24.2, which may have incompatibilities with Kubernetes 1.27.4.
โช Want kubectl v1.27.4? Try 'minikube kubectl -- get pods -A'
๐ Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
All the pods are running fine:
$ sudo kubectl get pods --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
default ubuntu-pod 1/1 Running 0 3m42s
kube-system coredns-5d78c9869d-kf8h6 1/1 Running 0 5m55s
kube-system etcd-abhishek 1/1 Running 2 6m7s
kube-system kube-apiserver-abhishek 1/1 Running 2 6m11s
kube-system kube-controller-manager-abhishek 1/1 Running 2 6m8s
kube-system kube-proxy-b4dn8 1/1 Running 0 5m55s
kube-system kube-scheduler-abhishek 1/1 Running 2 6m7s
kube-system storage-provisioner 1/1 Running 0 6m7s
Then I wrote a simple ubuntu-pod to check internet access
ubuntu-pod.yml:
apiVersion: v1
kind: Pod
metadata:
name: ubuntu-pod
spec:
containers:
- name: ubuntu-container
image: ubuntu:latest
command:
- "sleep"
- "3600"
stdin: true
tty: true
Then I try to launch the terminal of that pod and try to check internet connectivity:
$ sudo kubectl exec -it ubuntu-pod -- /bin/bash
root@ubuntu-pod:/# apt update
Ign:1 http://security.ubuntu.com/ubuntu jammy-security InRelease
Ign:2 http://archive.ubuntu.com/ubuntu jammy InRelease
Ign:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Ign:1 http://security.ubuntu.com/ubuntu jammy-security InRelease
Ign:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Ign:1 http://security.ubuntu.com/ubuntu jammy-security InRelease
Ign:2 http://archive.ubuntu.com/ubuntu jammy InRelease
Err:1 http://security.ubuntu.com/ubuntu jammy-security InRelease
Temporary failure resolving 'security.ubuntu.com'
Ign:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Ign:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Ign:2 http://archive.ubuntu.com/ubuntu jammy InRelease
Ign:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Ign:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Err:2 http://archive.ubuntu.com/ubuntu jammy InRelease
Temporary failure resolving 'archive.ubuntu.com'
Err:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Temporary failure resolving 'archive.ubuntu.com'
Err:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Temporary failure resolving 'archive.ubuntu.com'
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy/InRelease Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-backports/InRelease Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/jammy-security/InRelease Temporary failure resolving 'security.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.
root@ubuntu-pod:/#
I understand when I use the driver=none
in minikube, it makes use of the host system. Is the issue in DNS resolution due to the host machine? I am not sure. But the internet works fine on my host machine.
When I remove the --driver=option
and do $ minikube start
and follow the above steps, the pods connects to internet just fine.
log.txt Please consider the last start...
Ubuntu
None
Upvotes: 1
Views: 202