0

I installed microk8s locally on my laptop from https://ubuntu.com/tutorials/install-a-local-kubernetes-with-microk8s#1-overview, the problem is I can't ping a restricetd domain from pod, but I am able from localhost and docker container with --network host.

I want the pod inherits the same network behavior as in my localhost (Bridging)

From localhost, I got

$ ping x.y.z
  Réponse de 10.88.255.60 : octets=32 temps=10 ms TTL=61
  Réponse de 10.88.255.60 : octets=32 temps=9 ms TTL=61

From Docker container

without --network host, I got an error

docker run -it --entrypoint /bin/sh busybox:latest

$ ping x.y.z
  ping: bad address 'x.y.z'

Using --network host, I got

docker run -it --network host --entrypoint /bin/sh busybox:latest

$ ping x.y.z
  64 bytes from 10.88.255.60: seq=0 ttl=60 time=15.947 ms
  64 bytes from 10.88.255.60: seq=1 ttl=60 time=10.395 ms

From microk8s pod

To test my cluster, I launched a bogus container

kubectl run -i --tty busybox --image=busybox --restart=Never -- sh

The pod is launching perfectly

kubectl get pods
NAME      READY   STATUS    RESTARTS   AGE
busybox   1/1     Running   0          17m

I got an error

# ping x.y.z
  ping: bad address 'x.y.z'

NB: url x.y.z is bogus because I can't put the real url of the API (restricted acces).

kubectl cluster-info

 Kubernetes master is running at https://127.0.0.1:16443
 Heapster is running at https://127.0.0.1:16443/api/v1/namespaces/kube-system/services/heapster/proxy
 CoreDNS is running at https://127.0.0.1:16443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
 Grafana is running at https://127.0.0.1:16443/api/v1/namespaces/kube-system/services/monitoring-grafana/proxy
 InfluxDB is running at https://127.0.0.1:16443/api/v1/namespaces/kube-system/services/monitoring-influxdb:http/proxy
 To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
Adil Blanco
  • 616
  • 2
  • 6
  • 23

0 Answers0