<p>I'm doing a wordpress deployment, but since the ip address of the service is not always static, I should use the name of the service in my secret which currently looks like this:</p>
<pre><code>apiVersion: v1
kind: Secret
metadata:
  name: wordpress-secret
stringData:
  WORDPRESS_DB_NAME: &quot;wordpress&quot;
  WORDPRESS_DB_USERNAME: &quot;admin&quot;
  WORDPRESS_DB_PASSWORD: &quot;password&quot;
  WORDPRESS_DB_HOST: &quot;1.1.1.1&quot;
  WORDPRESS_DB_PORT: &quot;3306&quot;
</code></pre>
<p>So how can I make everything dynamic? because obviously the ip address is not always static of the service</p>

Belbo
<p>Services in the same namespace can be reached using the name of the service. If the service is called <code>my-db</code>, you simply write <code>WORDPRESS_DB_HOST: “my-db”</code>.</p>
