1

I was wondering what is best way to setup a static web application in kubernetes:

  1. Place web app files inside the container image.
  2. Place web app files in a share volume (mounted to pods).

In scenario #1 for every release (minor or major), we should deploy a new image and update the deployment.
In scenario #2 since files are in a shared location (like NFS share), it is easy to update files and releases without changing the kubernetes deployment.
So what is the recommended way for this scenario?

0

1 Answer 1

3

First, in my opinion your deployment has to be immutable. Each release is tagged and you have a kind of bijection between your docker image and your git tags.

Second, without an NFS share or a PVC you are reducing the complexity of your deployment and the network traffic.

So, as a general best practice: Keep it simple and immutable!

1
  • I also think 1st solution is better because, as you mentioned, there isn't need for complex storage solutions. I just want see opinions. Commented Mar 10, 2022 at 17:13

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.