fetch-rancher-metadata
Command-Line utility to fetch and merge JSON data from Rancher metadata service
Install
$ npm install -g fetch-rancher-metadata
Simple get from rancher API
$ fetch-rancher-metadata --get "container/name"
mycontainer_1
Retrieving from stack Rancher-Compose.yml
myService:
scale: 1
metadata:
config:
option1: newValue1
option2: newValue2
Docker container local JSON file (e.g. Application-Config.json)
{
"option1": "oldValue",
"option2": "oldValue"
}
Execution within service docker container
$ fetch-rancher-metadata --key "config" --merge "Application-Config.json"
Result (e.g. Application-Config.json)
{
"option1": "newValue1",
"option2": "newValue2"
}