Configuration rancher services with new metadata feature

Recently Rancher have introduced custom metadata for the services, which are set in a rancher-compose file. I am using confd-like containers in sidekicks for every my service with redis backend connected to my own custom configuration service. It has an UI and API, so i am able to change options for any service in any environment, and then service restart on the fly. When conf container is started it receives information about environment, service and stack and use them for configuration subscription. My configuration service support configuration inheritance, versioning and etc, it is focused to a proper way of manage, authorize access to configurations. When configuration is changed it modify redis keys, confd-container receive updates, substitute configuration and GRACEFULLY restart connected service via docker API.
Problem starting when i have to subscribe to the keys in a rancher metadata service, for example to a list of all containers running in a service, which can changed after start time, but i can’t use both redis and racher backend for the same template, so i am curious how could i use rancher backend and update rancher metadata for any service on the fly(without running upgrade or relaunch service in order to change it metadata)? are there any metadata API? I could use it in my configuration service as an alternative to the Redis store

There is a resource field of metadata on the service resource, which is a json map.

rancher-serverURL/v1/schema/service

will show you the API.

You can update metadata using upgrade.

@denise Am i correct saying that running upgrade for only metadata-change will shut down and bring up new instances?

Yes, upgrade will do stop/create new/start regardless of what changed.

Metadata is editable though, you don’t have to do an upgrade. It’s not in the UI yet, but if you click View in API on a service and then the Edit button in the top-right you can change the metadata key and that gets pushed down to the metadata service.