Giter VIP home page Giter VIP logo

Comments (4)

dionysius avatar dionysius commented on July 30, 2024

Are we talking about service discovery itself, meaning obtaining endpoint addresses? (see environment variables

Environment variables defined in the ContainerSpec of the PodSpec are passed to the lxd container config as config.environment.*, which are passed to the init process of the container (see cat /proc/1/environ) and usually the init system does not forward these. [...]

# xargs -0 -n 1 echo < /proc/1/environ
[...]
KUBERNETES_SERVICE_HOST=192.168.24.1
KUBERNETES_PORT_443_TCP_ADDR=192.168.24.1
KUBERNETES_PORT_443_TCP_PROTO=tcp
KUBERNETES_PORT_443_TCP=tcp://192.168.24.1:443
KUBERNETES_PORT=tcp://192.168.24.1:443
KUBERNETES_PORT_443_TCP_PORT=443
KUBERNETES_SERVICE_PORT=443
KUBERNETES_SERVICE_PORT_HTTPS=443
container=lxc

If we're talking about same node communication between pods, this should work out of the box thanks to the lxd networking (or CNI if you set --network-plugin=cni). If not, we have to figure out how the interfaces are looking right now

If we're talking about inter node communication, we have to consider the kubernetes network plugin you are using.

from lxe.

shubhparekh avatar shubhparekh commented on July 30, 2024

Can we call service running inside lxc container through clusterip based dns and port of kubernetes service? and also expose it externally through nodeport?

from lxe.

dionysius avatar dionysius commented on July 30, 2024

Yes, pods created with lxe can be called through clusterip

The main part is network configuration here. Besides kubelet and lxe you need the networking tools of your chosen network plugin. I only have experience with flannel+kubeproxy, but I think the other kubernetes network plugins work similiar. Your used network plugin decides how your pod interface should look like and maybe they provide a CNI conf, so you can hook that up with lxe --network-plugin=cni. Or, like flannel, your plugin chooses a network range for your node, you can set that in lxe with --bridge-dhcp-range.

  --bridge-dhcp-range string    Which DHCP range to configure in the 'lxebr0' lxd bridge. Only applies if network-plugin is set to '' and does not exist yet. If empty, uses random range provided by lxd. Not needed, if kubernetes will publish the range using CRI UpdateRuntimeconfig

Yes, pods can be reached with Nodeport. LXE uses LXD's proxy device for that.

But: I have not played with all the network plugins! I only know flannel+kube-proxy and kube-router so far.

from lxe.

dionysius avatar dionysius commented on July 30, 2024

feel free to reopen if something is missing

from lxe.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.