1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-15 17:51:20 +00:00
kyverno/litmuschaos
Ved Ratan 367156f60b
[Chore] Bump to Go 1.20 (#6683)
* changed go version 1.19->1.20

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* updated go version in actions

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* bumped golangci-lint

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* fix

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* fix conflicts

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* fix

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* fixed some linter issues

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* fixed some linter issues

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* possible fix

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* fix

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* small fix

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* fix

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

---------

Signed-off-by: Ved Ratan <vedratan8@gmail.com>
Signed-off-by: Ved Ratan <82467006+VedRatan@users.noreply.github.com>
2023-04-03 11:40:47 +00:00
..
pod_cpu_hog [Chore] Bump to Go 1.20 (#6683) 2023-04-03 11:40:47 +00:00
README.md

Integration of Kyverno with Litmus

Kyverno is a policy engine designed for Kubernetes. It can validate, mutate, and generate configurations using admission controls and background scans. Litmus provides a large number of experiments for testing containers, pods, nodes, as well as specific platforms and tools. The advantage of chaos engineering is that one can quickly figure out issues that other testing layers cannot easily capture. This can save a lot of time in the future, and will help to find the loopholes in the system and fix them.

Steps to Execute LitmusChaos Experiment

Prerequisites

  • Ensure that Kubernetes Version > 1.15
  • Ensure that the Kyverno is running by executing kubectl get pods in operator namespace (typically, kyverno). If not, install from here.
  • Update Kyverno Deployment to use ghcr.io/kyverno/kyverno:test-litmuschaos image. Note that this image is built specifically to run Litmuschaos experiments per this request, CHAOS_KILL_COMMAND. The official Kyverno images will adopt this soon.
  • Ensure that the Litmus Chaos Operator is running by executing kubectl get pods in operator namespace (typically, litmus). If not, install from here.

Running experiment

Aftr setting up the docker images, for running a LitmusChaos experiment following steps need to be followed -

  • Firstly, exicute eval export E2E="ok"
  • Run the Chaos Experiment Test Command - go test ./litmuschaos/pod_cpu_hog -v.

The test passes if the enforce policy shows it's expected behaviour.

Experiments

Experiment name LitmusChaos experiment - Pod CPU Hog
Test command go test ./litmuschaos/pod_cpu_hog -v
Goal Seeing how the overall application stack behaves when Kyverno pods experience CPU spikes either due to expected/undesired processes
Performed tests
  • Deploy enforce policy.
  • Run the chaos test to consume CPU resources on the application container.
  • Verify the enforce policy behaviour.
  • Expected result Kyverno pod is responding after running Pod CPU Hog Experiment