Persistence for Static files¶
The recommended way to store static files is to use an external shared storage such as using S3 for Django storage. That said, it is also possible to leverage Kubernetes Persistent Volumes, following the below setting a Persistent Volume Claim is created and mounted it at the /opt/nautobot/static
path of the Pods.
nautobot:
persistence:
enabled: true
storageClass: "your-storage-class"
accessMode: "ReadWriteMany"
size: "1Gi"
Unfortunately, if the underlying storage solution does not support the ReadWriteMany
option, you have to use node affinity in order for the Pods of the deployment to be scheduled on the same node as the Persistent Volume. Below there is an example using Node labels as selector to create the PVC and schedule the Pods in the same node.