5 ms·
Common Lisp is also a pleasure to use for k8s-hosted services. Just deploy your Lisp-based service to k8s, forward the sly/slime port to your local system, and
by atgreen 7y ago
Common Lisp is also a pleasure to use for k8s-hosted services. Just deploy your Lisp-based service to k8s, forward the sly/slime port to your local system, and continue to work on it interactively with emacs and sly/slime. It's really the most interactive development approach for k8s-hosted services. See https://github.com/container-lisp/s2i-lisp https://github.com/container-lisp/s2i-lisp
- lvh 7y agoHow do you do the forwarding? (That’s an interesting question to me by itself, but I ask because it seems like that feature is just as good outside of k8s too :))
- simiones 7y agoWith k8s, you just create a service of type NodePort and it assigns a free external port for that service, which is mapped back to a specific port in the Lisp container.
- lvh 7y agoI know of NodePort, but last i checked it’s a low-level constrict that doesn’t do anything like, say, authn—so that doesn’t seem like a complete answer.
- ohithereyou 7y agoWhat sort of encryption and authentication can I expect if I do that? Can anybody who guesses the port dump code into my running Lisp instance?
- e12e 7y agoThis is entirely to hard to find the answer to in the kubernetes/kubectl documentation. Apparently the forward is done via socat over tls: https://stackoverflow.com/questions/50645059/is-kubectl-port-forward-encrypted https://stackoverflow.com/questions/50645059/is-kubectl-port... And socat is mentioned in: https://github.com/kubernetes/kubectl/blob/master/pkg/cmd/portforward/portforward.go https://github.com/kubernetes/kubectl/blob/master/pkg/cmd/po... I didn't actually manage to find out what or how socat is called - but I'm also on mobile, so it's a little convoluted to browse source code. Anyone know where the call to socat happens, after kubectl port-forward?
- simiones 7y agoThe encryption and authentication that the Lisp image exposes :) Someone else mentioned that kubectl port-forward also adds these for you, so if you are not in a private cluster, it may be a better option.
- atgreen 7y agoDon't do this... You only need the connection for development purposes, so use "kubectl port-forward", which gives you the auth you'll need as well.
- messe 7y agoOutside of k8s, which I'm not familiar with, ssh can do port forwarding.
- lvh 7y agoSure, I know general techniques and k8s-specific ones (and have used production SSH-to-programming environment REPLs with twisted). I’m asking partially because my job these days is to secure setups like these :)
- ivan4th 7y agokubectl port-forward my-lisp-pod 4005:4005 then M-x slime-connect localhost 4005
- atgreen 7y agoivan4th had the right answer. Use the "kubectl port-forward" command. BTW, here's a k8s-hosted app I wrote using this approach: https://github.com/atgreen/red-light-green-light https://github.com/atgreen/red-light-green-light
- vindarel 7y agoGenerally, here's how to connect to a remote running lisp image, and send changes from one's comfortable editor: https://lispcookbook.github.io/cl-cookbook/debugging.html#remote-debugging https://lispcookbook.github.io/cl-cookbook/debugging.html#re...