kubeless icon indicating copy to clipboard operation
kubeless copied to clipboard

Should include /etc/services

Open Alan-R opened this issue 3 years ago • 3 comments

Is this a BUG REPORT or FEATURE REQUEST?: Could be either.

What happened: socket.getservbyname("ssh","tcp") fails in functions giving an exception.

What you expected to happen: I expect to work, and return 22. How to reproduce it (as minimally and precisely as possible): import socket socket.getservbyname("ssh", "tcp") Anything else we need to know?: Probably /etc/services is missing

Environment:

  • Kubernetes version (use kubectl version):
  • Kubeless version (use kubeless version): 1.0.6
  • Cloud provider or physical cluster: Physical cluster running under VMWare.

Alan-R avatar Jul 22 '20 21:07 Alan-R

Hi @Alan-R, I am not sure why you would need SSH for a Kubeless function? Note that if you need a shell you can still exec within the pod running kubectl exec <pod> <command>.

Also, the Dockerfile is here: https://github.com/kubeless/runtimes/tree/master/stable/nodejs

You can fork it and include anything you want in the base image.

andresmgot avatar Jul 24 '20 07:07 andresmgot

If you want to connect to a given service without someone else's library, you need to know the port number. The correct way is to effectively use /etc/services. The alternative is to hard-wire it- which is inelegant and not the recommended way to write network services. "ssh" was just a simple example. You asked for an example. I gave one. In our particular case, we're managing a very large network - and there are a variety of network-related functions we might want to do using kubeless.

Typically, forking someone else's software leads to support problems. And, starting from your Dockerfile is probably not the most supportable way to do that - even if it's what has to be done.

Alan-R avatar Jul 24 '20 12:07 Alan-R

Got it, if it's just that file, it should be lightweight. Do you mind sending a PR adding it? If it doesn't increase the size of the image too much we can include it in the official runtimes.

andresmgot avatar Jul 27 '20 07:07 andresmgot