<p>I'm planning to run a <em>.sh</em> script after some containers are up to make some REST requests.</p>

<p>Created a job to wait for these initial containers, filled <code>initContainers</code> tag in <em>.yaml</em>.</p>

<p>First, i thought creating a container with using a Linux distro as a base image. Then it didn't seem quite right. </p>

<p>Isn't that waste of resources ? What is the best practice for this situation ?</p>

<p>Thanks in advance.</p>

Emre Acar
<p>You can use any kind of image as base image. The only resource you're consuming (not wasting) is disk space. </p>

<p>Kubernetes will pull the image and that will consume disk space on the node. As soon as the init container has done it's work, it will be stopped and won't use any more RAM or CPU which are the real precious resources in the cloud or on bare metal.</p>

<p>If you're worried about the image size, you can also try to use the same image as the user container (the main container) but starting a different command from it.</p>

<p>This will make the node just pull on image and no additional space appart from your script will be consumed.</p>

<p>Another option could be to use a very small distro like alpine.</p>

<p>If you can write your initialization routine in go you can also use your go binary as image like discribed <a href="https://medium.com/@chemidy/create-the-smallest-and-secured-golang-docker-image-based-on-scratch-4752223b7324" rel="nofollow noreferrer">here</a>.</p>
