-
Notifications
You must be signed in to change notification settings - Fork 267
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: knrt10 <tripathi.kautilya@gmail.com>
- Loading branch information
Showing
7 changed files
with
269 additions
and
181 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
const http = require('http'); | ||
const os = require('os'); | ||
console.log("Kubia server starting..."); | ||
var handler = function (request, response) { | ||
let handler = function (request, response) { | ||
console.log("Received request from " + request.connection.remoteAddress); | ||
response.writeHead(200); | ||
response.end("You've hit " + os.hostname() + "\n"); | ||
}; | ||
var www = http.createServer(handler); | ||
let www = http.createServer(handler); | ||
www.listen(8080); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: v1 | ||
kind: pod | ||
metadata: | ||
name: kubia-liveness | ||
spec: | ||
containers: | ||
- image: knrt10/kubia-unhealthy | ||
name: kubia | ||
livenessProbe: | ||
httpGet: | ||
path: / | ||
port: 8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM node:8 | ||
|
||
ADD app.js /app.js | ||
|
||
ENTRYPOINT [ "node", "app.js" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
const http = require('http'); | ||
const os = require('os'); | ||
|
||
console.log("Kubia server starting..."); | ||
|
||
let requestCount = 0; | ||
|
||
let handler = function(request, response) { | ||
console.log("Received request from " + request.connection.remoteAddress); | ||
requestCount++; | ||
if (requestCount > 5) { | ||
response.writeHead(500); | ||
response.end("I'm not well. Please restart me!"); | ||
return; | ||
} | ||
response.writeHead(200); | ||
response.end("You've hit " + os.hostname() + "\n"); | ||
}; | ||
|
||
let www = http.createServer(handler); | ||
www.listen(8080); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "kubernetes-basiclearning", | ||
"version": "1.0.0", | ||
"description": "Understand kubernetes step by step.", | ||
"main": "app.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"start": "node app.js" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/knrt10/kubernetes-basicLearning.git" | ||
}, | ||
"author": "knrt10", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/knrt10/kubernetes-basicLearning/issues" | ||
}, | ||
"homepage": "https://github.com/knrt10/kubernetes-basicLearning#readme" | ||
} |
Oops, something went wrong.