Skip to content

Commit

Permalink
Merge pull request microsoft#167 from microsoft/pragme/add-todo-probe
Browse files Browse the repository at this point in the history
Add probes to stats-api
  • Loading branch information
pragyamehta authored Apr 29, 2021
2 parents c1d8de0 + 7d21390 commit 6419387
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions samples/todo-app/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,18 @@ spec:
containers:
- name: stats-api
image: azdspublic/todo-app-stats-api
livenessProbe:
httpGet:
path: /hello
port: 80
initialDelaySeconds: 5
periodSeconds: 3
readinessProbe:
httpGet:
path: /hello
port: 80
initialDelaySeconds: 15
periodSeconds: 5
---
apiVersion: v1
kind: Service
Expand Down
5 changes: 5 additions & 0 deletions samples/todo-app/stats-api/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ var cache = redis.createClient({
password: process.env.REDIS_PASSWORD || undefined
});

app.get('/hello', function (req, res) {
console.log('hello!');
res.send('hello!');
})

app.get('/stats', function (req, res) {
console.log('request for stats received with kubernetes-route-as header: %s', req.get('kubernetes-route-as'));
cache.get('todosCreated', function (err, created) {
Expand Down

0 comments on commit 6419387

Please sign in to comment.