create bundle

This commit is contained in:
Eugenio Marzo
2021-01-09 13:43:20 +01:00
parent 647fb1917f
commit 0de937af7d
10 changed files with 27 additions and 24 deletions

View File

@@ -8,7 +8,8 @@
1. [Description](#Description)
2. [Special Input Keys and features](#Special-Input-Keys-and-features)
3. [Installation](#Installation)
4. [Configuration](#Configuration)
4. [Notes For large clusters][#Notes-for-large-clusters]
5. [Configuration](#Configuration)
## Description
@@ -114,6 +115,16 @@ oc process -f openshift/KubeInvaders.yaml -p ROUTE_HOST=$ROUTE_HOST -p TARGET_NA
#### How the configuration of KubeInvaders DeploymentConfig should be (remember to use your TARGET_NAMESPACE and ROUTE_HOST)
![Alt Text](https://github.com/lucky-sideburn/KubeInvaders/blob/master/images/dcenv.png)
## Notes for large clusters
For cluster with many workers-nodes, Kubeinvaders selects a number of random items.
| Item | Max Number |
|-----------|--------------|
| Nodes | 15 |
## Configuration
### Environment Variables - Make the game more difficult to win!

View File

@@ -1 +1 @@
{"content":[{"name":"game.projectc","size":3190,"pieces":[{"name":"game.projectc0","offset":0}]},{"name":"game.arci","size":7408,"pieces":[{"name":"game.arci0","offset":0}]},{"name":"game.arcd","size":379303,"pieces":[{"name":"game.arcd0","offset":0}]},{"name":"game.dmanifest","size":13430,"pieces":[{"name":"game.dmanifest0","offset":0}]},{"name":"game.public.der","size":162,"pieces":[{"name":"game.public.der0","offset":0}]}]}
{"content":[{"name":"game.projectc","size":3190,"pieces":[{"name":"game.projectc0","offset":0}]},{"name":"game.arci","size":7408,"pieces":[{"name":"game.arci0","offset":0}]},{"name":"game.arcd","size":379507,"pieces":[{"name":"game.arcd0","offset":0}]},{"name":"game.dmanifest","size":13430,"pieces":[{"name":"game.dmanifest0","offset":0}]},{"name":"game.public.der","size":162,"pieces":[{"name":"game.public.der0","offset":0}]}]}

View File

@@ -47,13 +47,13 @@ function M.http_get_nodes_result(self, _, response)
end
end
end
local node_deleted = 0
local node_deleted = 1
if table.getn(kubernetes_nodes_temp) > max_nodes then
print("Nodes number are greater than the max_nodes. Going to to select randomly " .. max_nodes .. " nodes")
while (table.getn(kubernetes_nodes_temp) > max_nodes) do
print("foo")
math.randomseed(os.clock()*100000000000)
table.remove(kubernetes_nodes_temp,math.random(1,max_nodes))
local interval = max_nodes - node_deleted
table.remove(kubernetes_nodes_temp,math.random(1,interval))
node_deleted = node_deleted + 1
end
print("New size of kubernetes_nodes table is " .. table.getn(kubernetes_nodes_temp))

View File

@@ -119,7 +119,8 @@ function M.swap_pod(items)
a = a + 1
end
msg.post("ui#gui", "error",{ errormessage = "Synchronizing alien ships with Kubernetes pods.." })
end
end
end
return M

View File

@@ -12,29 +12,21 @@ function M.auto()
return
end
for i=1,1 do
rand_pos = math.random(400, 1500)
rand_pos = math.random(300, 1500)
end
pos = go.get_position()
pos.y = 300
go.set_position(pos)
pos.x = rand_pos
for i,value in ipairs(current_pods) do
if value["color"] == "white" then
position_of_pod = go.get_position(value["id"])
if (pos.x > position_of_pod.x and pos.x - position_of_pod.x < 30) then
launch_bullet = true
elseif (position_of_pod.x > pos.x and position_of_pod.x - pos.x < 30) then
launch_bullet = true
end
end
end
launch_bullet = true
if launch_bullet == true then
go.animate(go.get_id(), "position.x", go.PLAYBACK_ONCE_FORWARD, pos.x, go.EASING_INQUAD, 1,0, function()
go.animate(go.get_id(), "position.x", go.PLAYBACK_ONCE_FORWARD, pos.x, go.EASING_LINEAR, 0.5, 0, function()
pos = go.get_position()
bullet = factory.create("/bullet#bulletfactory", pos)
go.animate(bullet, "position.y", go.PLAYBACK_ONCE_FORWARD, 1200, go.EASING_INQUAD, 1,0,function()
go.animate(bullet, "position.y", go.PLAYBACK_ONCE_FORWARD, 1200, go.EASING_LINEAR, 1, 0, function()
go.delete(bullet)
end)
end)

View File

@@ -95,11 +95,10 @@ kubernetes_nodes_request_show = false
-- keep time of the latest request of showing nodes
latest_kubernetes_nodes_request_show = 0
-- max number of pod to show
max_pods = 5
-- max number of nodes to show
max_nodes = 15
-- max number of node to show
max_nodes = 5
local COLLISION_RESPONSE = hash("collision_response")
local timer = require "main.mymodules.timer"
@@ -208,7 +207,7 @@ function start_chaos()
msg.post("ui#gui", "error1",{ errormessage = "" })
end
end)
timer.repeat_seconds(1, function()
timer.repeat_seconds(0.5, function()
spaceship.auto()
end)
pod_api.set_pods()