Skip to content
This repository was archived by the owner on Feb 22, 2022. It is now read-only.

Use "volume.beta.kubernetes.io/storage-class" for the MySQL pvc if the storage type is specified #253

Closed
andrewhowdencom opened this issue Nov 27, 2016 · 2 comments

Comments

@andrewhowdencom
Copy link
Contributor

andrewhowdencom commented Nov 27, 2016

Hallo,

Using MySQL to organise some local development stuff. The cluster version running locally is hyperkube v1.4.4, and doesn't like volume.alpha.kubernetes.io/storage-class:default so much. I cannot seem to just provision the asspciated pv and just have them find each other and resolve, instead I find:

$ kubectl describe pvc
Name:		magento-prometheus-mysql
Namespace:	default
Status:		Pending
Volume:		
Labels:		<none>
Capacity:	
Access Modes:	
Events:
  FirstSeen	LastSeen	Count	From				SubobjectPath	Type		Reason			Message
  ---------	--------	-----	----				-------------	--------	------			-------
  3m		4s		14	{persistentvolume-controller }			Warning		ProvisioningFailed	cannot find volume plugin for alpha provisioning

Prometheus appears to solve this by specifying volume.alpha.kubernetes.io/storage-class:default class if the user doesn't indicate a storage class, and volume.beta.kubernetes.io/storage-class:{{ .Values.storagClass}} if the user does. Using the beta storage class attribute allows me to just create the PVs locally so I can hack on stuff. It also might help with other people not running k8s in non-standard environments.

I suggest a similar approach be taken for MySQL, and perhaps documented somewhere? I can get a PR up today if someone says "LGTM" in the next couple hours, though I don't understand it well enough to test it thoroughly.

Ref: https://github.com/kubernetes/charts/blob/19f85b0bc2b500691e4707f54f25302138f050da/stable/prometheus/templates/alertmanager-pvc.yaml#L6-L10

Edits: I am trying this. Interestingly, it's not working. Rendering badly for some reason
More edits: That prometheus example doesn't seem to be using chomp properly The - operator needs to be behind the else, I think.

Not yet good enough for a PR (need to adjust the values.yaml to explain things), but seems to work:

master...littlemanco:ahowden_make-mysql-user-beta-storage-class#diff-918808a355911deb9ce5a723c449a669R7

@prydonius
Copy link
Member

@andrewhowdencom only just saw this, I dropped #255 yesterday which updates all the charts to use the same approach as Prometheus (and fixes the formatting in Prometheus). See the discussion in #116 also.

@andrewhowdencom
Copy link
Contributor Author

Awesome! I probably should have found that issue initially. I'll close this as a dupe of that issue, and subscribe to that pull request.

Thanks man!

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

No branches or pull requests

2 participants