Azure / kubernetes-keyvault-flexvol

Azure keyvault integration with Kubernetes via a Flex Volume
MIT License
253 stars 84 forks source link

Consider using a CRD for holding Key Vault configuration #77

Open vplauzon opened 5 years ago

vplauzon commented 5 years ago

This really is a UX improvement as it wouldn't enable new scenarios per se.

The configuration we need to put under "flexVolume" is quite verbose. Most of it gets repeated in each pod using the same key vault:

From the DRY principle, it would be nice to have that configuration in a separate object (CRD) and have pod simply referring to that CRD.

ritazh commented 5 years ago

The idea here is to use existing kubernetes objects, not create a new one.

allantargino commented 5 years ago

How about storing them in a ConfigMap?

ritazh commented 5 years ago

Hi @allantargino, Like Kubernetes Secrets, ConfigMaps are persisted to etcd as well. So if you are ok with using configmaps to hold data from key vault, then you probably would be ok with using Secrets. But if you are concerned with the security aspect of persisting data to etcd, then this solution will allow you to pull data from key vault without persisting anything to etcd.

allantargino commented 5 years ago

Hi @ritazh, thanks for answering the question. But I meant how about storing the properties keyvaultname, resourcegroup, subscriptionid, tenantid (and others) in a ConfigMap? This way, the user could just pass a secretRef (containing the principals) and a configMapRef (containing these other properties). This would make the pod spec less verbose as @vplauzon mentioned.