<p>Very simple question, I have a front-end app running in kubernetes. I would like to create a back-end containerized app that would also be in kubernetes obviously.</p>
<p>User actions in the frontend would need to trigger the execution of a command on the backend (<code>echo success!</code> for example). The UI also needs to know what was the command's output.</p>
<p>What is the best way to implement this in k8s?
Either through an internal service, or the two apps can also be in the same pods.</p>
<p>Perhaps there is some kind of messaging involved with applications such as rabbitMQ?</p>

<p>That depends on your application how you are planning.</p>
<p>Some people host frontend on bucket and from there send HTTP request to backend or so.</p>
<p>You can keep frontend and backend in different PODs or in a single POD also.</p>
<p>For example, if you are using the Node JS with express, you can run as simple API service POD also and keep frontend with it also to serve.</p>
<p>You can use the K8s service name for internal communication instead of adding the Message broker(RabbitMQ, Redis also can be used) unless your web app really needs it.</p>
<p>I would also recommend checking out the :  <a href="https://learnk8s.io/deploying-nodejs-kubernetes" rel="nofollow noreferrer">https://learnk8s.io/deploying-nodejs-kubernetes</a></p>
<p>Github repo of application : <a href="https://github.com/learnk8s/knote-js/tree/master/01" rel="nofollow noreferrer">https://github.com/learnk8s/knote-js/tree/master/01</a></p>
<p>Official example : <a href="https://kubernetes.io/docs/tutorials/stateless-application/guestbook/" rel="nofollow noreferrer">https://kubernetes.io/docs/tutorials/stateless-application/guestbook/</a></p>
