parent
45d22102c6
commit
23027d73be
content/en/blog/_posts
|
@ -13,21 +13,22 @@ Commons Briefing session. Kubenvaders is a Gamified Chaos Engineering
|
||||||
tool for Kubernetes and Openshift and helps test how resilient your
|
tool for Kubernetes and Openshift and helps test how resilient your
|
||||||
Kubernetes cluster is, in a fun way.
|
Kubernetes cluster is, in a fun way.
|
||||||
|
|
||||||
It is like space invaders but the aliens are PODs.
|
It is like Space Invaders, but the aliens are pods.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
During my presentation at Codemotion Milan 2019, I started saying "of
|
During my presentation at Codemotion Milan 2019, I started saying "of
|
||||||
course you can do it with few lines of bash but it is boring."
|
course you can do it with few lines of Bash, but it is boring."
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Using the code above you can kill random PODs across a K8s cluster but I
|
Using the code above you can kill random pods across a Kubernetes cluster, but I
|
||||||
think it is much funnier with the spaceship of Kubeinvaders.
|
think it is much more fun with the spaceship of KubeInvaders.
|
||||||
|
|
||||||
I published the code at
|
I published the code at
|
||||||
[https://github.com/lucky-sideburn/KubeInvaders](https://github.com/lucky-sideburn/KubeInvaders)
|
[https://github.com/lucky-sideburn/KubeInvaders](https://github.com/lucky-sideburn/KubeInvaders)
|
||||||
and there is a little community that is growing gradually. Some people
|
and there is a little community that is growing gradually. Some people
|
||||||
love to use it for demo sessions killing PODs on the big screens.
|
love to use it for demo sessions killing pods on a big screen.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
@ -44,84 +45,66 @@ I defined multiples modes to install it:
|
||||||
3. Manual Installation for Kubernetes
|
3. Manual Installation for Kubernetes
|
||||||
[https://github.com/lucky-sideburn/KubeInvaders\#install-kubeinvaders-on-kubernetes](https://github.com/lucky-sideburn/KubeInvaders#install-kubeinvaders-on-kubernetes)
|
[https://github.com/lucky-sideburn/KubeInvaders\#install-kubeinvaders-on-kubernetes](https://github.com/lucky-sideburn/KubeInvaders#install-kubeinvaders-on-kubernetes)
|
||||||
|
|
||||||
The preferred way, of course, is with a Helm chart.
|
The preferred way, of course, is with a Helm chart:
|
||||||
|
|
||||||
----------------------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
```
|
```
|
||||||
# Please set target_namespace to set your target namespace!
|
# Please set target_namespace to set your target namespace!
|
||||||
helm install --set-string target_namespace="namespace1,namespace2" \
|
helm install --set-string target_namespace="namespace1,namespace2" \
|
||||||
--name kubeinvaders --namespace kubeinvaders ./helm-charts/kubeinvaders
|
--name kubeinvaders --namespace kubeinvaders ./helm-charts/kubeinvaders
|
||||||
```
|
```
|
||||||
----------------------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
## How to use KubeInvaders
|
## How to use KubeInvaders
|
||||||
|
|
||||||
Once it is installed on your cluster you can use the following
|
Once it is installed on your cluster you can use the following
|
||||||
functionalities:
|
functionalities:
|
||||||
|
|
||||||
a. Key 'a' =\> Switch to automatic pilot;
|
* Key 'a' — Switch to automatic pilot
|
||||||
|
* Key 'm' — Switch to manual pilot
|
||||||
b. Key 'm' =\> Switch to manual pilot;
|
* Key 'i' — Show pod's name. Move the ship towards an alien
|
||||||
|
* Key 'h' — Print help
|
||||||
c. Key 'i' =\> Show pod\'s name. Move the ship towards an alien;
|
* Key 'n' — Jump between different namespaces (my favorite feature!)
|
||||||
|
|
||||||
d. Key 'h' =\> Print help;
|
|
||||||
|
|
||||||
e. Key 'n' =\> Jump between; different namespaces (my preferred feature!)
|
|
||||||
|
|
||||||
## Tuning KubeInvaders
|
## Tuning KubeInvaders
|
||||||
|
|
||||||
At Codemotion Milan 2019, my colleagues and I organized a desk with a
|
At Codemotion Milan 2019, my colleagues and I organized a desk with a
|
||||||
game station for playing KubeInvaders. People had to fight with K8s to
|
game station for playing KubeInvaders. People had to fight with Kubernetes to
|
||||||
win a t-shirt.
|
win a t-shirt.
|
||||||
|
|
||||||
If you have PODs that require a few seconds to start, you may lose. It
|
If you have pods that require a few seconds to start, you may lose. It
|
||||||
is possible to set the complexity of the game with these parameters as
|
is possible to set the complexity of the game with these parameters as
|
||||||
env var in the K8s deployment:
|
environmment variables in the Kubernetes deployment:
|
||||||
|
|
||||||
a. ALIENPROXIMITY =\> Reduce this value to increase the distance between aliens;
|
* ALIENPROXIMITY — Reduce this value to increase the distance between aliens;
|
||||||
|
* HITSLIMIT — Seconds of CPU time to wait before shooting;
|
||||||
|
* UPDATETIME — Seconds to wait before updating pod status (you can set also 0.x Es: 0.5);
|
||||||
|
|
||||||
b. HITSLIMIT =\> Seconds of CPU time to wait before shooting;
|
The result is a harder game experience against the machine.
|
||||||
|
|
||||||
c. UPDATETIME =\> Seconds to wait before update PODs status (you can set also 0.x Es: 0.5);
|
|
||||||
|
|
||||||
The result is a harder game experience against the machine :D
|
|
||||||
|
|
||||||
## Use cases
|
## Use cases
|
||||||
|
|
||||||
Adopting chaos engineering strategies for your production environment is
|
Adopting chaos engineering strategies for your production environment is
|
||||||
really useful because it is the only way to test if a system supports
|
really useful, because it is the only way to test if a system supports
|
||||||
unexpected destructive events.
|
unexpected destructive events.
|
||||||
|
|
||||||
KubeInvaders is a game so please do not take it too seriously but it has
|
KubeInvaders is a game — so please do not take it too seriously! — but it demonstrates
|
||||||
some important use cases:
|
some important use cases:
|
||||||
|
|
||||||
- Test how resilient K8s clusters are on unexpected PODs deletion;
|
* Test how resilient Kubernetes clusters are on unexpected pod deletion
|
||||||
|
* Collect metrics like pod restart time
|
||||||
|
* Tune readiness probes
|
||||||
|
|
||||||
- Collect metrics like PODs restart time;
|
## Next steps
|
||||||
|
|
||||||
- Tuning readiness probes;
|
|
||||||
|
|
||||||
## Next step
|
|
||||||
|
|
||||||
I want to continue to add some cool features and integrate it into a
|
I want to continue to add some cool features and integrate it into a
|
||||||
Kubernetes dashboard because I am planning to transform it into a
|
Kubernetes dashboard because I am planning to transform it into a
|
||||||
"Gamified Chaos Engineering and Development Tool for Kubernetes".
|
"Gamified Chaos Engineering and Development Tool for Kubernetes", to help
|
||||||
|
developer to interact with deployments in a Kubernetes environment. For
|
||||||
For "Development Tool for Kubernetes" I mean something that help
|
|
||||||
developers to interact with deployments in a K8s environment. For
|
|
||||||
example:
|
example:
|
||||||
|
|
||||||
a. Point to the aliens to get PODs logs;
|
* Point to the aliens to get pod logs
|
||||||
|
* Deploy Helm charts by shooting some particular objects
|
||||||
b. Deploy Helm charts shooting some particular objects;
|
* Read messages stored in a specific label present in a deployment
|
||||||
|
|
||||||
c. Read message stored in a specific label present in a deployment;
|
|
||||||
|
|
||||||
Please feel free to contribute to
|
Please feel free to contribute to
|
||||||
[https://github.com/lucky-sideburn/KubeInvaders](https://github.com/lucky-sideburn/KubeInvaders)
|
[https://github.com/lucky-sideburn/KubeInvaders](https://github.com/lucky-sideburn/KubeInvaders)
|
||||||
and stay updated following \#kubeinvaders news on Twitter
|
and stay updated following \#kubeinvaders news [on Twitter](https://twitter.com/luckysideburn).
|
||||||
([https://twitter.com/luckysideburn](https://twitter.com/luckysideburn))
|
|
||||||
|
|
||||||
Thanks!
|
|
Loading…
Reference in New Issue