<p>I have a server that is orchestrated using k8s it's service looks like below</p>

<pre><code>➜  installations ✗ kubectl get svc
NAME                 TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)                               AGE

oxd-server           ClusterIP   10.96.124.25   &lt;none&gt;        8444/TCP,8443/TCP                     3h32m
</code></pre>

<p>and it's pod.</p>

<pre><code>➜  helm git:(helm-rc1) ✗ kubectl get po
NAME                                   READY   STATUS             RESTARTS   AGE

sam-test-oxd-server-6b8f456cb6-5gwwd   1/1     Running            0          3h2m

</code></pre>

<p>Now, I have a docker image with an <code>env</code> variable that requires the URL of this server. </p>

<p>I have 2 questions from here.</p>

<ol>
<li><p>How can the docker image get the URL or access the URL? </p></li>
<li><p>How can I access the same URL in my terminal so I make some curl commands through it?</p></li>
</ol>

<p>I hope I am clear on the explanation.</p>

Shammir
<ul>
<li><p>You can use the name of the service <code>oxd-server</code> from any other pod in the same namespace to access it i.e., if the service is backed by pods that are serving HTTPS, you can access the service at <code>https://oxd-server:8443/</code>.</p>

<p>If the client pod that wants to access this service is in a different namespace, then you can use <code>oxd-server.&lt;namespace&gt;</code> name. In your case that would be <code>oxd-server.default</code> since your service is in default namespace.</p></li>
<li><p>To access this service from outside the cluster(from your terminal) for local debugging, you can use <a href="https://kubernetes.io/docs/tasks/access-application-cluster/port-forward-access-application-cluster/" rel="nofollow noreferrer">port forwarding</a>. </p>

<p>Then you can use the URL <code>localhost:8443</code> to make any requests and request would be port forwarded to the service.</p></li>
</ul>

<pre><code>kubectl port-forward svc/oxd-server 8443:8443
</code></pre>

<ul>
<li>If you want to access this service from outside the cluster for production use, you can make the service as <code>type: NodePort</code> or <code>type: LoadBalancer</code>. See service types <a href="https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types" rel="nofollow noreferrer">here.</a></li>
</ul>
