Ah, misunderstood. That's not possible today, though I know there's designs in progress for choosing a default storage class (though I don't think they take in account different per-project or per-user defaults)
I was more thinking:
- user has annotation with region=datacenter1
- creates new project1
- project1 with node-selector=region=datacenter1
- user deploys a template (eg. mysql-persistent)
- sane default provided as input would be storage-class=datacenter1
Storage classes were intended to be globally visible. One per project would be both unmanageable and would leak a lot of info about the projects on the system.
Question was in regards to templates that users would deploy in an existing project (but it'd also be useful for project request template).
storage-class-per-user or storage-class-per-project would provide a dynamic sane default. Use case being, a user's project node selector is allocated to a specific region. I don't believe it's possible to allocate PVs (or dynamic PVs) to a specific region/datacenter?
It's not possible to reference labels or annotations on existing
objects as input parameter values for a template today.
Are you referring to the project template, or a template a user would
instantiate in an existing project?
Mechanics aside, I didn't think storage-class-per-user or
storage-class-per-project was a recommended approach
> On Oct 23, 2016, at 7:15 PM, Andrew Lau <andrew andrewklau com> wrote:
> Is it possible to reference annotations from a project or user label/annotation to be used in templates?
> Eg. With kube 1.4 storage class, can we set the templates pvc storage class to automatically be the value of the user/project annotation/label?
> users mailing list
> users lists openshift redhat com