<p>I have a Pod that contains an image of a NodeJS project serving a build of vuejs (Manual SSR)
And I have an ingress controller to match a host to the service connecting to the Pod as follows:</p>
<p><a href="https://i.stack.imgur.com/tmNBA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tmNBA.png" alt="enter image description here" /></a></p>
<p>The Problem I'm facing is that static assets (CSS, JS and images) aren't served, so they need a &quot;server&quot; that handles these files.</p>
<p>I tried to have the Pod mounts two containers, NodeJS + Nginx container and copy the static file in Nginx /var/www/html and serve them from there using <code>nginx location rule</code> but it looks like an overkill to put that in production.</p>
<p>I'm curious how the best way to do this, maybe using Ingress controller rules/annotations? or some way that I am missing?</p>
<p>My Ingress controller looks like:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: ingress-nginx
  annotations:
    kubernetes.io/ingress.class: &quot;nginx&quot;
spec:
  rules:
    - host: test.ssr.local
      http:
        paths:
          - path: /
            backend:
              serviceName: service-internal-ssr
              servicePort: 8080
</code></pre>

<p>My Deployment looks like:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: ssr
spec:
  selector:
    matchLabels:
      app: ssr
  template:
    metadata:
      labels:
        app: ssr
    spec:
        - name: ssr
          image: ...
          resources:
            limits:
              cpu: 0.5
              memory: 1000Mi
            requests:
              cpu: 0.2
              memory: 500Mi
          ports:
            - name: app-port
              containerPort: 2055
---
apiVersion: v1
kind: Service
metadata:
  name: service-internal-ssr
spec:
  type: ClusterIP
  selector:
    app: ssr
  ports:
    - port: 8080
      targetPort: 2055
</code></pre>

<p>Thank you in advance</p>

Sletheren
<p>I would suggest serving your static content from something like a bucket or CDN, something as close to the client as possible that is better suited for this use case. Using K8s for this is overkill.</p>
