habitat-sh / habitat-operator

A Kubernetes operator for Habitat services
Apache License 2.0
61 stars 17 forks source link

Add ability to mount /files directory from a secret #351

Closed jamesc closed 5 years ago

jamesc commented 6 years ago

This adds the ability to mount the /files directory of a habitat service via a secret much like is done for config. What is different is that we add all the files that are part of the secret.

This is useful for services that e.g. load certificates via hab file upload right now but want to do it via a k8s primitive.

Signed-off-by: James Casey james@chef.io

HT154 commented 6 years ago

I think this is better handled by implementing arbitrary volumes (+volumeMounts, see #345). If the operator supported configuring these in Habitat objects and piping them through to the underlying StatefulSet, it wouldn't be necessary for create bespoke implementations for every feature like this.

jamesc commented 6 years ago

@HT154 I actually have a branch for the generic case too (https://github.com/jamesc/habitat-operator/tree/jc/generic-volume-mount) that I put together. I went the more limited way as it fitted in with the current model better (similar to the configSecretName and ringSecretName parameters).

I agree there is a bunch of additional options that we need to have in the operator longer term (nodeSelector is the biggest problem for me right now). What I'm challenged by right now is a clean abstraction for adding them into the operator yaml without exposing the underlying primitives like Stateful Set/Pod/... to the end user like we do now.