<p>I'm faced with a scenario where we think about using Kubernetes. But I'm not sure if this is the right tool for it:</p>
<p>We have multiple vehicles, each having a computer connected to our main server via cellular network. We want to deploy several applications on every vehicle, so the vehicles are our nodes. We do not need any scaling, every vehicle will have an identical set of deployed applications running in two pods. And if a vehicle's computer is shut down, we must not deploy the pods on another node. Although the set of applications are always the same, their configuration is different on each vehicle (node). For instance some vehicles have a camera and this camera can only be accessed if their serial number is provided to the application. Other vehicles have no camera at all.</p>
<p><strong>The Problem:</strong></p>
<p>Using <a href="https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/" rel="nofollow noreferrer">DaemonSets</a> we probably can achieve that all vehicles will have just these two pods with the same containers. But the individual configuration worries me. We thought to have environment variables on each vehicle's computer with the relevant configs. But env variables of the host system cannot be accessed inside the containers running in pods. Is there any possibility to provide a node-unique configuration to our deployments? Is Kubernetes the right tool to use here at all?</p>

Varius
<p>Sorry i wasn't able to understand the vehicle and all that may be due to i read single time</p>
<p>but i can help with this;</p>
<blockquote>
<p>But env variables of the host system cannot be accessed inside the
containers running in pods. Is there any possibility to provide a
node-unique configuration to our deployments?</p>
</blockquote>
<p>Yes, there are possibilities i am not sure how you are setting up environment at host or K8s node.</p>
<p>But there is Hostpath option you can use, you can mount your node path directory into the container directly. You can create a file including the <strong>env vars</strong> you want to pass to the app when creating the Kubernetes node, at a fix location, then create your pod to use the same <strong>mount path</strong> as <strong>hostpath</strong>.</p>
<p>If your node gets replaced during the scaling your new PODs or container won't get this file if you are adding the <strong>file env</strong> <strong>manually</strong> at the <strong>first</strong> time.</p>
<p>Keep this <strong>env file</strong> in <strong>user data (startup script)</strong> so when any node get created in the node pool it will spin up with file at default location.</p>
<p>Read more : <a href="https://kubernetes.io/docs/concepts/storage/volumes/#hostpath" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/storage/volumes/#hostpath</a></p>
<p><strong>Add on</strong> :</p>
<p>If you want to use labels of a node in container : <a href="https://github.com/scottcrossen/kube-node-labels" rel="nofollow noreferrer">https://github.com/scottcrossen/kube-node-labels</a></p>
