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 of service scale: 1 # User added metadata metadata: config: option1: newValue1 option2: newValue2
Docker container local JSON file (e.g. Application-Config.json)
Execution within service docker container
$ fetch-rancher-metadata --key "config" --merge "Application-Config.json"
Result (e.g. Application-Config.json)