Update many statics files in many pod in kubernetes

Viewed 33

What is best practice for update many statics files (css, js, images) in many pod in kubernetes?

Now git-sync run every times and sync statics files (css, js, images) from git repository.

Git repository sometimes update, delete, create new statics files (css, js, images).

Thanks!

1 Answers

In your situation, you can use Persistent Volumes.

A PersistentVolume (PV) is a piece of storage in the cluster that has been provisioned by an administrator or dynamically provisioned using Storage Classes. It is a resource in the cluster just like a node is a cluster resource. PVs are volume plugins like Volumes, but have a lifecycle independent of any individual Pod that uses the PV. This API object captures the details of the implementation of the storage, be that NFS, iSCSI, or a cloud-provider-specific storage system.

Kubernetes also supports Volume Snapshots. You can easy backup and restore your persistent volume.

See also this tutorial - it shows how to store data into Persistent Volumes.

Related