-
Notifications
You must be signed in to change notification settings - Fork 262
Conversation
…e#382) Signed-off-by: David Chung <[email protected]>
Signed-off-by: David Chung <[email protected]>
Please sign your commits following these rules: $ git clone -b "metadata-spi-0" [email protected]:chungers/infrakit.git somewhere
$ cd somewhere
$ git rebase -i HEAD~842354430904
editor opens
change each 'pick' to 'edit'
save the file and quit
$ git commit --amend -s --no-edit
$ git rebase --continue # and repeat the amend for each commit
$ git push -f Amending updates the existing PR. You DO NOT need to open a new one. |
Signed-off-by: David Chung <[email protected]>
Signed-off-by: David Chung <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #396 +/- ##
==========================================
- Coverage 62.57% 61.73% -0.85%
==========================================
Files 56 62 +6
Lines 3137 3549 +412
==========================================
+ Hits 1963 2191 +228
- Misses 945 1108 +163
- Partials 229 250 +21
Continue to review full report at Codecov.
|
Example usage -- here the swarm and vagrant plugins optionally exported some metadata (such as version and plugin interface implemented): The
Note that it's possible to have JSON object as value (e.g. |
Signed-off-by: David Chung <[email protected]>
Signed-off-by: David Chung <[email protected]>
Signed-off-by: David Chung <[email protected]>
Signed-off-by: David Chung <[email protected]>
Signed-off-by: David Chung <[email protected]>
Signed-off-by: David Chung <[email protected]>
Azure ddc update
The Metadata SPI is a service provider interface that makes it possible for plugins that implement this interface to export read-only data that can be accessed using a path. For example, it is possible for compliant plugins to expose useful parameters like:
GET
/region/us-west-2/vpc/vpc1234/cidr
returns172.168.0.0/16
GET
/region/us-west-2/vpc/vpc1234/az/a/subnet/sn-i234/cidr
returns172.168.100.0/24
GET
/flavor-swarm/join/tokens/manager
returns the local swarm flavor's manager join tokenGET
/flavor-swarm/join/ip
returns the local swarm flavor's IP of the manager to joinGET
/instance-aws/metadata/iam
returns the IAM role of the host that is running an AWS instance pluginetc., ...
This makes it possible to create plugins that can use a variety of methods such as via API calls or via metadata (e.g. on AWS, via HTTP GET at link local address 169.254.169.254:80), to export useful configuration parameters on resources that are either created by infrakit or via some other means.
When a set of infrakit plugins respectively expose their relevant state / configuration data using the same metadata mechanism, the user has a unified way to access all the interesting infrastructure parameters in a global namespace. Infrakit CLI can then aggregate all this from all plugins for not only informational display but also for authoring configuration / specifications by making this metadata available to templates.
Example
infrakit plugin --config-url file://$PWD/examples/flavor/swarm/plugins.json start --exec os --wait instance-vagrant flavor-swarm group-stateless
or in the long form:
Note you can traverse these as though they are in a filesystem:
You can get the values via
cat
:Note that sometimes objects are exposed at a metadata path. You can also list the actual attributes and cat them:
This is also integrated in the
template
command: