Skip to content

Commit

Permalink
Add initContainer failure demos
Browse files Browse the repository at this point in the history
Fix yaml lint error

Update demo/init-container-failure-in-cluster.demo

Co-authored-by: Shiming Zhang <[email protected]>

Update demo/init-container-failure-in-cluster.demo

Co-authored-by: Shiming Zhang <[email protected]>

Update demo/init-container-failure-in-cluster.demo

Co-authored-by: Shiming Zhang <[email protected]>

Update failure demo using kwokctl

Rename demo files

Add container failure demo

Remove test.svg

Recreate svg file for failure demo

Update container-failure.demo

Co-authored-by: Shiming Zhang <[email protected]>

Update demo/container-failure.demo

Co-authored-by: Shiming Zhang <[email protected]>

Update demo/container-failure.demo

Co-authored-by: Shiming Zhang <[email protected]>

Update demo/container-failure.demo

Co-authored-by: Shiming Zhang <[email protected]>

Recreate demo
  • Loading branch information
yuanchen8911 committed May 7, 2024
1 parent df20d83 commit ba87dd3
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
27 changes: 27 additions & 0 deletions demo/container-failure.demo
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Demo: inject failure to an app. container using kwokctl

# Create a cluster with kwok
kwokctl create cluster --enable-crds Stage

# Apply stage files
kubectl apply -f https://github.com/kubernetes-sigs/kwok/releases/download/v0.5.2/stage-fast.yaml
kubectl apply -f https://github.com/kubernetes-sigs/kwok/raw/main/kustomize/stage/pod/chaos/pod-container-running-failed.yaml
kubectl get stages

# Create three nodes.
kwokctl scale node --replicas 3
kubectl get nodes

# Create three pods
kwokctl scale pod --replicas 3
kubectl get pod

# Inject an error to a pod's container
kubectl patch pod pod-000000 --type=merge --patch '{"metadata": { "labels":{"pod-container-running-failed.stage.kwok.x-k8s.io":"true"}}}'
kubectl get pod

# Clean up
kwokctl delete cluster

# Thank you!
clear
1 change: 1 addition & 0 deletions demo/container-failure.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ba87dd3

Please sign in to comment.