@@ -114,50 +114,55 @@ $ build/infrakit instance --name instance-file describe
114114ID LOGICAL TAGS
115115```
116116
117- Let's tell the group plugin to ` watch ` our group by providing the group plugin with the configuration:
117+ Let's tell the group plugin to ` commit ` our group by providing the group plugin with the configuration:
118118
119119``` shell
120- $ build/infrakit group watch cattle.json
121- watching cattle
120+ $ build/infrakit group commit cattle.json
121+ Committed cattle: Managing 5 instances
122122```
123123
124124The group plugin is responsible for ensuring that the infrastructure state matches with your specifications. Since we
125125started out with nothing, it will create 5 instances and maintain that state by monitoring the instances:
126126``` shell
127127$ build/infrakit group describe cattle
128- ID LOGICAL TAGS
129- instance-1475104926 - infrakit.config_sha=Y23cKqyRpkQ_M60vIq7CufFmQWk =,infrakit.group=cattle,project=infrakit,tier=web
130- instance-1475104936 - infrakit.config_sha=Y23cKqyRpkQ_M60vIq7CufFmQWk =,infrakit.group=cattle,project=infrakit,tier=web
131- instance-1475104946 - infrakit.config_sha=Y23cKqyRpkQ_M60vIq7CufFmQWk =,infrakit.group=cattle,project=infrakit,tier=web
132- instance-1475104956 - infrakit.config_sha=Y23cKqyRpkQ_M60vIq7CufFmQWk =,infrakit.group=cattle,project=infrakit,tier=web
133- instance-1475104966 - infrakit.config_sha=Y23cKqyRpkQ_M60vIq7CufFmQWk =,infrakit.group=cattle,project=infrakit,tier=web
128+ ID LOGICAL TAGS
129+ instance-5993795900014843850 - infrakit.config_sha=006438mMXW8gXeYtUxgf9Zbg94Y =,infrakit.group=cattle,project=infrakit,tier=web
130+ instance-6529053068646043018 - infrakit.config_sha=006438mMXW8gXeYtUxgf9Zbg94Y =,infrakit.group=cattle,project=infrakit,tier=web
131+ instance-7203714904652099824 - infrakit.config_sha=006438mMXW8gXeYtUxgf9Zbg94Y =,infrakit.group=cattle,project=infrakit,tier=web
132+ instance-8430289623921829870 - infrakit.config_sha=006438mMXW8gXeYtUxgf9Zbg94Y =,infrakit.group=cattle,project=infrakit,tier=web
133+ instance-9014687032220994836 - infrakit.config_sha=006438mMXW8gXeYtUxgf9Zbg94Y =,infrakit.group=cattle,project=infrakit,tier=web
134134```
135135
136136The Instance Plugin can also report instances, it will report all instances across all groups (not just ` cattle ` ).
137137
138138``` shell
139139$ build/infrakit instance --name instance-file describe
140- ID LOGICAL TAGS
141- instance-1475104926 - infrakit.config_sha=Y23cKqyRpkQ_M60vIq7CufFmQWk =,infrakit.group=cattle,project=infrakit,tier=web
142- instance-1475104936 - infrakit.config_sha=Y23cKqyRpkQ_M60vIq7CufFmQWk =,infrakit.group=cattle,project=infrakit,tier=web
143- instance-1475104946 - infrakit.config_sha=Y23cKqyRpkQ_M60vIq7CufFmQWk =,infrakit.group=cattle,project=infrakit,tier=web
144- instance-1475104956 - infrakit.config_sha=Y23cKqyRpkQ_M60vIq7CufFmQWk =,infrakit.group=cattle,project=infrakit,tier=web
145- instance-1475104966 - infrakit.config_sha=Y23cKqyRpkQ_M60vIq7CufFmQWk =,infrakit.group=cattle,project=infrakit,tier=web
140+ ID LOGICAL TAGS
141+ instance-5993795900014843850 - infrakit.config_sha=006438mMXW8gXeYtUxgf9Zbg94Y =,infrakit.group=cattle,project=infrakit,tier=web
142+ instance-6529053068646043018 - infrakit.config_sha=006438mMXW8gXeYtUxgf9Zbg94Y =,infrakit.group=cattle,project=infrakit,tier=web
143+ instance-7203714904652099824 - infrakit.config_sha=006438mMXW8gXeYtUxgf9Zbg94Y =,infrakit.group=cattle,project=infrakit,tier=web
144+ instance-8430289623921829870 - infrakit.config_sha=006438mMXW8gXeYtUxgf9Zbg94Y =,infrakit.group=cattle,project=infrakit,tier=web
145+ instance-9014687032220994836 - infrakit.config_sha=006438mMXW8gXeYtUxgf9Zbg94Y =,infrakit.group=cattle,project=infrakit,tier=web
146146```
147147
148- At any point you can safely ` unwatch ` a group. This will instruct _ InfraKit_ to cease active monitoring:
148+ At any point you can safely ` free ` a group. This is a non-destructive action, which instructs _ InfraKit_ to cease
149+ active monitoring. No instances are affected, but _ InfraKit_ will no longer manage them.
149150``` shell
150- $ build/infrakit group unwatch cattle
151+ $ build/infrakit group free cattle
152+ Freed cattle
151153```
152154
153- You can ` watch ` the group to start monitoring it again:
155+ You can ` commit ` the group to start monitoring it again:
154156``` shell
155- $ build/infrakit group watch cattle.json
157+ $ build/infrakit group commit cattle.json
158+ Committed cattle: Managing 5 instances
156159```
157160
158- Check which groups are being watched :
161+ Check which groups are being managed :
159162``` shell
160163$ build/infrakit group ls
164+ ID
165+ cattle
161166```
162167
163168Now let's update the configuration by changing the size of the group and a property of the instance. Save this file as
@@ -209,8 +214,8 @@ $ diff cattle.json cattle2.json
209214
210215Before we do an update, we can see what the proposed changes are:
211216``` shell
212- $ build/infrakit group describe-update cattle2.json
213- Performs a rolling update on 5 instances, then adds 5 instances to increase the group size to 10
217+ $ build/infrakit group commit cattle2.json --pretend
218+ Committing cattle would involve: Performing a rolling update on 5 instances, then adding 5 instances to increase the group size to 10
214219```
215220
216221So here 5 instances will be updated via rolling update, while 5 new instances at the new configuration will
@@ -219,51 +224,48 @@ be created.
219224Let's apply the new config:
220225
221226``` shell
222- $ build/infrakit group update cattle2.json
223-
224- # ..... wait a bit...
225- update cattle completed
227+ $ build/infrakit group commit cattle2.json
228+ Committed cattle: Performing a rolling update on 5 instances, then adding 5 instances to increase the group size to 10
226229```
227- Now we can check:
228230
231+ If we poll the group, we can see state will converging until all instances have been updated:
229232``` shell
230233$ build/infrakit group describe cattle
231- ID LOGICAL TAGS
232- instance-1475105646 - infrakit.config_sha=BXedrwY0GdZlHhgHmPAzxTN4oHM =,infrakit.group=cattle,project=infrakit,tier=web
233- instance-1475105656 - infrakit.config_sha=BXedrwY0GdZlHhgHmPAzxTN4oHM =,infrakit.group=cattle,project=infrakit,tier=web
234- instance-1475105666 - infrakit.config_sha=BXedrwY0GdZlHhgHmPAzxTN4oHM =,infrakit.group=cattle,project=infrakit,tier=web
235- instance-1475105676 - infrakit.config_sha=BXedrwY0GdZlHhgHmPAzxTN4oHM =,infrakit.group=cattle,project=infrakit,tier=web
236- instance-1475105686 - infrakit.config_sha=BXedrwY0GdZlHhgHmPAzxTN4oHM =,infrakit.group=cattle,project=infrakit,tier=web
237- instance-1475105696 - infrakit.config_sha=BXedrwY0GdZlHhgHmPAzxTN4oHM =,infrakit.group=cattle,project=infrakit,tier=web
238- instance-1475105706 - infrakit.config_sha=BXedrwY0GdZlHhgHmPAzxTN4oHM =,infrakit.group=cattle,project=infrakit,tier=web
239- instance-1475105716 - infrakit.config_sha=BXedrwY0GdZlHhgHmPAzxTN4oHM =,infrakit.group=cattle,project=infrakit,tier=web
240- instance-1475105726 - infrakit.config_sha=BXedrwY0GdZlHhgHmPAzxTN4oHM =,infrakit.group=cattle,project=infrakit,tier=web
241- instance-1475105736 - infrakit.config_sha=BXedrwY0GdZlHhgHmPAzxTN4oHM =,infrakit.group=cattle,project=infrakit,tier=web
234+ ID LOGICAL TAGS
235+ instance-1422140834255860063 - infrakit.config_sha=eB2JuP0c5Sf41X5e2vc2gJ4ZTVg =,infrakit.group=cattle,project=infrakit,tier=web
236+ instance-1478871890164117825 - infrakit.config_sha=eB2JuP0c5Sf41X5e2vc2gJ4ZTVg =,infrakit.group=cattle,project=infrakit,tier=web
237+ instance-1507972539885141336 - infrakit.config_sha=eB2JuP0c5Sf41X5e2vc2gJ4ZTVg =,infrakit.group=cattle,project=infrakit,tier=web
238+ instance-1665488406863611296 - infrakit.config_sha=eB2JuP0c5Sf41X5e2vc2gJ4ZTVg =,infrakit.group=cattle,project=infrakit,tier=web
239+ instance-2340140454359833670 - infrakit.config_sha=eB2JuP0c5Sf41X5e2vc2gJ4ZTVg =,infrakit.group=cattle,project=infrakit,tier=web
240+ instance-2796731287627125229 - infrakit.config_sha=eB2JuP0c5Sf41X5e2vc2gJ4ZTVg =,infrakit.group=cattle,project=infrakit,tier=web
241+ instance-285480170677988698 - infrakit.config_sha=eB2JuP0c5Sf41X5e2vc2gJ4ZTVg =,infrakit.group=cattle,project=infrakit,tier=web
242+ instance-4084455402433225349 - infrakit.config_sha=eB2JuP0c5Sf41X5e2vc2gJ4ZTVg =,infrakit.group=cattle,project=infrakit,tier=web
243+ instance-5591036640758692177 - infrakit.config_sha=eB2JuP0c5Sf41X5e2vc2gJ4ZTVg =,infrakit.group=cattle,project=infrakit,tier=web
244+ instance-6810420924276316298 - infrakit.config_sha=eB2JuP0c5Sf41X5e2vc2gJ4ZTVg =,infrakit.group=cattle,project=infrakit,tier=web
242245```
243246
244- Note the instances now have a new SHA ` BXedrwY0GdZlHhgHmPAzxTN4oHM =` (vs ` Y23cKqyRpkQ_M60vIq7CufFmQWk =` previously)
247+ Note the instances now have a new SHA ` eB2JuP0c5Sf41X5e2vc2gJ4ZTVg =` (vs ` 006438mMXW8gXeYtUxgf9Zbg94Y_M60vIq7CufFmQWk =` previously)
245248
246249To see that the Group plugin can enforce the size of the group, let's simulate an instance disappearing.
247250
248251``` shell
249- $ rm tutorial/instance-1475105646 tutorial/instance-1475105686 tutorial/instance-1475105726
250-
251- # ... now check
252-
253- $ ls -al tutorial
254- total 104
255- drwxr-xr-x 15 davidchung staff 510 Sep 28 16:40 .
256- drwxr-xr-x 36 davidchung staff 1224 Sep 28 16:39 ..
257- -rw-r--r-- 1 davidchung staff 654 Sep 28 16:34 instance-1475105656
258- -rw-r--r-- 1 davidchung staff 654 Sep 28 16:34 instance-1475105666
259- -rw-r--r-- 1 davidchung staff 654 Sep 28 16:34 instance-1475105676
260- -rw-r--r-- 1 davidchung staff 654 Sep 28 16:34 instance-1475105696
261- -rw-r--r-- 1 davidchung staff 654 Sep 28 16:35 instance-1475105706
262- -rw-r--r-- 1 davidchung staff 654 Sep 28 16:35 instance-1475105716
263- -rw-r--r-- 1 davidchung staff 654 Sep 28 16:35 instance-1475105736
264- -rw-r--r-- 1 davidchung staff 654 Sep 28 16:40 instance-1475106016 < -- new instance
265- -rw-r--r-- 1 davidchung staff 654 Sep 28 16:40 instance-1475106026 < -- new instance
266- -rw-r--r-- 1 davidchung staff 654 Sep 28 16:40 instance-1475106036 < -- new instance
252+ $ rm tutorial/instance-1422140834255860063 tutorial/instance-1478871890164117825 tutorial/instance-1507972539885141336
253+ ```
254+
255+ After a few moments, the missing instances will be replaced (we've highlighted new instances with ` --> ` ):
256+ ``` shell
257+ $ build/infrakit group describe cattle
258+ ID LOGICAL TAGS
259+ --> instance-1265288729718091217 - infrakit.config_sha=eB2JuP0c5Sf41X5e2vc2gJ4ZTVg=,infrakit.group=cattle,project=infrakit,tier=web
260+ instance-1665488406863611296 - infrakit.config_sha=eB2JuP0c5Sf41X5e2vc2gJ4ZTVg=,infrakit.group=cattle,project=infrakit,tier=web
261+ --> instance-1952247477026188949 - infrakit.config_sha=eB2JuP0c5Sf41X5e2vc2gJ4ZTVg=,infrakit.group=cattle,project=infrakit,tier=web
262+ instance-2340140454359833670 - infrakit.config_sha=eB2JuP0c5Sf41X5e2vc2gJ4ZTVg=,infrakit.group=cattle,project=infrakit,tier=web
263+ instance-2796731287627125229 - infrakit.config_sha=eB2JuP0c5Sf41X5e2vc2gJ4ZTVg=,infrakit.group=cattle,project=infrakit,tier=web
264+ instance-285480170677988698 - infrakit.config_sha=eB2JuP0c5Sf41X5e2vc2gJ4ZTVg=,infrakit.group=cattle,project=infrakit,tier=web
265+ instance-4084455402433225349 - infrakit.config_sha=eB2JuP0c5Sf41X5e2vc2gJ4ZTVg=,infrakit.group=cattle,project=infrakit,tier=web
266+ --> instance-4161733946225446641 - infrakit.config_sha=eB2JuP0c5Sf41X5e2vc2gJ4ZTVg=,infrakit.group=cattle,project=infrakit,tier=web
267+ instance-5591036640758692177 - infrakit.config_sha=eB2JuP0c5Sf41X5e2vc2gJ4ZTVg=,infrakit.group=cattle,project=infrakit,tier=web
268+ instance-6810420924276316298 - infrakit.config_sha=eB2JuP0c5Sf41X5e2vc2gJ4ZTVg=,infrakit.group=cattle,project=infrakit,tier=web
267269```
268270
269271We see that 3 new instance have been created to replace the three removed, to match our
@@ -277,7 +279,7 @@ $ build/infrakit group destroy cattle
277279
278280This concludes our quick tutorial. In this tutorial we:
279281 + Started the plugins and learned to access them
280- + Created a configuration for a group we wanted to watch
282+ + Created a configuration for a group we wanted to manage
281283 + Verified the instances created matched the specifications
282284 + Updated the configurations of the group and scaled up the group
283285 + Reviewed the proposed changes
0 commit comments