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.

Can this actually be used in Kubernetes?

See original GitHub issue

I am trying to implement cote in kubernetes on IBM bluemix and am having alot of trouble getting it to work.

The bluemix kubernetes implementation has Calico plugin at network layer and Pods can definitely access each other via IP.

I have put a redis service in place and set cote to use that for discovery which works:

2017-09-13T05:23:41.920741203Z core space requester > service.online idea service space responder#7528508b-a087-414e-ade8-2a95825472e1 on 8002

however once it starts actually messaging it seems to drop back to hostnames that do not resolve inside kubernetes, e.g.

2017-09-13T05:23:46.925401243Z Error: getaddrinfo EAI_AGAIN idea:8000
2017-09-13T05:23:46.925441235Z     at Object._errnoException (util.js:1041:11)
2017-09-13T05:23:46.925447197Z     at errnoException (dns.js:58:15)
2017-09-13T05:23:46.925452669Z     at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:95:26)

I’ve trawled through the implementation of node-discover and can see the hostname getting encoded in the message but I’m unclear if that hostname is used to respond.

Is there a way to insist on using IP addresses for communication rather than hostnames or am I looking down the wrong path here?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
drubincommented, Apr 13, 2019

@LeoVS09 as mentioned https://github.com/dashersw/cote-workshop/pull/5#issuecomment-482807015

Right now the easiest way to get this working in either docker-swarm or k8s is to use the redis service discovery (with DISCOVERY_HOSTNAME env param).

I can update the example workshop to work k8s with redis, but will only get to that next week.

1reaction
NickyTopecommented, Sep 16, 2017

Thanks for looking @drubin and @dashersw I’m glad that what I’ve been coming up with is similar to what you have found.

I have currently deployed successfully using a fork of node-discover (and cote to point at it) with the env.DISCOVERY_HOSTNAME || os.hostname() change above and am using pretty much exactly what you put above for the Deployment yaml:

- name: DISCOVERY_HOSTNAME
    valueFrom:
      fieldRef:
        fieldPath: status.podIP

I also found that multicast is on the way for Calico (and many other of the available network plugins for kube), so am looking forward to going back to less configuration for cote in future, however in my current situation (deployment via IBM bluemix) I don’t have enough control over the host environment to change network plugins so would really appreciate you guys considering this change, or perhaps you can see a better way to go back to useHostNames: false in combination with redis discovery and an environment variable so the correct IP can be reported to redis?

Really appreciate you guys looking into this!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Overview - Kubernetes
Kubernetes is a portable, extensible, open source platform for managing containerized workloads and services, that facilitates both ...
Read more >
Do I Really Need Kubernetes? - The New Stack
Kubernetes is an orchestration tool for containerized applications. Starting with a collection of Docker containers, Kubernetes can control ...
Read more >
Kubernetes and its Use-Cases - Dipaditya Das - Medium
Kubernetes is portable in nature, meaning it can run on various public or private cloud platforms such as AWS, Azure, OpenStack, or Apache...
Read more >
No, we don't use Kubernetes | Ably Blog: Data in Motion
No, we don't use Kubernetes”. That always gets raised eyebrows... so we decided to write about our reasoning behind this cloud architecture decision....
Read more >
Why (and when) you should use Kubernetes | HackerNoon
What's great about Kubernetes is that it's built to be used anywhere so you can deploy to public/private/hybrid clouds, enabling you to ...
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