Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Persistent volumes are created dynamically, w/ default storageClass #363

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DougReeder
Copy link
Contributor

@DougReeder DougReeder commented Nov 11, 2024

hostPath volumes are labeled a "dangerous escape hatch" in the documentation, and will be discarded if there is ever a second node. There are several mechanisms where this may happen, even for a "single-node" cluster, such as when the version of Kubernetes is upgraded by spinning up a new node, then draining and spinning down the old.

This PR creates volumes

  1. off the node, so they outlast nodes
  2. using the cluster's default storage class. This is either the provider's default (which is some standard/general purpose flavor of storage for every provider I checked), or was specifically set by the cluster's administrator.
Cloud Provider Default StorageClass Name Default Provisioner
Amazon Web Services gp2 aws-ebs
Microsoft Azure standard azure-disk
Google Cloud Platform standard gce-pd
OpenStack standard cinder
VMware vSphere thin vsphere-volume
DigitalOcean do-block-storage dobs.csi.digitalocean.com
Scaleway sbs-default csi.scaleway.com
  1. that can be backed-up and restored on a different provider
  2. can be expanded (usually)

Currently, DigitalOcean charges $1/mo for a 10GB volume, so this PR adds $2/mo to a default installation.

See my blob post for background.

It also creates the pgsql volume with accessMode ReadWriteOncePod. If someone ever tries to scale up the pgsql deployment, this will ensure only one PostgresQL engine can access the files, so they aren't corrupted. (ReadWriteOnce allows all pods on the node to access the volume.)

It also tweaks the mountPath for PostgresQL so it's not creating files and directories at the root of the volume, so PostresQL doesn't balk at the presence of a lost+found directory.

It also removes the duplicate Secret.

This PR has been tested on Digital Ocean; it would be desirable to validate it on another provider.

@DougReeder DougReeder marked this pull request as draft January 7, 2025 18:02
@DougReeder DougReeder marked this pull request as ready for review January 7, 2025 18:32
@DougReeder
Copy link
Contributor Author

@Exairnous has pointed out this is a breaking change. I think the best way to deal with this is a flag in input-values.yaml that defaults to hostPath volumes. Then admins can migrate to external storage independently of update to the latest Hubs implementation. That also provides a "budget" option, which is also useful for test clusters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant