I have an application that is run as a service in Azure aks (kubernetes) cluster. This application pulls data from a database and puts it in a file.
As I understand I first need to create a docker image and push it to Azure aks registry. Once this is done I need to create a pod and run this application as a service.
The question that I have is -
a) What Azure or docker option I need to use to store data so that it does not get deleted (removed) if pod is crashed or deleted or rescheduled on another node and data remains available in a file once the file is created.
b) Searching on internet, it appears I can use Azure persistent disk or file storage by creating it statically or dynamically using kubectl command. However the part that I do not understand is - after creating the persistent storage using kubectl apply -f how to I make use of azure disk storage ?
Do I need to modify dockerfile and specify a mount path (volume?) and also specify the mount path in application (e.g. /mnt/app-data) where application can write data to file.
While there might be standard mechanism to store the data in aks cluster I am somewhat new to it and looking forward to expert's advice how to create and use storage in Azure ( aks cluster to be precise ) for an application to write data to it.