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.

consider exposing kubernetes services across the cluster

See original GitHub issue

Right now, kubernetes services can be reached from control nodes and kubeworker nodes but cannot be accessed from any other node type.

Example service:

$ kubectl run service-test --image=nginx
deployment "service-test" created

$ kubectl expose deployment service-test --type=NodePort --port=80
service "service-test" exposed

$ kubectl describe svc service-test
Name:                   service-test
Namespace:              default
Labels:                 run=service-test
Selector:               run=service-test
Type:                   NodePort
IP:                     10.254.189.112
Port:                   <unset> 80/TCP
NodePort:               <unset> 31929/TCP
Endpoints:              192.168.1.2:80
Session Affinity:       None
No events.

From a control node:

# cluster ip
$ curl -sI 10.254.189.112 | head -n 1
HTTP/1.1 200 OK

# pod endpoint
$ curl -sI 192.168.1.2:80 | head -n 1
HTTP/1.1 200 OK

# node port
$ curl -sI $HOSTNAME:31929 | head -n 1
HTTP/1.1 200 OK

All of the above are reachable via kubeworkers as well. However, from worker or edge nodes these endpoints are unavailable. This means applications running on workers (via mesos or otherwise) cannot communicate with apps running on kubernetes.

A simple way to enable this is to install the kubernetes components (kubernetes and kubernetes-node roles) on all nodes but set --register-schedulable=false on the kubelet for all nodes except kubeworkers. With this, k8s workloads will only be scheduled on kubeworkers but kube-proxy on every node will set up the iptables rules to enable connectivity. It may be possible to just install a subset of the kubernetes components (just kube-proxy maybe?) but more investigation would be needed.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:2
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
thomasvincentcommented, Apr 19, 2017

Yes, I could see one. Right now people wrote there own schedulers in Mesos. But I could see the use case for both.

Sent from my iPhone

On Apr 19, 2017, at 8:38 AM, anton notifications@github.com wrote:

Why is this important or useful? Is there a use case where someone is going to build a service or scheduler deployed through marathon that will work with kubernetes services… ?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

0reactions
Theaxiomcommented, Apr 25, 2017

@KaGeN101 You are correct, we just have to verify this is how it is currently working.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using a Service to Expose Your App
NodePort - Exposes the Service on the same port of each selected Node in the cluster using NAT. Makes a Service accessible from...
Read more >
Expose Kubernetes services running on Amazon EKS ...
To expose the Kubernetes services running on your cluster, first create a sample application. Then, apply the ClusterIP, NodePort, ...
Read more >
Exposing Apps With Services
A Kubernetes Service is a Kubernetes object which enables cross-communication between different components within and outside a Kubernetes ...
Read more >
Exposing services on GKE | Google Cloud Blog
Application exposure through Ingress and Services · Backend scope (or cluster scope) refers to whether a load balancer can send traffic to ...
Read more >
Exposing Kubernetes Services - Load Balancers
NodePort extends type Cluster IP, by mapping the internal IP address and port number to an external port on each Kubernetes node. Since...
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