<p>I have some problems with Kubernetes ExternalName Service. I want to access server 'dummy.restapiexample.com' from the cluster . I created the following service:</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
   name: dummy-svc
spec:
    type: ExternalName
    externalName: dummy.restapiexample.com   
</code></pre>

<pre><code>$ kubectl get svc
NAME         TYPE           CLUSTER-IP   EXTERNAL-IP                PORT(S)   AGE
dummy-svc    ExternalName   &lt;none&gt;       dummy.restapiexample.com   &lt;none&gt;    33m
kubernetes   ClusterIP      100.64.0.1   &lt;none&gt;                     443/TCP   6d19h
</code></pre>

<p>But when I try to access the service from a pod from the same namespace, I'm getting code HTTP 403.</p>

<pre><code>$ curl -v http://dummy-svc/api/v1/employee/1
&gt; GET /api/v1/employee/1 HTTP/1.1
&gt; User-Agent: curl/7.35.0
&gt; Host: dummy-svc
&gt; Accept: */*
&gt;
&lt; HTTP/1.1 403 Forbidden
&lt; Content-Type: text/plain
&lt; Date: Sat, 23 Nov 2019 14:21:05 GMT 
&lt; Content-Length: 9
&lt;
</code></pre>

<p>I can access the external server w/o any problem:</p>

<pre><code>$ curl -v http://dummy.restapiexample.com/api/v1/employee/1                               │
&gt; GET /api/v1/employee/1 HTTP/1.1 
&gt; User-Agent: curl/7.35.0 
&gt; Host: dummy.restapiexample.com
&gt; Accept: */*                                                                                            
&lt; HTTP/1.1 200 OK 
...
&lt; Content-Length: 104
{"id":"1","employee_name":"56456464646","employee_salary":"2423","employee_age":"23","profile_image":""}
</code></pre>

<p>What is wrong with my code? Any hint will be highly appreciated.The cluster is runnung on AWS and installed with kops.</p>

Stanislav Melnikov
<p>As pointed by Patrik W, the service works correctly. It routes requests to the remote server. Ping reaches the remote server:</p>

<pre><code>$ ping dummy-svc

PING dummy.restapiexample.com (52.209.246.67) 56(84) bytes of data.
64 bytes from ec2-52-209-246-67.eu-west-1.compute.amazonaws.com (52.209.246.67): icmp_seq=1 ttl=62 time=1.29 ms
</code></pre>

<p>Code 403 received from the remote server because of different URLs.</p>

<p>@Patrik W: Thanks for the help.</p>
