I am deploying a container in AKS cluster.
I want to mount a configuration folder ( size 200+ MB ) into this container. The configuration folder is present in a git repo. Each customer has his own configuration data and is stored in a separate branch in same repo.
I am thinking of below options to load the configuration folder into the container:
- Persistent volume claims - PVC I will create a file share and copy the config folder into it. Mount the file share into container using PVC. In this approach I need to add the storage access key/sas token to kubernetes secrets.
- Zip the config folder and copy it to a Blob storage. In container startup script download the zio from blob storage and mount to desired location. In this approach I have to use a SAS token to access the storage account. (This token will be saved as secret in kubernetes)
- In container startup script, git clone the repo containing the config folder, download it and copy to desired location. In this approach I need to use PAT token to clone the git.
- Copy the config folder into the docker image itself. In this approach I dont have to worry how to load the config folder in container. However since the configuration folder is customer specific and there are 100+ customers, this results in around 100+ image tags. (We have added tags for customer)
Can you please guide me which is the best option? Is there any other better approach.
I have read that there are security issues in using PVC shared volumes which could grant root permissions on node to an attacker. And also there are security concerns in using git inside a container. Can you provide more info on why/how are these security concerns?