0

I would like to scale a kubernetes stateful set in EKS which serves static data. The data should be shared where possible, which means by availability zone.

Can I specify a volume claim template to make this possible? Or is there another mechanism?

I also need to initialize the volume (in an init-container) when the first node joins. Do I need to provide some external locking mechanism rather than just checking if volume is empty?

shaunc
  • 5,317
  • 4
  • 43
  • 58

1 Answers1

0

If you want your pods to share static data, then you can:

  1. Put the data into the Persistent Volume
  2. Mount the same volume into the Pods (with ReadOnlyMany)

A few comments:

  • Here you can find the list of volumes, so you can choose the one that fits your needs
  • Since every pod serves the same data, you may use Deployment instead of StatefulSet, StatefulSets are when each of your pod is different
  • If you need the first pod to initialize the data, then you can either use initContainer (then use ReadWriteMany instead of ReadOnlyMany). Depending on what you try to do exactly, but maybe you can first initialize the data and then start your Deployment (and Pods), then you'd not need to lock anything
Rafał Leszko
  • 4,939
  • 10
  • 19