Skip to content

Commit 47b6315

Browse files
committed
Modifiying yaml to deployment
1 parent 358cfef commit 47b6315

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

k8s/k8s.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ func getServerIP() string {
2121
}
2222

2323
func playHome(w http.ResponseWriter, r *http.Request) {
24-
bannedIp = r.URL.Query().Get("ip")
25-
status := "Customer Support, Mr. Cat speaking, how can I help you!"
24+
status := "Customer Support, Mr. Cat speaking, how can I help you?"
2625
img := "1.3.0"
2726
if bannedIp == getServerIP() {
2827
status = "I don't want to die Mr. Stark ( x_x ) ..."
@@ -31,8 +30,8 @@ func playHome(w http.ResponseWriter, r *http.Request) {
3130
html := `<!DOCTYPE html><html><body><center>
3231
<img src="https://raw.githubusercontent.com/twogg-git/k8s-workshop/master/src/` + img + `.png">
3332
<h1 style="color:green">Playing with Kubernetes</h1>
34-
<h2 style="color:blue">Your server IP:` + getServerIP() + `9090</h2>
35-
<h3 style="color:blue">Version: twogghub/k8s-workshop:` + version + `</h3>
33+
<h2 style="color:blue">Server IP ` + getServerIP() + `</h2>
34+
<h3 style="color:blue">Version twogghub/k8s-workshop:` + version + `</h3>
3635
<h3 style="color:red">` + status + `</h3>
3736
</center></body></html>`
3837
fmt.Fprintf(w, html)
@@ -55,6 +54,7 @@ func playDead(w http.ResponseWriter, r *http.Request) {
5554
func main() {
5655
http.HandleFunc("/", playHome)
5756
http.HandleFunc("/health", playHealth)
57+
http.HandleFunc("/kill", playDead)
5858
if err := http.ListenAndServe(":9090", nil); err != nil {
5959
panic(err)
6060
}

yamls/k8sliveness.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ spec:
2626
port: 9090
2727
initialDelaySeconds: 5
2828
timeoutSeconds: 1
29-
periodSeconds: 10
30-
failureThreshold: 3
29+
periodSeconds: 5
30+
failureThreshold: 1
3131
ports:
3232
- name: http
3333
containerPort: 9090

0 commit comments

Comments
 (0)