<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>

<p>So it looks like this was a case of the image not being pulled. I changed the commit tag from master to a hash and the site started working.</p>
<p>changing a variable in my ci pipeline from</p>
<p><code>IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG</code></p>
<p>to</p>
<p><code>IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA</code></p>
<p>thanks, @EugeneDW for pointing me in the correct direction.</p>
