Skip to content

Commit

Permalink
Updated pods endpoint to retrieve the full list
Browse files Browse the repository at this point in the history
  • Loading branch information
evan-kenzan committed Apr 7, 2017
1 parent 2774fd9 commit 5d42d27
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 2 additions & 3 deletions applications/monitor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ watcher.on("change", showVal);

function showVal(val) {

//var pods = etcd.getSync("pod-list",{ recursive: true });
var podChange = { pods: val.node.key, action: val.action };
console.log(JSON.stringify(podChange));
io.emit('pods', podChange);
Expand Down Expand Up @@ -124,8 +123,8 @@ app.get('/hit/:podId', function (req, res) {
app.get('/pods', function (req, res) {

var pods = etcd.getSync("pod-list",{ recursive: true });
io.emit('pods', { pods: pods.body.node.nodes });
res.send('pods sent')
res.setHeader('Content-Type', 'application/json');
res.send(JSON.stringify({pods: pods}));
})

app.delete('/pods', function (req, res) {
Expand Down
4 changes: 3 additions & 1 deletion steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,14 @@ parts:

- cap: Check job status
com: kubectl describe jobs/etcd-job

- cap: Now we're going to walk through an initial build of the monitoring and scaling service for our crosswords application.

- cap: Bootstrap the crossword services and monitoring applications, creating a docker image and storing it in the local registry
com: scripts/monitor.sh

- cap: Bootstrap the frontend web application
com: scripts/monitor.sh
com: scripts/pages.sh

- cap: See all the pods running using kubectl.
com: kubectl get pods
Expand Down

0 comments on commit 5d42d27

Please sign in to comment.