@@ -244,17 +244,18 @@ allocated a `GameServer` out of the fleet, and you can now connect your players
244244A handy trick for checking to see how many ` GameServers ` you have ` Allocated ` vs ` Ready ` , run the following:
245245
246246```
247- kubectl describe gs | grep State
247+ kubectl get gs -o=custom-columns=NAME:.metadata.name,STATUS:.status.state,IP:.status.address,PORT:.status.ports
248248```
249249
250- This will get you a list of all the current ` Status > State ` of all the ` GameSevers ` .
250+ This will get you a list of all the current ` GameSevers ` and their ` Status > State ` .
251251
252252```
253- State: Allocated
254- State: Ready
255- State: Ready
256- State: Ready
257- State: Ready
253+ NAME STATUS IP PORT
254+ simple-udp-tfqn7-c9tqz Ready 192.168.39.150 [map[name:default port:7136]]
255+ simple-udp-tfqn7-g8fhq Allocated 192.168.39.150 [map[name:default port:7148]]
256+ simple-udp-tfqn7-p8wnl Ready 192.168.39.150 [map[name:default port:7453]]
257+ simple-udp-tfqn7-t6bwp Ready 192.168.39.150 [map[name:default port:7228]]
258+ simple-udp-tfqn7-wkb7b Ready 192.168.39.150 [map[name:default port:7226]]
258259```
259260
260261### 5. Scale down the Fleet
@@ -270,13 +271,14 @@ Run `kubectl edit fleet simple-udp` and replace `replicas: 5` with `replicas 0`,
270271
271272It may take a moment for all the ` GameServers ` to shut down, so let's watch them all and see what happens:
272273```
273- watch ' kubectl describe gs | grep State'
274+ watch kubectl get gs -o=custom-columns=NAME:.metadata.name,STATUS:.status.state,IP:.status.address,PORT:.status.ports
274275```
275276
276277Eventually, one by one they will be removed from the list, and you should simply see:
277278
278279```
279- State: Allocated
280+ NAME STATUS IP PORT
281+ simple-udp-tfqn7-g8fhq Allocated 192.168.39.150 [map[name:default port:7148]]
280282```
281283
282284That lone ` Allocated ` ` GameServer ` is left all alone, but still running!
@@ -290,7 +292,7 @@ Since we've only got one allocation, we'll just grab the details of the IP and p
290292only allocated ` GameServer ` :
291293
292294```
293- kubectl get $(kubectl get fleetallocation -o name) -o jsonpath='{.status.GameServer.status.address}':'{.status. GameServer.status.port}'
295+ kubectl get $(kubectl get fleetallocation -o name) -o jsonpath='{.status.GameServer.staatus. GameServer.status.ports[0] .port}'
294296```
295297
296298This should output your Game Server IP address and port. (eg ` 10.130.65.208:7936 ` )
@@ -325,14 +327,17 @@ Let's also allocate ourselves a `GameServer`
325327kubectl create -f https://raw.githubusercontent.com/GoogleCloudPlatform/agones/master/examples/simple-udp/server/fleetallocation.yaml -o yaml
326328```
327329
328- We should now have four ` Ready ` ` GameServers ` and one ` Allocated ` . We can check this by running ` kubectl describe gs | grep State ` .
330+ We should now have four ` Ready ` ` GameServers ` and one ` Allocated ` .
331+
332+ We can check this by running ` kubectl get gs -o=custom-columns=NAME:.metadata.name,STATUS:.status.state,IP:.status.address,PORT:.status.ports ` .
329333
330334```
331- State: Allocated
332- State: Ready
333- State: Ready
334- State: Ready
335- State: Ready
335+ NAME STATUS IP PORT
336+ simple-udp-tfqn7-c9tz7 Ready 192.168.39.150 [map[name:default port:7136]]
337+ simple-udp-tfqn7-g8fhq Allocated 192.168.39.150 [map[name:default port:7148]]
338+ simple-udp-tfqn7-n0wnl Ready 192.168.39.150 [map[name:default port:7453]]
339+ simple-udp-tfqn7-hiiwp Ready 192.168.39.150 [map[name:default port:7228]]
340+ simple-udp-tfqn7-w8z7b Ready 192.168.39.150 [map[name:default port:7226]]
336341```
337342
338343In production, we'd likely be changing a ` containers > image ` configuration to update our ` Fleet `
@@ -344,7 +349,8 @@ with a Container Port of `6000`.
344349
345350> NOTE: This will make it such that you can no longer connect to the simple-udp game server.
346351
347- Run ` watch 'kubectl describe gs | grep "Container Port"' ` until you can see that there are
352+ Run ` watch kubectl get gs -o=custom-columns=NAME:.metadata.name,STATUS:.status.state,CONTAINERPORT:.spec.ports[0].containerPort `
353+ until you can see that there are
348354one of ` 7654 ` , which is the ` Allocated ` ` GameServer ` , and four instances to ` 6000 ` which
349355is the new configuration.
350356
0 commit comments