upmc-enterprises / elasticsearch-operator

manages elasticsearch clusters

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Non-AWS storage classes are invalid

andreykaipov opened this issue · comments

I'm running the operator off the master branch on GKE and after applying the example manifest, I noticed my PVCs were pending. Looking at the details of the pvc, I found the following error:

Failed to provision volume with StorageClass "us-east1-b": invalid option "encrypted" for volume plugin kubernetes.io/gce-pd

This is caused by PR #272 that will always add an encrypted option to the parameters section of the storage class. However, Kubernetes will always fail creating a volume if any of the parameters are invalid, so this option can only exist for AWS volumes. See the following lines from two providers:

To be fair, there is a comment above that CreateStorageClass function that says only AWS volumes are supported. However, the operator worked fine on GKE in the most recent release, so I'm not sure if you guys want to consider this a breaking change or not.

A quick solution would be to add a conditional check around that option, but as more disparate options are added, the code will get pretty messy. The alternative for now is to just create the storage classes yourself, similar to what the IBM example does (see #260).

Ahh right. That's a bug we shouldn't have introduced. We need to refactor out how those classes are handled. I kind of like allowing the operator to create it's own so that they aren't reused elsewhere in the cluster.