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 mechanism 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" 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
  1. that can be backed-up and restored on a different provider
  2. can be expanded (usually)

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. (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.

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