<p>I managed to deploy a python app at the kubernetes cluster . The python app image is deployed at AWS ECR (Elastic Container Registry). 
<br>
My deployment is:<br></p>

<blockquote>
  <p>(<strong>NAME</strong>)charting-rest-server   <br>(<strong>READY</strong>)1/1     <br>(<strong>UP-TO-DATE</strong>)1           <br> (<strong>AVAILABLE</strong>)1           <br>(<strong>AGE</strong>)33m  <br> (<strong>CONTAINERS</strong>)charting-rest-server  <br> (<strong>IMAGES</strong>) *****.dkr.ecr.eu-west-2.amazonaws.com/charting-rest-server:latest <br> (<strong>SELECTOR</strong>)app=charting-rest-server
  <br></p>
</blockquote>

<p>And my service is:</p>

<blockquote>
  <p>(<strong>NAME</strong>)charting-rest-server-service   <br>(<strong>TYPE</strong>)LoadBalancer <br>  (<strong>CLUSTER-IP</strong>)10.100.4.207     <br>(<strong>EXTERNAL-IP</strong>)*******.eu-west-2.elb.amazonaws.com   <br>(<strong>PORT(s)</strong>)8765:32735/TCP               <br>   (<strong>AGE</strong>)124m <br>  (<strong>SELECTOR</strong>)app=charting-rest-server
  <br></p>
</blockquote>

<p>According to this <a href="https://aws.amazon.com/premiumsupport/knowledge-center/eks-kubernetes-services-cluster/" rel="nofollow noreferrer">AWS guide</a> , when I do <code>curl *****.us-west-2.elb.amazonaws.com:80</code> I should be able to externally access the Load Balancer , who is going to route me to my pod's ip. 
<br> But all I get is </p>

<blockquote>
  <p>(6) Could not resolve host: *******.eu-west-2.elb.amazonaws.com</p>
</blockquote>

<p><br> <br> And come to think about it if I want to have access to my pod and send some requests I should have an external-ip like <code>111.111.111.111</code> (obv an example). </p>

<p><br>
<strong>EDIT</strong></p>

<p><br> the deployment's yaml is:<br></p>

<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: charting-rest-server
spec:
  selector:
    matchLabels:
      app: charting-rest-server
  replicas: 1
  template:
    metadata:
      labels:
        app: charting-rest-server
    spec:
      containers:
      - name: charting-rest-server
        image: *****.eu-west-2.amazonaws.com/charting-rest-server:latest
        ports: 
          - containerPort: 5000
</code></pre>

<p><br> the service's yaml:<br></p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name:  charting-rest-server-service
spec:
  type: LoadBalancer
  selector:
    app: charting-rest-server
  ports:
    - protocol: TCP
      port: 80
      targetPort: 5000
</code></pre>

<p>I already tried with the suggestions from the comments , using an ingress instance but I only ended up spending a huge amount of time trying to understand how they work , "am I doing something wrong"?/etc . </p>

<p>I will put the yaml file I used here but it made no change since my ADDRESS field was empty - no ip to use. </p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: charting-rest-server-ingress
spec:
  rules:
  - host: charting-rest-server-service
    http:
      paths:
      - path:/
        backend:
          serviceName: charting-rest-server-service
          servicePort: 80

</code></pre>

<p>I am stuck in that problem for so much time so I would appreciate some help.</p>

Flora Biletsiou
<p>You already created a <code>Service</code> with type <code>LoadBalancer</code>, but it looks like you have incorrect ports configured.</p>

<p>Your <code>Deployment</code> is created with <code>containerPort: 5000</code> and your <code>Service</code> is pointing to <code>targetPort: 9376</code>. Those needs to match for the <code>Deployment</code> to be exposed.</p>

<p>If you are having a hard time writing <code>yaml</code> for the <code>Service</code> you can expose the <code>Deployment</code> using following kubectl command:</p>

<pre><code>kubectl expose --namespace=tick deployment charting-rest-server --type=LoadBalancer --port=8765 --target-port=5000 --name=charting-rest-server-service
</code></pre>

<p>Once you fix those ports you will be able to access the service from outside using it's hostname:</p>

<pre><code>status:
  loadBalancer:
    ingress:
    - hostname: aba02b223436111ea85ea06a051f04d8-1294697222.eu-west-2.elb.amazonaws.com
</code></pre>

<p>I also recommend this guide <a href="http://docs.heptio.com/content/tutorials/aws-qs-services-elb.html" rel="nofollow noreferrer">Tutorial: Expose Services on your AWS Quick Start Kubernetes cluster</a>.</p>

<p>If you need more control over the http rules please consider using <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/" rel="nofollow noreferrer"><code>ingress</code></a>, you can read more about <a href="https://docs.aws.amazon.com/eks/latest/userguide/alb-ingress.html" rel="nofollow noreferrer">ALB Ingress Controller on Amazon EKS</a> also <a href="https://aws.amazon.com/blogs/opensource/network-load-balancer-nginx-ingress-controller-eks/" rel="nofollow noreferrer">Using a Network Load Balancer with the NGINX Ingress Controller on Amazon EKS</a>.</p>
