How to provision custom components[web-server] after deploying the pod

Hi, I am new to the Kubernetes world.

I would like to provision my custom deployed component such as a web server in a pod.
What I want is to run generate some files for my custom web server which are not included in the docker image of the component.
Steps to set up the server:

  1. Create a container of the component(web-server)
  2. Create the files required by the component

I only want to do this once i.e., if I have three pods of the same component, I don’t want to repeat it with every pod.

If possible, can you use a configmap? If not, maybe an init container+a read/write/many pvc that checks for the files existence, if they don’t exist - generate them.

@mrbobbytables Init containers run before running the application container.
I want the opposite of that…the files need to be created by interacting with the web application, so it’s a post action. So is there any specific utility for that?

Not really directly - you’d need a shared persistent volume and some level of “wait for config” till it’s done.