<p>You should look at <a href="https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/" rel="nofollow noreferrer">DaemonSets</a>. You can configure it so that the Pods runs on each node of your Kubernetes cluster. Each individual Pod (running your Linux machine) can be exposed to outside network using the IP address of the node on which it is running.</p>
<blockquote>
<p>My need is more targeted to expose an entire machine on a precise static IP and not just a port.</p>
</blockquote>
<p><em>Before getting into further explanation, I should point out that there is nothing like exposing entire machines.</em></p>
<p>Access to any machine is always through a combination of IP address and Port. So you should decide based on which port you would like to access on the container.</p>
<p><strong>Example:</strong></p>
<p>Let's say I have a 3 node Kubernetes cluster, I can create a DaemonSet with the application/image of my choice. Below names/details are imaginary, but should give an idea on the mapping.</p>
<pre><code>ubuntu-daemonset-pod-xyz    k8s-node-1    192.168.2.1
ubuntu-daemonset-pod-abc    k8s-node-2    192.168.2.2
ubuntu-daemonset-pod-hij    k8s-node-3    192.168.2.3
</code></pre>
<p>The Pods above can be &quot;exposed&quot; on the IP address of the node on which it is running. That is: <code>ubuntu-daemonset-pod-xyz</code> on <code>192.168.2.1</code>.</p>

CC BY-SA 4.0
2020-09-17T13:03:53.760Z
Thanks, for your answer. Is it possible to expose a pod on a static IP different from the one of the nodes (see my picture above)? This setup would allow me to have more pods than nodes and moreover to place pods on different subnets
rakwaht
CC BY-SA 4.0
2020-09-17T13:14:04.577Z
Any Pod can be configured to be accessible on the Node's IP called as [NodePort](https://kubernetes.io/docs/concepts/services-networking/service/#nodeport). Even if you don't use DaemonSet.
seshadri_c
CC BY-SA 4.0
2020-09-17T12:57:03.247Z
2020-09-17T12:57:03.247Z
seshadri_c
<p>0</p>
<p>I am using k8s to orchestrate an environment on a local network. My idea is to deploy a number of linux machines each of which should have its own &quot;External&quot; IP.</p>
<p>Right now I found guides to expose services on External IP (e.g. <a href="https://kubernetes.io/docs/tutorials/stateless-application/expose-external-ip-address/" rel="nofollow noreferrer">https://kubernetes.io/docs/tutorials/stateless-application/expose-external-ip-address/</a>), but this is tailored to expose services on a precise port.</p>
<p>My need is more targeted to expose an entire machine on a precise static IP and not just a port. This would allow me to easily deploy and reshape any network topology I need. Notice that doing it without exposing the IPs (hence using internal k8s routing/dns) is not an option because this environment should be interfaced with real/bare metal hardware already present in the network.</p>
<p>Here follows a little example of the desired result:
<a href="https://i.sstatic.net/7O8Ae.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/7O8Ae.png" alt="enter image description here" /></a></p>
<p>Can anyone relate to this and let me know if this is even possible?</p>

<docker><kubernetes>
Kubernetes used to orchestrate Containerized Machines
rakwaht
# Kubernetes used to orchestrate Containerized Machines

(Asked by: username_0 on 2020-09-17)

0

I am using k8s to orchestrate an environment on a local network. My idea is to deploy a number of linux machines each of which should have its own "External" IP.

Right now I found guides to expose services on External IP (e.g. <https://kubernetes.io/docs/tutorials/stateless-application/expose-external-ip-address/>), but this is tailored to expose services on a precise port.

My need is more targeted to expose an entire machine on a precise static IP and not just a port. This would allow me to easily deploy and reshape any network topology I need. Notice that doing it without exposing the IPs (hence using internal k8s routing/dns) is not an option because this environment should be interfaced with real/bare metal hardware already present in the network.

Here follows a little example of the desired result:
[![enter image description here](https://i.sstatic.net/7O8Ae.png)](https://i.sstatic.net/7O8Ae.png)

Can anyone relate to this and let me know if this is even possible?

**Tags:** docker, kubernetes


---

## 1 answers

### Answer by username_1 on 2020-09-17. Score: 1

You should look at DaemonSets. You can configure it so that the Pods runs on each node of your Kubernetes cluster. Each individual Pod (running your Linux machine) can be exposed to outside network using the IP address of the node on which it is running.

My need is more targeted to expose an entire machine on a precise static IP and not just a port.

Before getting into further explanation, I should point out that there is nothing like exposing entire machines.
Access to any machine is always through a combination of IP address and Port. So you should decide based on which port you would like to access on the container.
Example:
Let's say I have a 3 node Kubernetes cluster, I can create a DaemonSet with the application/image of my choice. Below names/details are imaginary, but should give an idea on the mapping.
ubuntu-daemonset-pod-xyz    k8s-node-1    192.168.2.1
ubuntu-daemonset-pod-abc    k8s-node-2    192.168.2.2
ubuntu-daemonset-pod-hij    k8s-node-3    192.168.2.3

The Pods above can be "exposed" on the IP address of the node on which it is running. That is: ubuntu-daemonset-pod-xyz on 192.168.2.1.

> **Comments:**
> **username_0**: Thanks, for your answer. Is it possible to expose a pod on a static IP different from the one of the nodes (see my picture above)? This setup would allow me to have more pods than nodes and moreover to place pods on different subnets  
> **username_1**: Any Pod can be configured to be accessible on the Node's IP called as [NodePort](https://kubernetes.io/docs/concepts/services-networking/service/#nodeport). Even if you don't use DaemonSet.  

---

