<p>I am trying to deploy a simple HTML file to Kubernetes and host it using Nginx as a test. I am running into issues when copying over my website files.</p>
<p><strong>Dockerfile</strong></p>
<pre><code>FROM nginx:alpine
COPY ./public /usr/share/nginx/html/
</code></pre>
<p>When I build this image and run it using <code>docker run</code> the website loads fine and I see my index.html file located in my public directory. If I try to run this in a pod using <code>kubectl</code> the files don't get copied over. All I see when I go to my site is the default Nginx welcome page. I am not sure why this is the case. the cluster is hosted on AWS EKS so it's remote to all the files. This is the same as I build and host my docker image on GitLab.</p>
<p>The image builds without any errors and as I said works fine when run in vanilla docker. It's only when I move over to Kubernetes that I run into issues.</p>
<p>I've made the project public so you guys can see all the abstractions that I might have left out in my question.</p>
<p><a href="https://gitlab.com/k8group/k8site" rel="nofollow noreferrer">https://gitlab.com/k8group/k8site</a></p>
<p>Any help is appreciated.</p>
<p>Best Regards,
Eddy.</p>

IdecEddy
<p>I know if is only this, but in the quick glance I can say the key value in your ingress template must be pointing to the service port, not to the pod container port. Check the right config below:</p>
<pre><code>    kind: Service
    apiVersion: v1
    metadata:
      name: k8site
    spec:
      selector:
        app: k8site
      ports:
        - port: 8080
          targetPort: 80
    ---
    apiVersion: networking.k8s.io/v1beta1
    kind: Ingress
    metadata:
      annotations:
        ingress.kubernetes.io/cache-enable: &quot;false&quot;
      name: k8site-ingress
    spec:
      rules:
      - host: prod.pepefanclub.com
        http:
          paths:
          - backend:
              serviceName: k8site
              servicePort: 8080 &lt;--- this must be the service port, that is 8080
</code></pre>
