Changing network from WIFI to LAN microk8s network breaks
See original GitHub issueHey, I’m having this problem when I change the network from WIFI to LAN cilium and DNS pods stop working.
The cilium-operator pod can’t connect create k8s client kubectl -n kube-system logs cilium-operator
:
level=error msg="Unable to contact k8s api-server" error="Get https://10.152.183.1:443/api/v1/namespaces/kube-system: dial tcp 10.152.183.1:443: connect: no route to host" ipAddr="https://10.152.183.1:443" subsys=k8s
level=fatal msg="Unable to connect to Kubernetes apiserver" error="unable to create k8s client: unable to create k8s client: Get https://10.152.183.1:443/api/v1/namespaces/kube-system: dial tcp 10.152.183.1:443: connect: no route to host" subsys=cilium-operator
I found out that the cluster IP is changing:
microk8s.config
On WIFI:
apiVersion: v1
clusters:
- cluster:
certificate-authority-data: ...
server: https://192.168.8.102:16443 <-- HERE
name: microk8s-cluster
contexts:
- context:
cluster: microk8s-cluster
user: admin
name: microk8s
current-context: microk8s
kind: Config
preferences: {}
users:
- name: admin
user:
token: ...
microk8s.config
On LAN:
apiVersion: v1
clusters:
- cluster:
certificate-authority-data: ...
server: https://192.168.8.103:16443 <-- HERE
name: microk8s-cluster
contexts:
- context:
cluster: microk8s-cluster
user: admin
name: microk8s
current-context: microk8s
kind: Config
preferences: {}
users:
- name: admin
user:
token: ...
All good, but the Endpoint in default Kubernetes svc is not changing kubectl describe svc kubernetes
:
Name: kubernetes
Namespace: default
Labels: component=apiserver
provider=kubernetes
Annotations: <none>
Selector: <none>
Type: ClusterIP
IP: 10.152.183.1
Port: https 443/TCP
TargetPort: 16443/TCP
Endpoints: 192.168.8.103:16443 <-- HERE
Session Affinity: None
Events: <none>
Does someone know how can I fix this problem?
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (1 by maintainers)
Top Results From Across the Web
Changing network from WIFI to LAN microk8s network breaks
Hey, I'm having this problem when I change the network from WIFI to LAN cilium and DNS pods stop working.
Read more >Troubleshooting - MicroK8s
If a pod is not behaving as expected, the first port of call should be the logs. First determine the resource identifier for...
Read more >An illustrated guide to Kubernetes Networking [Part 1] - ITNEXT
The first step is to make sure pods on the same node are able to talk to each other. The idea is then...
Read more >Optimal VirtualBox network setting for K8S on Laptop
The problem with the Bridged networking is that as mentioned above, it always requires connection to the network and switching to a different ......
Read more >How to troubleshoot networking on macOS - Ubuntu Discourse
This implies the problem is with macOS's “Internet Sharing” feature - for some reason its built-in DNS server is broken. The built-in DNS...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@belsakn I did this fix: https://github.com/ubuntu/microk8s/pull/1553 . It should be on latest/edge within the day and will get to latest/stable with 1.19.1. In the meantime, I think you can work around this issue by
microk8s.stop; microk8s.start
when you switch networks.Apologies for the inconvenience.
@ktsakalozos thanks for your info