question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Changing network from WIFI to LAN microk8s network breaks

See original GitHub issue

Hey, 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:closed
  • Created 3 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
ktsakalozoscommented, Sep 11, 2020

@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.

0reactions
belsakncommented, Sep 11, 2020

@ktsakalozos thanks for your info

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found