title: Backend and Frontend in same kubernetes yaml file?
body: <p>I am digging into nginx, Kubernetes and SSL as I am trying to deploy my web app onto Kubernetes via Google Kubernetes Engine (GKE).</p>
  
  <p>A little about my project:</p>
  
  <ul>
  <li>My frontend is a React web application</li>
  <li>My backend is a Node Express API service</li>
  </ul>
  
  <p>They are on separate repos (ex: frontend repo and backend repo)</p>
  
  <p>I am planning on using nginx to serve my frontend and proxy requests to my backend.</p>
  
  <p>My question is...</p>
  
  <p>Would it be possible to have both my backend and frontend within the same Kubernetes config yaml file, and if possible, is this best practice to do so?</p>
  
  <p>How I see it is...</p>
  
  <p>In my <code>nginx.conf</code> file, I will have a server section that has a <code>proxy_pass</code> to something like <code>localhost:8000</code>, which is the port of the backend. I would assume this would work if both are within the same container and local network.</p>
  
  <p>I would then probably have a load balancer that points to nginx.</p>
  
  <p>Any help or advice is appreciated! I hope this makes sense (still very new to this)!</p>