0

Simple ubuntu pod in microk8s fail to ping external servers. Following is the deployment manifest.

apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: myapp 
  name: valet-pod 
spec:
  selector:
    matchLabels:
      app: valet-pod 
  replicas: 1
  template:
    metadata:
      labels:
        app: valet-pod 
        tenantid: softwareag
    spec:
      containers:
        - name: valet-pod 
          image: ubuntu 
          command: ["/bin/bash", "-c"]
          args:
            - apt-get update -y;
              apt-get install -y curl traceroute net-tools iputils-ping;
              echo "Sleeping for 5000";
              sleep 5000;

However, docker container passes to ping any external server.

This is happening in a ubuntu 18 in a laptop. Following are the network settings.

ufw allow in on cbr0
ufw default allow FORWARD
sysctl net.ipv4.ip_forward=1 

What tool can be used to troubleshoot such scenarios?

nashter
  • 1,181
  • 1
  • 15
  • 33

1 Answers1

0

In the microk8s 1.16 version, the network interface is cni0 which used to be cbr0 in the lower versions of microk8s.

So, the fix was to allow incoming packets on interface cni0 (instead of cbr0).

ufw allow in on cni0

This solved the issue.

nashter
  • 1,181
  • 1
  • 15
  • 33