-
Notifications
You must be signed in to change notification settings - Fork 40k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Secret volume should refresh when secrets are updated #18372
Comments
Can you link to the discussion on config map refresh? |
We've gone over secret refreshing several times, and every time @erictune and I justified it not being refreshed. Will want a clear argument for it being required or expected. |
I was also surprised when I heard config map can refresh. Does it update atomically? |
Yes it updates atomically (well, it will - downward API does, or at least I On Wed, Dec 9, 2015 at 4:05 PM, Eric Tune notifications@github.com wrote:
|
Downward API updates atomically. We talked about config volume On Thu, Dec 10, 2015 at 2:05 AM, Tim Hockin notifications@github.com
|
I think there are 2 patterns people will use with ConfigMap:
Updating ConfigMap and not propagating the change is just confusing. Expecting users to kill pods in order to implicitly pick up changes lacks transparency and predictability, which is why we moved away from that approach in rolling update. Other than "it was simpler to implement", what's the rationale for not propagating Secret updates? |
I think it was @erictune who argued that updating Secrets was semantically On Thu, Jan 7, 2016 at 7:58 PM, Brian Grant notifications@github.com
|
I think the idea that I have to stop my application (aka delete the pod) to update a secret or config is weird... I should be able to update the secret/config and send my app a SIGHUP. I'm all for automatic update of the files in existing pods... |
Eric and I both discussed this at the last face to face (last year) and On Tue, Jan 12, 2016 at 12:25 PM, Eric Paris notifications@github.com
|
I spent some time today combing through old github comments, attempting to unearth our prior discussion, and was unsuccessful. Does anyone have a reason not to do this? I do seem to remember as @thockin does that @erictune had some concerns about updating secrets but wasn't able to find them in the github issues I looked through. Eric, do you happen to remember any of those, or even better, have links to github comments you expressed those reservations in memorized? As an aside, it truly, truly sucks trying to find old comments via the github web UI. |
Some issue I can think of:
|
On Sun, Jan 31, 2016 at 2:52 PM, Eric Tune notifications@github.com wrote:
True. OTOH, live updates seems like something you should try before
IMO this is a relatively minor point
We understand how to update files within a mounted directory. |
I chatted with @erictune yesterday about this issue. Where we settled is: we want to make ConfigMap and Secret as close to one another as possible, and people want the features that the atomic writer offers for use with secrets, so we should:
We talked about adding a way to SIGHUP containers that mount the volume when content is updated. I think users want this but I don't know that we settled on whether to do it right now; will file a separate issue for that. I'll note here that Eric brought up that their may be races when signalling containers, and we should detect containers referencing old versions of files. |
Sadly, since we can't yet share PID namespaces, signals will have to come On Sun, Apr 3, 2016 at 9:40 PM, Paul Morie notifications@github.com wrote:
|
💩 |
Re: picking up new config: The user-centric question for configmap updates (and secrets now that we are going to allow updates) is I updated my configMap/Secret... Now when should I expect to see my app use the new files? If we think the system should be able to answer this for the user, then it would need to know the semantics of the application in the container. We thought there were 3 styles of applications:
Users of secrets and configmap need to be aware which type of app they have, so they can know what the steps are to complete a config update / secret rotation for their app. I wonder if we should define something like: type ConfigPushAction string
const (
// Restart means that the app requires restart to pick up changes to a configuration file.
ConfigPushActionRestart ConfigPushAction = "Restart"
// Hup means that the app requires a sighup to pickup changes to a configuration file.
ConfigPushActionHup ConfigPushAction = "Hup"
// None means that the app can detect new config files and so requires no action after config is pushed.
ConfigPushActionNone ConfigPushAction = "None"
)
...
type Container struct {
...
ConfigPushAction ConfigPushAction `omitempty, name:configPushAction`
...
} It would get tricky though when you start to get into which pid to signal (maybe better to use the ExecProbe model instead, or for special cases). It also gets tricky if different files have different semantics. But, if you get it right, then you can automate more of the update process. |
Do I see it correctly that there's currently no way to check whether/when a configmap volume update happened? @erictune's suggestion seems very reasonable from my perspective. How's the general sentiment for implementing it? |
I'd be fine with adding a notifier concept - I bet it comes up in other
On Tue, Apr 19, 2016 at 4:57 AM, Fabian Reinartz notifications@github.com
|
You can watch the volume's |
I was thinking of something on the Kubernetes side. For Prometheus at least, it was a very intentional choice to not us inotify for the configuration due to a variety of issues encountered that made it an unfeasible cross-platform solution. |
@fabxc you mentioned in your post
I could not find a way to trigger it via cli (kubectl), does it exist only as API? If you know how to use configMap update/refresh with cli, appreciate if you could share. |
@sbezverk i haven't tried it, but it is referenced here: https://github.com/kubernetes/kubernetes/blob/master/docs/design/configmap.md |
If it doesn't refresh automatically, is there a way to trigger a volume refresh manually without having to kill the pod? Use case: updating nginx config and sending it a HUP signal |
@sgrimee not yet, it has been requested though, will link later. |
err, I answered the wrong question. It does refresh automatically, but it's not instantaneous. The volume is eventually consistent, just like downward API volume. |
@pmorie this is done now, yes? Or is there more to do? |
nope, it's done. On Friday, June 3, 2016, Tim Hockin notifications@github.com wrote:
|
Closed by #25285 |
Can this refresh be enabled/disabled? It's causing me issues when renaming the files in a mounted secret and changing permissions, see #28898 |
I've read through this and several related issues, not to mention any documentation I can find. It seems that config reloads for pods that use HUP signals is implemented; I just don't see how to implement it. Perhaps I'm just obtuse, but it would make sense to me if there was a way to define this in a configmap, deployment, service, or container spec so that when I update a configmap that a pod is using that the pod updates the config file from the API and then sends the correct HUP signal. Did I miss something obvious? Would really appreciate someone pointing me in the right direction. My use case is NGINX as a load balancer for InfluxDB/relay. I'm attempting an HA configuration and will need nodes to be able to update the NGINX configmap as they enter various stages of the recovery process; and I need to do this without dropping connections (i.e. destroying and re-creating the NGINX pod). Again - any help appreciated. |
Initially we decided for simplicity's sake to forego making the secret volume plugin refresh when data was updated. Now that we have the downward API volume, which refreshes, and have decided that the configMap volume should refresh, it makes sense that the secret volume should too.
@erictune @thockin @bgrant0607 @smarterclayton
cc @kubernetes/rh-cluster-infra
The text was updated successfully, but these errors were encountered: