lucky-sideburn / kubeinvaders Goto Github PK
View Code? Open in Web Editor NEWGamified Chaos Engineering Tool for Kubernetes
License: Apache License 2.0
Gamified Chaos Engineering Tool for Kubernetes
License: Apache License 2.0
Hi I had to change the nginx configuration a bit in order to make it work for me. @lucky-sideburn can you please check 6e05bde (aks branch) and see if it still works for you?
Thanks
I'm very interested in your projet kubeinvader. I have some questions about it. Can you help me , thank you very much.
Must i intall client on my workstation ? or can i install it on the openshift?
First of all: this game is really cool :) I've played with the Linux version, works without problem.
And I volunteer for the future tests, we have more OpenShift clusters.
I tried to deploy it to OpenShift as well, which worked based on your guide.
But the webpage itself didn't load properly, I could only see the Fullscreen button.
The error message shown in console was:
(index):1 GET https://kubeinvaders.<our cluster's internal OpenShift apps domain>/try_game.png 404 (Not Found)
dmloader.js:303 wasm streaming compile failed: TypeError: Failed to execute 'compile' on 'WebAssembly': Incorrect response MIME type. Expected 'application/wasm'.
printErr @ dmloader.js:303
(anonymous) @ KubeInvaders_wasm.js:1
Promise.catch (async)
doNativeWasm @ KubeInvaders_wasm.js:1
(anonymous) @ KubeInvaders_wasm.js:1
(anonymous) @ KubeInvaders_wasm.js:1
dmloader.js:303 falling back to ArrayBuffer instantiation
printErr @ dmloader.js:303
(anonymous) @ KubeInvaders_wasm.js:1
Promise.catch (async)
doNativeWasm @ KubeInvaders_wasm.js:1
(anonymous) @ KubeInvaders_wasm.js:1
(anonymous) @ KubeInvaders_wasm.js:1
dmloader.js:305 Running...
dmloader.js:303 ERROR:CRASH: Failed to write Crashdump file.
printErr @ dmloader.js:303
put_char @ KubeInvaders_wasm.js:1
write @ KubeInvaders_wasm.js:1
write @ KubeInvaders_wasm.js:1
doWritev @ KubeInvaders_wasm.js:1
___syscall146 @ KubeInvaders_wasm.js:1
wasm-function[4319] @ wasm-0080e43a-4319:62
wasm-function[4349] @ wasm-0080e43a-4349:45
wasm-function[4440] @ wasm-0080e43a-4440:13
wasm-function[3421] @ wasm-0080e43a-3421:160
wasm-function[4211] @ wasm-0080e43a-4211:28
wasm-function[4210] @ wasm-0080e43a-4210:45
(anonymous) @ KubeInvaders_wasm.js:1
ccall @ KubeInvaders_wasm.js:1
window.onerror @ dmloader.js:645
error (async)
(anonymous) @ dmloader.js:643
dmloader.js:305 Exception thrown, see JavaScript console
KubeInvaders_wasm.js:1 Uncaught Error: Environment size exceeded TOTAL_ENV_SIZE!
at ___buildEnvironment (KubeInvaders_wasm.js:1)
at /wasm-function[4513]:5
at KubeInvaders_wasm.js:1
at func (KubeInvaders_wasm.js:1)
at callRuntimeCallbacks (KubeInvaders_wasm.js:1)
at ensureInitRuntime (KubeInvaders_wasm.js:1)
at doRun (KubeInvaders_wasm.js:1)
at KubeInvaders_wasm.js:1
___buildEnvironment @ KubeInvaders_wasm.js:1
wasm-function[4513] @ wasm-0080e43a-4513:3
(anonymous) @ KubeInvaders_wasm.js:1
func @ KubeInvaders_wasm.js:1
callRuntimeCallbacks @ KubeInvaders_wasm.js:1
ensureInitRuntime @ KubeInvaders_wasm.js:1
doRun @ KubeInvaders_wasm.js:1
(anonymous) @ KubeInvaders_wasm.js:1
setTimeout (async)
run @ KubeInvaders_wasm.js:1
runCaller @ KubeInvaders_wasm.js:1
removeRunDependency @ KubeInvaders_wasm.js:1
receiveInstance @ KubeInvaders_wasm.js:1
receiveInstantiatedSource @ KubeInvaders_wasm.js:1
Promise.then (async)
instantiateArrayBuffer @ KubeInvaders_wasm.js:1
(anonymous) @ KubeInvaders_wasm.js:1
Promise.catch (async)
doNativeWasm @ KubeInvaders_wasm.js:1
(anonymous) @ KubeInvaders_wasm.js:1
(anonymous) @ KubeInvaders_wasm.js:1
Given the following deployment.yaml
:
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/instance: kubeinvaders
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: kubeinvaders
argocd.argoproj.io/instance: kubeinvaders
helm.sh/chart: kubeinvaders-1.9.2
name: kubeinvaders
namespace: kubeinvaders
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/instance: kubeinvaders
app.kubernetes.io/name: kubeinvaders
template:
metadata:
labels:
app.kubernetes.io/instance: kubeinvaders
app.kubernetes.io/name: kubeinvaders
spec:
containers:
- env:
- name: ENDPOINT
value: space.alleaffengaffen.ch
- name: NAMESPACE
value: default
- name: ALIENPROXIMITY
value: '10'
- name: HITSLIMIT
value: '1'
- name: UPDATETIME
value: '0.5'
image: 'luckysideburn/kubeinvaders:v1.9'
name: kubeinvaders
ports:
- containerPort: 8080
name: http
protocol: TCP
volumeMounts:
- mountPath: /usr/local/openresty
name: openresty
securityContext:
fsGroup: 999
runAsGroup: 999
runAsUser: 999
serviceAccount: kubeinvaders
serviceAccountName: kubeinvaders
terminationGracePeriodSeconds: 30
volumes:
- emptyDir: {}
name: openresty
I still get the following error log:
sed: couldn't open temporary file /var/www/html/sedJAIsTK: Read-only file system
2022/09/19 14:44:03 [emerg] 11#11: unknown directive "access_by_lua_file" in /etc/nginx/conf.d/KubeInvaders.conf:21
nginx: [emerg] unknown directive "access_by_lua_file" in /etc/nginx/conf.d/KubeInvaders.conf:21
*** FATAL CONFIG FILE ERROR ***
Reading the configuration file, at line 13
>>> 'logfile stdou'
Can't open the log file: Read-only file system
Given that the Dockerfile shows /var/www/html
contains files from the repo/app which prevents my from mounting emptyDir in /var/www/html
and the file that he want's to write there is randomly generated, I guess kubeinvaders cannot be run when the container is run with a read-only FS.
So that would be an enhancement ;)
Firstly, thanks a lot for this chaos engineering tool/game. It's so much fun to teach folks about Kubernetes self-healing capabilities, and chaos engineering with a nice app like that.
Since I demo your applications in some of my talks, I would love if you have a SVG version of the logo (or any vector file type)? If not, I can easily convert the logo to vector, except the text: which font did you use?
Installed my cluster on Digital Ocean and deployed the app by scaling to 5 . I still see "Current Namespace" as Undefined and also i dont see any pods to kill. I followed each and every step to deploy the app but still cant get it to working.
It would be amazing to have an helm chart for this.
Hello!
First of all, this looks awesome. I saw it in action and really wanted to see what I could do with it, as I generally like using games to show off the need for an intelligent orchestration system like kubernetes.
With that being said, I am either missing something or I am unable to connect to my kubernetes cluster for some odd reason :-(.
$ cat ~/.KubeInv.json
{
"token": "suchalongtoken",
"endpoint": "https://path.to.eks:443",
"namespace": "dev-namespace"
}
I am using Kubernetes v1.17 in EKS, and have verified connectivity outside of the KubeInv program. However when connecting, i simply get an 'Error Connecting to Endpoint' with no additional logs.
Is there anything I am missing here? When using the Mac Application am I still to install the Helm chart? I am unable to find logs to sort things out at this time and would love the feedback.
Thanks!
Hi,
The recent version of the OpenShift template seems to have "ROUTE_URL" env variable defined twice, once with the "ROUTE_URL" template variable and once with "ENDPOINT" variable.
https://github.com/lucky-sideburn/KubeInvaders/blob/master/openshift/KubeInvaders.yaml#L86
Is one of these a typo?
Per your instructions, since I don't see aliens in the interface, I am attaching logs.
I am running Minikube on Ubuntu in AWS EC2.
Any help is [appreciated.
kubeinvaders_001.log
Hello again,
I'm running KubeInvaders via MiniKube (per the distribution instructions etc.) under a fairly huge Ubuntu Linux distribution under AWS (not EKS).
kubecurl.log
kube.log
The aliens show ok and are promptly killed off. Two metrics variables are missing (chaos_jobs_node_count{node=workernode01}, and chaos_node_jobs_total).
So, I use the following command to (what I believe I should do) to get them to appear:
$ kubectl set env deployment/kubeinvaders INSECURE_ENDPOINT=true -n kubeinvaders
Then, the app runs, but the aliens no longer appear.
I have attached 2 log files per your instructions: kube.log and kubecurl.log
Any assistance is appreciated, and
Thank you!
@lucky-sideburn, can you please start tagging KubeInvaders releases? I have quite strict admission policies in k8s cluster and it doesn't allow usage of latest
tag in many cases. Also, especially with recent KubeInvaders changes, deployment ends up broken because latest
today is not what it was a month ago.
Hello, i want to change the interface of the game, so i use the Defold Editor, but i can't succed build HTML5 in Defold Editor, can you help me?
Thank you very much.
Hi I was wondering if we can remove line 8 in KubeInvaders.templ which is the IPv6 nginx binding and since Azure Kubernetes Service (AKS) does not support IPv6 it's not possible to run the image.
Le me know and I can create a PR.
Hello, if i want use the client on my workstation, do i need install the kubeinvaders in my openshift?
Thank you
I got past my issue. All good!
Thanks for this cool idea, I really like it :D
I setup kubeinvaders in minikube using helm and no issues there.
However I cant access kubeinvaders.local.
- From your client host do you resolve kubeinvaders.local?
No ( I verified with command: getent hosts kubeinvaders.local)
- Is the redirect to https working correctly?
I dont know
- If you do a curl directly to the kubeinvaders service which is the output?
kubectl get svc -n kubeinvaders
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubeinvaders ClusterIP 10.98.189.244 <none> 8080/TCP 60m
curl 10.98.189.244:8080
curl: (7) Failed to connect to 10.98.189.244 port 8080: Die Wartezeit für die Verbindung ist abgelaufen
Connection timed out.
But from inside the a pod it can connect to the ip:
kubectl exec busybox-sleep wget 10.98.189.244:8080 -n foobar
Connecting to 10.98.189.244:8080 (10.98.189.244:8080)
saving to 'index.html'
index.html 100% |********************************| 3863 0:00:00 ETA
'index.html' saved
The logs of the kubeinvaders pod:
172.17.0.1 - - [12/Nov/2019:08:23:48 +0000] "GET / HTTP/1.1" 200 3863 "-" "kube-probe/1.16" "-"
172.17.0.1 - - [12/Nov/2019:08:23:50 +0000] "GET / HTTP/1.1" 200 3863 "-" "kube-probe/1.16" "-"
172.17.0.1 - - [12/Nov/2019:08:23:58 +0000] "GET / HTTP/1.1" 200 3863 "-" "kube-probe/1.16" "-"
I noticed the Service has type: ClusterIP is this correct?
Im not an kubernetes expert but I thought NodePort is that what we want (access from outside of the cluster)?
Anyways I appreciate any help to get this running 😄
I don't have a problem, this is just awesome and I wanted to let you know you did a great job.
I get the following:
403
KubeInvaders_wasm.js404
try_game.pngThe really weird thing is if I simply touch
the .js
file it serves up, it seems like there's some weird bit on the file or something in the image.
Hello,
I've got kubeinvaders installed in the "kubeinvaders" namespace, and 2 other applications deployed in namespace1 and namespace2. In the UI, it shows "current namespace: undefined".
When i run curl "https://localhost:8080/kube/pods?action=list&namespace=namespace1" -k
I am met with curl: (35) LibreSSL/3.3.6: error:1404B42E:SSL routines:ST_CONNECT:tlsv1 alert protocol version
but running with http: curl "http://localhost:8080/kube/pods?action=list&namespace=namespace1" -k
I get a full list of all my pods in namespace 1.
I have INSECURE_ENDPOINT set to "true", and i'm not sure why https is failing.
Any ideas?
Hello - we would also use you tool for DEMO ;)
But we have Problems that the KubeInvaders UI shows up Error Connecting to
https://{ENDPOINT}/kube
Why you are using kube Endpoint ?
When I install in GKE namespace says undefined, no matter what namespace(s) (existing or non-existing) I specify
$ sh deploy_kubeinvaders.sh
...
error: the path "kubeinvaders-role.yml" does not exist
2022/11/04 15:33:47 [error] 14#14: *14529 [lua] node.lua:58: Requesting nodes using this url: https://10.245.0.1:443/api/v1/nodes, client: 10.244.0.53, server: , request: "GET /kube/nodes HTTP/1.1", host: "kubeinvaders.local", referrer: "https://kubeinvaders.local/"
2022/11/04 15:33:47 [error] 14#14: *14529 [lua] node.lua:75: REQUEST LOGS..., client: 10.244.0.53, server: , request: "GET /kube/nodes HTTP/1.1", host: "kubeinvaders.local", referrer: "https://kubeinvaders.local/"
2022/11/04 15:33:47 [error] 14#14: *14529 [lua] node.lua:76: 1, client: 10.244.0.53, server: , request: "GET /kube/nodes HTTP/1.1", host: "kubeinvaders.local", referrer: "https://kubeinvaders.local/"
2022/11/04 15:33:47 [error] 14#14: *14529 [lua] node.lua:77: 200, client: 10.244.0.53, server: , request: "GET /kube/nodes HTTP/1.1", host: "kubeinvaders.local", referrer: "https://kubeinvaders.local/"
2022/11/04 15:33:47 [error] 14#14: *14529 [lua] node.lua:78: HTTP/1.1 200 OK, client: 10.244.0.53, server: , request: "GET /kube/nodes HTTP/1.1", host: "kubeinvaders.local", referrer: "https://kubeinvaders.local/"
2022/11/04 15:33:47 [error] 14#14: *14529 [lua] node.lua:82: 1, client: 10.244.0.53, server: , request: "GET /kube/nodes HTTP/1.1", host: "kubeinvaders.local", referrer: "https://kubeinvaders.local/"
2022/11/04 15:33:47 [error] 14#14: *14529 [lua] node.lua:88: found node pool-j7b8g0itq-71lkf, client: 10.244.0.53, server: , request: "GET /kube/nodes HTTP/1.1", host: "kubeinvaders.local", referrer: "https://kubeinvaders.local/"
2022/11/04 15:33:47 [error] 14#14: *14529 [lua] node.lua:88: found node pool-j7b8g0itq-71lkx, client: 10.244.0.53, server: , request: "GET /kube/nodes HTTP/1.1", host: "kubeinvaders.local", referrer: "https://kubeinvaders.local/"
2022/11/04 15:33:47 [error] 14#14: *14529 [lua] node.lua:88: found node pool-j7b8g0itq-71lky, client: 10.244.0.53, server: , request: "GET /kube/nodes HTTP/1.1", host: "kubeinvaders.local", referrer: "https://kubeinvaders.local/"
10.244.0.53 - - [04/Nov/2022:15:33:47 +0000] "GET /kube/nodes HTTP/1.1" 200 92 "https://kubeinvaders.local/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:106.0) Gecko/20100101 Firefox/106.0" "10.116.0.2"
2022/11/04 15:33:47 [error] 14#14: 14022 [lua] pod.lua:131: [METRICS] pods_not_running_on=0, client: 10.244.0.215, server: , request: "GET /kube/pods?action=list&namespace=default HTTP/1.1", host: "kubeinvaders.local", referrer: "https://kubeinvaders.local/"
10.244.0.215 - - [04/Nov/2022:15:33:47 +0000] "GET /kube/pods?action=list&namespace=default HTTP/1.1" 200 230 "https://kubeinvaders.local/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:106.0) Gecko/20100101 Firefox/106.0" "143.244.173.173"
INFO:root:Looking for Redis keys logs_enabled:
2022/11/04 15:33:48 [error] 14#14: *14529 [lua] node.lua:58: Requesting nodes using this url: https://10.245.0.1:443/api/v1/nodes, client: 10.244.0.53, server: , request: "GET /kube/nodes HTTP/1.1", host: "kubeinvaders.local", referrer: "https://kubeinvaders.local/"
2022/11/04 15:33:48 [error] 16#16: *14640 [lua] pod.lua:77: url: https://10.245.0.1:443/api/v1/namespaces/default/pods, client: 10.244.0.53, server: , request: "GET /kube/pods?action=list&namespace=default HTTP/1.1", host: "kubeinvaders.local", referrer: "https://kubeinvaders.local/"
2022/11/04 15:33:48 [error] 16#16: *14640 [lua] pod.lua:78: namespace: default, client: 10.244.0.53, server: , request: "GET /kube/pods?action=list&namespace=default HTTP/1.1", host: "kubeinvaders.local", referrer: "https://kubeinvaders.local/"
2022/11/04 15:33:48 [error] 14#14: *14529 [lua] node.lua:75: REQUEST LOGS..., client: 10.244.0.53, server: , request: "GET /kube/nodes HTTP/1.1", host: "kubeinvaders.local", referrer: "https://kubeinvaders.local/"
2022/11/04 15:33:48 [error] 14#14: *14529 [lua] node.lua:76: 1, client: 10.244.0.53, server: , request: "GET /kube/nodes HTTP/1.1", host: "kubeinvaders.local", referrer: "https://kubeinvaders.local/"
2022/11/04 15:33:48 [error] 14#14: *14529 [lua] node.lua:77: 200, client: 10.244.0.53, server: , request: "GET /kube/nodes HTTP/1.1", host: "kubeinvaders.local", referrer: "https://kubeinvaders.local/"
2022/11/04 15:33:48 [error] 14#14: *14529 [lua] node.lua:78: HTTP/1.1 200 OK, client: 10.244.0.53, server: , request: "GET /kube/nodes HTTP/1.1", host: "kubeinvaders.local", referrer: "https://kubeinvaders.local/"
2022/11/04 15:33:48 [error] 14#14: *14529 [lua] node.lua:82: 1, client: 10.244.0.53, server: , request: "GET /kube/nodes HTTP/1.1", host: "kubeinvaders.local", referrer: "https://kubeinvaders.local/"
2022/11/04 15:33:48 [error] 14#14: *14529 [lua] node.lua:88: found node pool-j7b8g0itq-71lkf, client: 10.244.0.53, server: , request: "GET /kube/nodes HTTP/1.1", host: "kubeinvaders.local", referrer: "https://kubeinvaders.local/"
2022/11/04 15:33:48 [error] 14#14: *14529 [lua] node.lua:88: found node pool-j7b8g0itq-71lkx, client: 10.244.0.53, server: , request: "GET /kube/nodes HTTP/1.1", host: "kubeinvaders.local", referrer: "https://kubeinvaders.local/"
2022/11/04 15:33:48 [error] 14#14: *14529 [lua] node.lua:88: found node pool-j7b8g0itq-71lky, client: 10.244.0.53, server: , request: "GET /kube/nodes HTTP/1.1", host: "kubeinvaders.local", referrer: "https://kubeinvaders.local/"
10.244.0.53 - - [04/Nov/2022:15:33:48 +0000] "GET /kube/nodes HTTP/1.1" 200 92 "https://kubeinvaders.local/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:106.0) Gecko/20100101 Firefox/106.0" "10.116.0.2"
2022/11/04 15:33:48 [error] 16#16: *14640 [lua] pod.lua:95: REQUEST LOGS..., client: 10.244.0.53, server: , request: "GET /kube/pods?action=list&namespace=default HTTP/1.1", host: "kubeinvaders.local", referrer: "https://kubeinvaders.local/"
2022/11/04 15:33:48 [error] 16#16: *14640 [lua] pod.lua:96: 1, client: 10.244.0.53, server: , request: "GET /kube/pods?action=list&namespace=default HTTP/1.1", host: "kubeinvaders.local", referrer: "https://kubeinvaders.local/"
2022/11/04 15:33:48 [error] 16#16: *14640 [lua] pod.lua:97: 200, client: 10.244.0.53, server: , request: "GET /kube/pods?action=list&namespace=default HTTP/1.1", host: "kubeinvaders.local", referrer: "https://kubeinvaders.local/"
2022/11/04 15:33:48 [error] 16#16: *14640 [lua] pod.lua:98: HTTP/1.1 200 OK, client: 10.244.0.53, server: , request: "GET /kube/pods?action=list&namespace=default HTTP/1.1", host: "kubeinvaders.local", referrer: "https://kubeinvaders.local/"
2022/11/04 15:33:48 [error] 16#16: *14640 [lua] pod.lua:109: found pod splunk-otel-collector-1667238258-agent-4sxth, client: 10.244.0.53, server: , request: "GET /kube/pods?action=list&namespace=default HTTP/1.1", host: "kubeinvaders.local", referrer: "https://kubeinvaders.local/"
2022/11/04 15:33:48 [error] 16#16: *14640 [lua] pod.lua:109: found pod splunk-otel-collector-1667238258-agent-865gs, client: 10.244.0.53, server: , request: "GET /kube/pods?action=list&namespace=default HTTP/1.1", host: "kubeinvaders.local", referrer: "https://kubeinvaders.local/"
2022/11/04 15:33:48 [error] 16#16: *14640 [lua] pod.lua:109: found pod splunk-otel-collector-1667238258-agent-sd69f, client: 10.244.0.53, server: , request: "GET /kube/pods?action=list&namespace=default HTTP/1.1", host: "kubeinvaders.local", referrer: "https://kubeinvaders.local/"
2022/11/04 15:33:48 [error] 16#16: *14640 [lua] pod.lua:109: found pod splunk-otel-collector-1667238258-k8s-cluster-receiver-8cfd9dmqc, client: 10.244.0.53, server: , request: "GET /kube/pods?action=list&namespace=default HTTP/1.1", host: "kubeinvaders.local", referrer: "https://kubeinvaders.local/"
2022/11/04 15:33:48 [error] 16#16: *14640 [lua] pod.lua:131: [METRICS] pods_not_running_on=0, client: 10.244.0.53, server: , request: "GET /kube/pods?action=list&namespace=default HTTP/1.1", host: "kubeinvaders.local", referrer: "https://kubeinvaders.local/"
10.244.0.53 - - [04/Nov/2022:15:33:48 +0000] "GET /kube/pods?action=list&namespace=default HTTP/1.1" 200 230 "https://kubeinvaders.local/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:106.0) Gecko/20100101 Firefox/106.0" "10.116.0.2"
Hi,
I would like to use your kubeinvaders in hands-on about Chaos Engineering but i can't connect my KubeInvaders in kubernetes local.
What is the value ROUTE_HOST ?
Thank you,
Sullivan.
I am seeing the following prometheus metrics on the metrics endpoint: deleted_pods_total and deleted_namespace_pods_count.
But I am not seeing the following prometheus metrics on the metrics endpoint: chaos_jobs_node_count and chaos_node_jobs_total.
Note: current_chaos_job_pod 0 is showing up in the metrics endpoint.
Is there a setting I am missing?
Any assistance is appreciated.
Hi been trying to deploy kubeindaders on both K3 and Minikube with the same results.
When kubeinvader runs the UI does not show any aliens. I am using the example deployment using helmet.
Steps to reproduce.
#Create namespaces
kubectl create namespace namespace1
kubectl create namespace namespace2
kubectl create namespace kubeinvaders
#Create nginx deployment
kubectl create deploy nginx --image=nginx --replicas=30 -n namespace1
#Create kubeindaversdeploymetn
helm repo add kubeinvaders https://lucky-sideburn.github.io/helm-charts/
helm install kubeinvaders --set-string config.target_namespace="namespace1,namespace2" -n kubeinvaders kubeinvaders/kubeinvaders --set ingress.enabled=true --set ingress.hostName=kubeinvaders.io --set deployment.image.tag=v1.9.6
Expectation:
kubeinvaders loads with the 30 nginx pods as alians. namespace can be toggled between namespace1 and namespace2
Actual:
No pods or aliens are available in UI. namespace is undefined.
Below it the output from kubeinvader pod when calling "/kube/pods?action=list&namespace=namespace1"
2023/03/02 12:43:10 [warn] 24#24: *15 [lua] _G write guard:12: __newindex(): writing a global Lua variable ('ltn12') which may lead to race conditions between concurrent requests, so prefer the use of 'local' variables stack traceback: /usr/local/share/lua/5.1/ltn12.lua:18: in main chunk [C]: in function 'require' /usr/local/share/lua/5.1/ssl/https.lua:11: in main chunk [C]: in function 'require' /usr/local/openresty/nginx/conf/kubeinvaders/pod.lua:1: in main chunk, client: 127.0.0.1, server: , request: "GET /kube/pods?action=list&namespace=namespace1 HTTP/1.1", host: "10.202.14.217:8080" 2023/03/02 12:43:10 [info] 24#24: *15 [lua] pod.lua:79: url: https://10.43.0.1:443/api/v1/namespaces/namespace1/pods, client: 127.0.0.1, server: , request: "GET /kube/pods?action=list&namespace=namespace1 HTTP/1.1", host: "10.202.14.217:8080" 2023/03/02 12:43:10 [info] 24#24: *15 [lua] pod.lua:80: namespace: namespace1, client: 127.0.0.1, server: , request: "GET /kube/pods?action=list&namespace=namespace1 HTTP/1.1", host: "10.202.14.217:8080" 2023/03/02 12:43:10 [info] 24#24: *15 [lua] pod.lua:97: REQUEST LOGS..., client: 127.0.0.1, server: , request: "GET /kube/pods?action=list&namespace=namespace1 HTTP/1.1", host: "10.202.14.217:8080" 2023/03/02 12:43:10 [info] 24#24: *15 [lua] pod.lua:98: 1, client: 127.0.0.1, server: , request: "GET /kube/pods?action=list&namespace=namespace1 HTTP/1.1", host: "10.202.14.217:8080" 2023/03/02 12:43:10 [info] 24#24: *15 [lua] pod.lua:99: 200, client: 127.0.0.1, server: , request: "GET /kube/pods?action=list&namespace=namespace1 HTTP/1.1", host: "10.202.14.217:8080" 2023/03/02 12:43:10 [info] 24#24: *15 [lua] pod.lua:100: HTTP/1.1 200 OK, client: 127.0.0.1, server: , request: "GET /kube/pods?action=list&namespace=namespace1 HTTP/1.1", host: "10.202.14.217:8080" 2023/03/02 12:43:10 [info] 24#24: *15 [lua] pod.lua:111: found pod hello-968574869-pc26c, client: 127.0.0.1, server: , request: "GET /kube/pods?action=list&namespace=namespace1 HTTP/1.1", host: "10.202.14.217:8080" 2023/03/02 12:43:10 [info] 24#24: *15 [lua] pod.lua:111: found pod hello-968574869-69bf7, client: 127.0.0.1, server: , request: "GET /kube/pods?action=list&namespace=namespace1 HTTP/1.1", host: "10.202.14.217:8080" 2023/03/02 12:43:10 [info] 24#24: *15 [lua] pod.lua:111: found pod hello-968574869-c4bbh, client: 127.0.0.1, server: , request: "GET /kube/pods?action=list&namespace=namespace1 HTTP/1.1", host: "10.202.14.217:8080" 2023/03/02 12:43:10 [info] 24#24: *15 [lua] pod.lua:111: found pod nginx-76d6c9b8c-86brg, client: 127.0.0.1, server: , request: "GET /kube/pods?action=list&namespace=namespace1 HTTP/1.1", host: "10.202.14.217:8080" 2023/03/02 12:43:10 [info] 24#24: *15 [lua] pod.lua:111: found pod nginx-76d6c9b8c-2t6xr, client: 127.0.0.1, server: , request: "GET /kube/pods?action=list&namespace=namespace1 HTTP/1.1", host: "10.202.14.217:8080" 2023/03/02 12:43:10 [info] 24#24: *15 [lua] pod.lua:111: found pod nginx-76d6c9b8c-qp88f, client: 127.0.0.1, server: , request: "GET /kube/pods?action=list&namespace=namespace1 HTTP/1.1", host: "10.202.14.217:8080" 2023/03/02 12:43:10 [info] 24#24: *15 [lua] pod.lua:111: found pod nginx-76d6c9b8c-zcg5f, client: 127.0.0.1, server: , request: "GET /kube/pods?action=list&namespace=namespace1 HTTP/1.1", host: "10.202.14.217:8080" 2023/03/02 12:43:10 [info] 24#24: *15 [lua] pod.lua:111: found pod nginx-76d6c9b8c-df2rq, client: 127.0.0.1, server: , request: "GET /kube/pods?action=list&namespace=namespace1 HTTP/1.1", host: "10.202.14.217:8080" 2023/03/02 12:43:10 [info] 24#24: *15 [lua] pod.lua:111: found pod nginx-76d6c9b8c-m2p6j, client: 127.0.0.1, server: , request: "GET /kube/pods?action=list&namespace=namespace1 HTTP/1.1", host: "10.202.14.217:8080" 2023/03/02 12:43:10 [info] 24#24: *15 [lua] pod.lua:111: found pod nginx-76d6c9b8c-kt5zd, client: 127.0.0.1, server: , request: "GET /kube/pods?action=list&namespace=namespace1 HTTP/1.1", host: "10.202.14.217:8080" 2023/03/02 12:43:10 [info] 24#24: *15 [lua] pod.lua:111: found pod nginx-76d6c9b8c-rxvfn, client: 127.0.0.1, server: , request: "GET /kube/pods?action=list&namespace=namespace1 HTTP/1.1", host: "10.202.14.217:8080" 2023/03/02 12:43:10 [info] 24#24: *15 [lua] pod.lua:111: found pod nginx-76d6c9b8c-pmhn9, client: 127.0.0.1, server: , request: "GET /kube/pods?action=list&namespace=namespace1 HTTP/1.1", host: "10.202.14.217:8080" 2023/03/02 12:43:10 [info] 24#24: *15 [lua] pod.lua:111: found pod nginx-76d6c9b8c-vskfm, client: 127.0.0.1, server: , request: "GET /kube/pods?action=list&namespace=namespace1 HTTP/1.1", host: "10.202.14.217:8080" 2023/03/02 12:43:10 [info] 24#24: *15 [lua] pod.lua:111: found pod nginx-76d6c9b8c-sd9x5, client: 127.0.0.1, server: , request: "GET /kube/pods?action=list&namespace=namespace1 HTTP/1.1", host: "10.202.14.217:8080" 2023/03/02 12:43:10 [info] 24#24: *15 [lua] pod.lua:111: found pod nginx-76d6c9b8c-8zdtz, client: 127.0.0.1, server: , request: "GET /kube/pods?action=list&namespace=namespace1 HTTP/1.1", host: "10.202.14.217:8080" 2023/03/02 12:43:10 [info] 24#24: *15 [lua] pod.lua:111: found pod nginx-76d6c9b8c-gp5t4, client: 127.0.0.1, server: , request: "GET /kube/pods?action=list&namespace=namespace1 HTTP/1.1", host: "10.202.14.217:8080" 2023/03/02 12:43:10 [info] 24#24: *15 [lua] pod.lua:111: found pod nginx-76d6c9b8c-8jbgp, client: 127.0.0.1, server: , request: "GET /kube/pods?action=list&namespace=namespace1 HTTP/1.1", host: "10.202.14.217:8080" 2023/03/02 12:43:10 [info] 24#24: *15 [lua] pod.lua:111: found pod nginx-76d6c9b8c-4j5dq, client: 127.0.0.1, server: , request: "GET /kube/pods?action=list&namespace=namespace1 HTTP/1.1", host: "10.202.14.217:8080" 2023/03/02 12:43:10 [info] 24#24: *15 [lua] pod.lua:111: found pod nginx-76d6c9b8c-7j22v, client: 127.0.0.1, server: , request: "GET /kube/pods?action=list&namespace=namespace1 HTTP/1.1", host: "10.202.14.217:8080" 2023/03/02 12:43:10 [info] 24#24: *15 [lua] pod.lua:111: found pod nginx-76d6c9b8c-vn6sv, client: 127.0.0.1, server: , request: "GET /kube/pods?action=list&namespace=namespace1 HTTP/1.1", host: "10.202.14.217:8080" 2023/03/02 12:43:10 [info] 24#24: *15 [lua] pod.lua:111: found pod nginx-76d6c9b8c-rmtzn, client: 127.0.0.1, server: , request: "GET /kube/pods?action=list&namespace=namespace1 HTTP/1.1", host: "10.202.14.217:8080" 2023/03/02 12:43:10 [info] 24#24: *15 [lua] pod.lua:111: found pod nginx-76d6c9b8c-vx5kp, client: 127.0.0.1, server: , request: "GET /kube/pods?action=list&namespace=namespace1 HTTP/1.1", host: "10.202.14.217:8080" 2023/03/02 12:43:10 [info] 24#24: *15 [lua] pod.lua:111: found pod nginx-76d6c9b8c-254fw, client: 127.0.0.1, server: , request: "GET /kube/pods?action=list&namespace=namespace1 HTTP/1.1", host: "10.202.14.217:8080" 2023/03/02 12:43:10 [info] 24#24: *15 [lua] pod.lua:111: found pod nginx-76d6c9b8c-prmxt, client: 127.0.0.1, server: , request: "GET /kube/pods?action=list&namespace=namespace1 HTTP/1.1", host: "10.202.14.217:8080" 2023/03/02 12:43:10 [info] 24#24: *15 [lua] pod.lua:111: found pod nginx-76d6c9b8c-rcxql, client: 127.0.0.1, server: , request: "GET /kube/pods?action=list&namespace=namespace1 HTTP/1.1", host: "10.202.14.217:8080" 2023/03/02 12:43:10 [info] 24#24: *15 [lua] pod.lua:111: found pod nginx-76d6c9b8c-hkfs4, client: 127.0.0.1, server: , request: "GET /kube/pods?action=list&namespace=namespace1 HTTP/1.1", host: "10.202.14.217:8080" 2023/03/02 12:43:10 [info] 24#24: *15 [lua] pod.lua:111: found pod nginx-76d6c9b8c-9stds, client: 127.0.0.1, server: , request: "GET /kube/pods?action=list&namespace=namespace1 HTTP/1.1", host: "10.202.14.217:8080" 2023/03/02 12:43:10 [info] 24#24: *15 [lua] pod.lua:111: found pod nginx-76d6c9b8c-6z4z7, client: 127.0.0.1, server: , request: "GET /kube/pods?action=list&namespace=namespace1 HTTP/1.1", host: "10.202.14.217:8080" 2023/03/02 12:43:10 [info] 24#24: *15 [lua] pod.lua:111: found pod nginx-76d6c9b8c-8mcd5, client: 127.0.0.1, server: , request: "GET /kube/pods?action=list&namespace=namespace1 HTTP/1.1", host: "10.202.14.217:8080" 2023/03/02 12:43:10 [info] 24#24: *15 [lua] pod.lua:111: found pod nginx-76d6c9b8c-mck27, client: 127.0.0.1, server: , request: "GET /kube/pods?action=list&namespace=namespace1 HTTP/1.1", host: "10.202.14.217:8080" 2023/03/02 12:43:10 [info] 24#24: *15 [lua] pod.lua:111: found pod nginx-76d6c9b8c-n95dp, client: 127.0.0.1, server: , request: "GET /kube/pods?action=list&namespace=namespace1 HTTP/1.1", host: "10.202.14.217:8080" 2023/03/02 12:43:10 [info] 24#24: *15 [lua] pod.lua:111: found pod nginx-76d6c9b8c-dxs4s, client: 127.0.0.1, server: , request: "GET /kube/pods?action=list&namespace=namespace1 HTTP/1.1", host: "10.202.14.217:8080" 2023/03/02 12:43:10 [info] 24#24: *15 [lua] pod.lua:111: found pod nginx-76d6c9b8c-zz7qz, client: 127.0.0.1, server: , request: "GET /kube/pods?action=list&namespace=namespace1 HTTP/1.1", host: "10.202.14.217:8080" 2023/03/02 12:43:10 [info] 24#24: *15 [lua] pod.lua:133: [METRICS] pods_not_running_on=0, client: 127.0.0.1, server: , request: "GET /kube/pods?action=list&namespace=namespace1 HTTP/1.1", host: "10.202.14.217:8080" 127.0.0.1 - - [02/Mar/2023:12:43:10 +0000] "GET /kube/pods?action=list&namespace=namespace1 HTTP/1.1" 200 816 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36" "-"
Am I missing some fundamental step or is there some issue running the applications on
kubectl version:
Client Version: v1.26.1
Kustomize Version: v4.5.7
Server Version: v1.25.6+k3s1
Hello,
When i just start the game, i find that there are some aliens are red. In my namespace, there three applications, and every time there are three aliens are red.
I use the defold to see the console, next is the result:
DEBUG:SCRIPT: table: 0x7f81f4292c40
DEBUG:SCRIPT: [swap_pod] phase of nginx-1-1-build is Succeeded
DEBUG:SCRIPT: [swap_pod] nginx-1-1-build is not running
DEBUG:SCRIPT: [swap_pod] phase of nginx-2-1-build is Succeeded
DEBUG:SCRIPT: [swap_pod] nginx-2-1-build is not running
DEBUG:SCRIPT: [swap_pod] phase of nginx-3-1-build is Succeeded
DEBUG:SCRIPT: [swap_pod] nginx-3-1-build is not running
DEBUG:SCRIPT: [swap_pod]: pods not running pods in Kubernetes: 3
DEBUG:SCRIPT: [swap_pod]: pods running pods in Kubernetes: 15
DEBUG:SCRIPT: [swap_pod]: pods not running pods in KubeInvaders: 3
DEBUG:SCRIPT: [swap_pod]: pods running pods in KubeInvaders: 15
can you help me to solve this problem, thank you very much.
I am trying to configure kubeinvaders using helm but it does not detect the indicated namespace.config:
target_namespace: "demo"
alienProximity: 10
hitsLimit: 1
updateTime: 0.5
Hey, when I install kubeinvaders the pod in openshift doesnt start - I keep getting the following errors. Are you aware of why this might be happening?
2022/03/09 15:45:38 [emerg] 13#13: setgid(65534) failed (1: Operation not permitted)
2022/03/09 15:45:38 [emerg] 12#12: setgid(65534) failed (1: Operation not permitted)
2022/03/09 15:45:38 [alert] 10#10: worker process 12 exited with fatal code 2 and cannot be respawned
2022/03/09 15:45:38 [alert] 10#10: worker process 13 exited with fatal code 2 and cannot be respawned
helm install kubeinvaders --set-string config.target_namespace="namespace1,namespace2" \
-n kubeinvaders2 kubeinvaders/kubeinvaders --set ingress.enabled=true --set ingress.hostName=kubeinvaders.local --set deployment.image.tag=v1.9.6
Error: INSTALLATION FAILED: rendered manifests contain a resource that already exists. Unable to continue with install: ClusterRole "kubeinvaders" in namespace "" exists and cannot be imported into the current release: invalid ownership metadata; annotation validation error: key "meta.helm.sh/release-namespace" must equal "kubeinvaders2": current value is "kubeinvaders1"
Helle,
I have a another question,:D
In the console of defold i can see:
DEBUG:SCRIPT: [pod_log] getting pod logs...
DEBUG:SCRIPT: [pod_log] getting pod logs for nginx-3-1-mvbzn
DEBUG:SCRIPT: [pod_log] show logs of pod nginx-3-1-mvbzn
DEBUG:SCRIPT: last_pod_log nginx-3-1-mvbzn
DEBUG:SCRIPT: pod_name nginx-3-1-mvbzn
But i didn't see the log in the game.
Thank you very much
First, congratulations on this game. It's a very nice idea.
I would like to run it on raspberry pi 3b + with k3s vs k8s. Can you help me? The main question is whether there is a possibility to run on the arm processor.
I know the PODs are exposing the metrics on the metrics endpoint, but shouldnt the pods need to have right annotation so that the external tool can easily identify the right source, we use open telemetry collector and have added appropriate annotation to the collector configuration, but looks like PODs need to be annotated as well:
`prometheus.io/scrape: true: The default configuration scrapes all pods. If set to false, this annotation excludes the pod from the scraping process.
prometheus.io/path: The path to scrape the metrics from. The default value is /metrics.
prometheus.io/port: The port to scrape the metrics from. The default value is 9090.`
I am facing issue running KubeInvaders into OCP.
Using the ROUTE_HOST as described, however this is also used in routes in another namespace where I have deployed the containers / pods in an organized manner in another project, the one on which I want to cause chaos
This is causing conflict
Route "rejected", when having a look at yaml , I see
HostAlreadyClaimed
a route in another namespace holds "myroute" and is older than kubeinvaders
Please advise
Hi
I have a project in OCP in Cloud, this time I chose not to deploy KubeInvaders into OCP (see other issue)
Wanting to run KubeInvaders locally, using the local command
ROUTE_HOST=myhost.appdomain.cloud
NAMESPACE=acmeair
SESSION_TOKEN=$(oc whoami -t)
docker run --env DEVELOPMENT=true --env ROUTE_HOST=$ROUTE_HOST:8080 --env NAMESPACE=$NAMESPACE --env ALIENPROXIMITY=15 --env HITSLIMIT=0 --env UPDATETIME=0.5 --env TOKEN=$SESSION_TOKEN --env KUBERNETES_SERVICE_PORT_HTTPS=8080 --env KUBERNETES_SERVICE_HOST=$ROUTE_HOST -p 8080:8080 --name kubeinvaders docker.io/luckysideburn/kubeinvaders:latest
I can run UI on my local machine, however UI says
Endpoint: myhost.appdomain.cloud:8080/kube
Running pods 0
Error connecting to
http://myhost.appdomain* and I cannot see more (what error, if URL is fine ...etc.)
Thanks
Hello.
Is there a plan to put the helm chart into some repository?
I can see the helm chart is in https://github.com/lucky-sideburn/KubeInvaders/tree/master/helm-charts but it would be great if it is in some repository.
The ArtifactHub doesn't have the Readme:
https://artifacthub.io/packages/helm/kubeinvaders/kubeinvaders
Thank you...
Hello, where i can change the color of interface? Like color of the ship, the color of the sign kubeinvaders in the bottom of the interface?
Thank you.
In the last updated this logic
{{- if .Values.ingress.enabled -}}
was removed from ingress.yaml in helm chart templates. This causes this scenario to break.
https://katacoda.com/javajon/courses/kubernetes-chaos/kubeinvaders
Hi!
I've been looking through the docs and the code to see if there is a way to remove nodes from the game board. It would be nice to have a switch that would only allow you to destroy pods.
Thanks!
Consider adding this fairly standard snippet to the helm chart Service template:
{{ if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePort))) }}
nodePort: {{.Values.service.nodePort}}
{{ end }}
to look like this:
apiVersion: v1
kind: Service
metadata:
name: kubeinvaders
labels:
app.kubernetes.io/name: kubeinvaders
helm.sh/chart: {{ include "kubeinvaders.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: HTTP
{{ if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePort))) }}
nodePort: {{.Values.service.nodePort}}
{{ end }}
selector:
app.kubernetes.io/name: kubeinvaders
app.kubernetes.io/instance: {{ .Release.Name }}
The chart default for this nodePort value should be nil.
This can avoid the patch step in the Katacoda instructions:
Change the service NodePort value to the same one specified as the Helm chart parameter. (This is a workaround as the Helm chart does not currently have the ability to specify the NodePort value.)
kubectl patch service kubeinvaders -n kubeinvaders --type='json' --patch='[{"op": "replace", "path": "/spec/ports/0/nodePort", "value":30016}]'
Myself and a teammate tried installing version 1.4 a kubeinvaders. In both our cases we could not switch between namespaces. We just got switched to namespace undefined when trying to switch namespaces. We both correctly configured target_namespace to point to one or more namespaces already ready with multiple pods. Therefore we ran the hands on demo on katacoda and had the same issue. You may want to fix the walk through and would be interested in how it was resolved since running into the same issue when installing it. I installed the legacy version and that one seems to more properly set up the target namespaces as I can switch between the target namespaces configured and do not get undefined namespace. However with Legacy version I still do not see the pods in the namespace to shoot at
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.