<p>I have a pod running dotnet that leverages an <a href="https://learn.microsoft.com/en-us/aspnet/core/fundamentals/configuration/?view=aspnetcore-6.0#appsettingsjson" rel="nofollow noreferrer">appsettings.json</a> file. I have the following entry for RabbitMq:</p>
<p>appsettings.json</p>
<pre><code>{
  ...
  &quot;RabbitMQ&quot;: {
    &quot;HostName&quot;: &quot;localhost&quot;,
    &quot;UserName&quot;: &quot;someuser&quot;,
    &quot;Password&quot;: &quot;somepassword&quot;
  }
}
</code></pre>
<p>I am trying to update the <strong>RabbitMQ.HostName</strong> property within my deployment yaml like so:</p>
<pre><code>env:
  - name: &quot;RabbitMQ:HostName&quot;
    value: &quot;rabbitmq-cluster-deployment.rabbitmq.svc.cluster.local&quot;
</code></pre>
<p>It doesn't work. I have tried different variations but nothing looks like it sets it.</p>
<p>Does Kubernetes have a way of setting the &quot;nested property&quot; or no? I am aware that the <code>:</code> character is not allowed. I have tried using <code>.</code> which didn't throw an error, but also didn't work. The reason I was thinking it was a <code>:</code> is because that is how you would do it with dotnet.</p>
<p>Example: <code>_configuration[&quot;RabbitMQ:HostName&quot;]</code></p>
<p>Other &quot;non-nested&quot; environment variables are set just fine.</p>

mwilson
<p>Remove the quotes from the <code>name</code> field and replace <code>:</code> with double underscores <code>__</code></p>
<p>Instead of</p>
<pre><code>env:
  - name: &quot;RabbitMQ:HostName&quot;
    value: &quot;rabbitmq-cluster-deployment.rabbitmq.svc.cluster.local&quot;
</code></pre>
<p>use</p>
<pre><code>env:
  - name: RabbitMQ__HostName
    value: &quot;rabbitmq-cluster-deployment.rabbitmq.svc.cluster.local&quot;
</code></pre>
