diff --git a/doc_images/dashboard.png b/doc_images/dashboard.png
index 47a9e82..8126ca5 100644
Binary files a/doc_images/dashboard.png and b/doc_images/dashboard.png differ
diff --git a/doc_images/programming_mode.png b/doc_images/programming_mode.png
index d1dc6bb..d5b40e0 100644
Binary files a/doc_images/programming_mode.png and b/doc_images/programming_mode.png differ
diff --git a/doc_images/webtail.png b/doc_images/webtail.png
index f5c8621..91b4277 100644
Binary files a/doc_images/webtail.png and b/doc_images/webtail.png differ
diff --git a/html5/index.html b/html5/index.html
index bc38f40..0f9ed93 100644
--- a/html5/index.html
+++ b/html5/index.html
@@ -10,7 +10,7 @@
.custom-btn-group {
margin-top: 2%;
- border: 5px solid #969696;
+ border: 5px solid #b2afaf;
border-radius: 5px;
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
@@ -20,7 +20,7 @@
.logtail-group {
margin-top: 0%;
- border: 5px solid #969696;
+ border: 5px solid #b2afaf;
border-radius: 5px;
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
@@ -29,7 +29,7 @@
}
.chaos-prog-area {
- border: 5px solid #969696;
+ border: 5px solid #b2afaf;
border-radius: 5px;
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
@@ -42,7 +42,7 @@
}
.btn-light:hover, .btn-light:focus, .btn-light:active, .btn-light.active, .open .dropdown-toggle.btn-default {
- background-color: #7304b3;
+ background-color: #06812f;
color:#FFF;
border-color: #000000;
}
@@ -58,21 +58,21 @@
}
body {
- background-color: #ededed;
+ background-color: #ffffff;
}
.modal-content {
- background-color: #ededed;
+ background-color: #ffffff;
}
.modal-content {
- background-color: #ededed;
+ background-color: #ffffff;
}
.modal-dialog {
- background-color: #ededed;
+ background-color: #ffffff;
}
div {
@@ -293,14 +293,14 @@
- Deleted Pod Total: 0
- Chaos Jobs Total: 0
+ Deleted Pod Total: 0
+ Chaos Jobs Total: 0
- Current Chaos Pods: 0
- Not Running Pods: 0
+ Current Chaos Pods: 0
+ Not Running Pods: 0
- Current Replicas State Delay: 0 sec
- Latest Replicas State Delay: 0 sec
+ Current Replicas State Delay: 0 sec
+ Latest Replicas State Delay: 0 sec
@@ -372,9 +372,9 @@ experiments:
-
+

-
+
diff --git a/html5/kubeinvaders.js b/html5/kubeinvaders.js
index 40786e4..87f9cab 100644
--- a/html5/kubeinvaders.js
+++ b/html5/kubeinvaders.js
@@ -174,7 +174,7 @@ experiments:
function drawChaosProgramFlow() {
var chaosProgram = "";
- chaosProgram = $('#chaosProgramTextArea').text();
+ chaosProgram = $('#chaosProgramTextArea').val();
// var chaosProgramWithCodename = chaosProgram.replace('CODENAME_PLACEHOLDER', codename);
// console.log(chaosProgramWithCodename);
@@ -200,15 +200,18 @@ function drawChaosProgramFlow() {
times = "twice"
}
else {
- times = "times"
+ times = flow["experiments"][i]["loop"] + " times"
}
- flow_html = flow_html + 'Do ' + flow["experiments"][i]["name"] + ' ' + flow["experiments"][i]["loop"] + ' ' + times + '
';
+ flow_html = flow_html + 'Do ' + flow["experiments"][i]["name"] + ' ' + times + '
';
search_job = codename + ":" + flow["experiments"][i]["name"]
+
+ flow_html = flow_html + '
';
+
//console.log("Search " + search_job);
for (let [key, value] of chaos_jobs_status) {
if (key.search(search_job)) {
- flow_html = flow_html + '[' + key.split(":")[2] + '] Status: ' + value + '
';
+ flow_html = flow_html + '[' + key.split(":")[2] + '] Status: ' + value + '
';
}
}
i++;
diff --git a/nginx/KubeInvaders.conf b/nginx/KubeInvaders.conf
index 211b11c..2af3e99 100644
--- a/nginx/KubeInvaders.conf
+++ b/nginx/KubeInvaders.conf
@@ -75,26 +75,10 @@ server {
local open = io.open
local function read_rand_line_from_file(path)
- local word_array_index = 0
- local word_array = {}
- local file = open(path, "rb") -- r read mode and b binary mode
-
- if not file then return nil end
- local content = file:read "*a" -- *a or *all reads the whole file
- file:close()
-
- for word in string.gmatch(content, "%S+") do
- word_array[word_array_index] = word
- word_array_index = word_array_index + 1
- end
-
- while (type(rand) ~= "number")
- do
- math.randomseed(os.clock()*100000000000)
- rand = math.random(0, word_array_index - 1)
- end
-
- return word_array[rand]
+ local handle = io.popen("shuf -n 1 " .. path)
+ local result = handle:read("*a")
+ local rc = handle:close()
+ return result
end
local random_word = read_rand_line_from_file("/usr/local/openresty/nginx/conf/kubeinvaders/data/codenames.txt")
@@ -106,13 +90,15 @@ server {
ngx.header['Access-Control-Allow-Methods'] = 'GET, POST, OPTIONS'
ngx.header['Access-Control-Allow-Headers'] = 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range'
ngx.header['Access-Control-Expose-Headers'] = 'Content-Length,Content-Range';
-
- while (red:get("programming_mode_codename:" .. random_word) == nil)
+
+ while (red:get("latest_codename") == random_word)
do
random_word = read_rand_line_from_file("/usr/local/openresty/nginx/conf/kubeinvaders/data/codenames.txt")
end
-
- red:set("programming_mode_codename:" .. random_word, "active")
+
+ red:set("latest_codename", random_word)
+
+ ngx.log(ngx.ERR, "[programming_mode_codename] Choosing random word " .. random_word)
ngx.say(random_word)
}
diff --git a/scripts/data/codename b/scripts/data/codename
new file mode 100644
index 0000000..bc4ed5c
--- /dev/null
+++ b/scripts/data/codename
@@ -0,0 +1,7 @@
+
+500 Internal Server Error
+
+500 Internal Server Error
+
openresty/1.21.4.1
+
+