kubernetes-vagrant-coreos-cluster icon indicating copy to clipboard operation
kubernetes-vagrant-coreos-cluster copied to clipboard

no iptables rules being written on host machine

Open CharlesJQuarra opened this issue 8 years ago • 1 comments

CharlesJQuarra avatar Nov 06 '17 20:11 CharlesJQuarra

created a test deployment in the kubernetes cluster:

kubectl run hello-world --replicas=2 --labels="run=load-balancer-example" --image=gcr.io/google-samples/node-hello:1.0 --port=8080

I create a service exposing these services:

{
  "kind": "Service",
  "apiVersion": "v1",
  "metadata": {
    "name": "example-service",
    "namespace": "default",
    "selfLink": "/api/v1/namespaces/default/services/example-service",
    "uid": "920d2302-c31c-11e7-be6d-0800276974d0",
    "resourceVersion": "194855",
    "creationTimestamp": "2017-11-06T18:01:53Z",
    "labels": {
      "pod-template-hash": "2822484588",
      "run": "load-balancer-example"
    }
  },
  "spec": {
    "ports": [
      {
        "protocol": "TCP",
        "port": 8080,
        "targetPort": 8080,
        "nodePort": 31561
      }
    ],
    "selector": {
      "pod-template-hash": "2822484588",
      "run": "load-balancer-example"
    },
    "clusterIP": "10.100.155.72",
    "type": "LoadBalancer",
    "sessionAffinity": "None",
    "externalTrafficPolicy": "Cluster"
  },
  "status": {
    "loadBalancer": {}
  }
}

The service starts:

$kubectl describe services example-service
Name:                   example-service
Namespace:              default
Labels:                 pod-template-hash=2822484588
                run=load-balancer-example
Annotations:            <none>
Selector:               pod-template-hash=2822484588,run=load-balancer-example
Type:                   LoadBalancer
IP:                     10.100.155.72
Port:                   <unset> 8080/TCP
NodePort:               <unset> 31561/TCP
Endpoints:              10.244.48.2:8080,10.244.95.2:8080
Session Affinity:       None
Events:                 <none>

If I ssh inside the vagrant VMs, I can hit the endpoints:

$curl 10.244.95.2:8080
Hello Kubernetes!

On the host, however this give a 'no route to host' error. When I inspect the iptables-save in the host, the reason is clear: no iptables being written on the host

sudo iptables-save | grep example-service
(no results)

I cannot tell if this is a bug or is simply unimplemented?

CharlesJQuarra avatar Nov 06 '17 21:11 CharlesJQuarra