<p>Friends, I am trying the implement a init container which will check if MYSQL is ready for connections and I am trying to use nslookup for this. The point is, how to pass the dns through a variable?</p>
<p>It worked like this:</p>
<pre><code>command: ['sh', '-c', 'until nslookup mysql-primary.default.svc.cluster.local; 
do echo waiting for mysql; sleep 2; done;']
</code></pre>
<p>But not like this:</p>
<pre><code>command: ['sh', '-c', 'until nslookup $(MYSQL_HOST); do echo waiting for mysql; sleep 2; done;']
</code></pre>
<p>Any Idea how I could get the second option working?</p>

marcelo
<p><code>MYSQL_HOST</code> seems to be an environment variable and not a command.</p>
<p><code>$(MYSQL_HOST)</code> will execute <code>MYSQL_HOST</code> as a command in a subshell (and that will not work in this case).</p>
<p>You probably want to use <code>&quot;${MYSQL_HOST}&quot;</code> instead.</p>
