<p>I have followed the steps in the Udacity Full-Stack Nanodegree course to get a Kubernetes cluster running on AWS EKS. </p>

<p>The Service is running. Running the command <code>kubectl get services simple-jwt-api -o wide</code> returns:</p>

<pre><code>NAME             TYPE           CLUSTER-IP      EXTERNAL-IP                                                              PORT(S)        AGE   SELECTOR
simple-jwt-api   LoadBalancer   10.100.217.57   a32d4ab0969b149bd9fb47d2065aee80-335944770.us-west-2.elb.amazonaws.com   80:31644/TCP   51m   app=simple-jwt-api
</code></pre>

<p>Nodes appear to be running:</p>

<pre><code>NAME                                          STATUS   ROLES    AGE   VERSION               INTERNAL-IP     EXTERNAL-IP     OS-IMAGE         KERNEL-VERSION                  CONTAINER-RUNTIME
ip-192-168-3-213.us-west-2.compute.internal   Ready    &lt;none&gt;   80m   v1.15.10-eks-bac369   192.168.3.213   54.70.213.28    Amazon Linux 2   4.14.173-137.229.amzn2.x86_64   docker://18.9.9
ip-192-168-46-0.us-west-2.compute.internal    Ready    &lt;none&gt;   80m   v1.15.10-eks-bac369   192.168.46.0    34.220.32.208   Amazon Linux 2   4.14.173-137.229.amzn2.x86_64   docker://18.9.9
</code></pre>

<p>Pods appear to be running</p>

<pre><code>NAME                              READY   STATUS    RESTARTS   AGE   IP               NODE                                          NOMINATED NODE   READINESS GATES
simple-jwt-api-5dd5b9cf98-46ngm   1/1     Running   0          37m   192.168.22.121   ip-192-168-3-213.us-west-2.compute.internal   &lt;none&gt;           &lt;none&gt;
simple-jwt-api-5dd5b9cf98-kfgxf   1/1     Running   0          37m   192.168.20.148   ip-192-168-3-213.us-west-2.compute.internal   &lt;none&gt;           &lt;none&gt;
simple-jwt-api-5dd5b9cf98-xs6rp   1/1     Running   0          37m   192.168.60.136   ip-192-168-46-0.us-west-2.compute.internal    &lt;none&gt;           &lt;none&gt;
</code></pre>

<p>Docker file is:</p>

<pre><code>FROM python:stretch

COPY . /app
WORKDIR /app

RUN pip install --upgrade pip
RUN pip install -r requirements.txt

EXPOSE 8080

ENTRYPOINT ["gunicorn", "-b", ":8080", "main:APP"]
</code></pre>

<p>Deployment file is:</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: simple-jwt-api
spec:
  type: LoadBalancer
  ports:
    - port: 80
      targetPort: 80
  selector:
    app: simple-jwt-api
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: simple-jwt-api
spec:
  replicas: 3
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 2
      maxSurge: 2
  selector:
    matchLabels:
      app: simple-jwt-api
  template:
    metadata:
      labels:
        app: simple-jwt-api
    spec:
      containers:
        - name: simple-jwt-api
          image: CONTAINER_IMAGE
          securityContext:
            privileged: false
            readOnlyRootFilesystem: false
            allowPrivilegeEscalation: false
          ports:
            - containerPort: 8080
</code></pre>

<p>Why can't I access the app at a32d4ab0969b149bd9fb47d2065aee80-335944770.us-west-2.elb.amazonaws.com? </p>

Rob Bailey
<p>It looks like the targetPort in service <code>targetPort: 80</code> does not match the container port of POD i.e.: <code>containerPort: 8080</code>. Please change the targetPort in service to be 8080 and try again. </p>

<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: Service
metadata:
  name: simple-jwt-api
spec:
  type: LoadBalancer
  ports:
    - port: 80
      targetPort: 80
  selector:
    app: simple-jwt-api
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: simple-jwt-api
spec:
  replicas: 3
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 2
      maxSurge: 2
  selector:
    matchLabels:
      app: simple-jwt-api
  template:
    metadata:
      labels:
        app: simple-jwt-api
    spec:
      containers:
        - name: simple-jwt-api
          image: CONTAINER_IMAGE
          securityContext:
            privileged: false
            readOnlyRootFilesystem: false
            allowPrivilegeEscalation: false
          ports:
            - containerPort: 8080
</code></pre>
