<p>When deploying container in kube-system you can see the fqdn of masternode api being used.
When creating a namespace and deploy same container it is kubernetes service with internal ip for the <code>KUBERNETES_SERVICE_HOST</code> environment variable.</p>

<p>We cannot use <code>kind: PodPreset</code> in AKS so i don't know any other way on how to set this environment variable for new pods.
Pods are being deploying with helm in this namespace so you can't set this environment variable in a way that helm will use this in deployment.</p>

<p>The <a href="https://kubernetes.io/docs/concepts/containers/container-environment/#container-environment" rel="nofollow noreferrer">Kubernetes Container Environment</a> provides several important resources to Containers, one of them is:</p>

<blockquote>
  <ul>
  <li><strong>A list of all services that were running when a Container was created is available to that Container as environment variables.</strong> Those environment variables match the syntax of Docker links.</li>
  </ul>
  
  <p>For a service named <code>foo</code> that maps to a Container named bar, the following variables are defined:</p>
  
  <p><code>FOO_SERVICE_HOST=0.0.0.0</code> (The IP Address of the service <code>foo</code>)</p>
  
  <p><code>FOO_SERVICE_PORT=65535</code> (the port of the service <code>foo</code>)</p>
</blockquote>

<ul>
<li><code>XXX_SERVICE_PORT</code> is generated automatically based on the services available for the container at the moment of it's creation.</li>
</ul>

<hr>

<blockquote>
  <p><em>When deploying container in kube-system you can see the fqdn of masternode api being used. When creating a namespace and deploy same container it is kubernetes service with internal ip for the KUBERNETES_SERVICE_HOST environment variable.</em></p>
</blockquote>

<ul>
<li>It should work both ways because the <code>kubernetes.default</code> service is a relay agent to the master API, take a look at the description of the service:</li>
</ul>

<pre><code>$ k describe svc kubernetes
Name:              kubernetes
Namespace:         default
Labels:            component=apiserver
                   provider=kubernetes
Annotations:       &lt;none&gt;
Selector:          &lt;none&gt;
Type:              ClusterIP
IP:                10.21.0.1
Port:              https  443/TCP
TargetPort:        443/TCP
Endpoints:         10.54.240.1:443
Session Affinity:  None
Events:            &lt;none&gt;

$ kubectl cluster-info
Kubernetes master is running at https://10.54.240.1
</code></pre>

<ul>
<li>The endpoint of the <code>kubernetes.default</code> service is the master API IP, so if your deployment is not working as intended, it might have another issue under the hood.</li>
</ul>

<p>You can also follow the instructions given in @djsly answer and open an issue on the prom-op github, vote for <code>podPreset</code> to become available on AKS or even experiment with other cloud providers (like GCP that offers a free tier so you can try out).</p>

<p>If you have any further questions let us know.</p>
