https://github.com/phenixblue/k8s-pdb-demo
A Demo of Kubernetes Pod Disruption Budgets
https://github.com/phenixblue/k8s-pdb-demo
budget demo disruption example k8s kubernetes pdb
Last synced: 4 months ago
JSON representation
A Demo of Kubernetes Pod Disruption Budgets
- Host: GitHub
- URL: https://github.com/phenixblue/k8s-pdb-demo
- Owner: phenixblue
- Created: 2019-04-12T21:57:37.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-12T22:07:09.000Z (about 7 years ago)
- Last Synced: 2025-04-10T16:10:38.595Z (about 1 year ago)
- Topics: budget, demo, disruption, example, k8s, kubernetes, pdb
- Size: 477 KB
- Stars: 2
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PDB Demo
This is a demo to show the configuration and functionality of a Kubernetes PDB (Pod Disruption Budget).
## Setup
- Open 3 terminals with the appropriate KUBECONFIG context set
- 1 for interactive work
- Create Namespace
```
$ kubectl create ns pdb-test
```
- Deploy workload
```
$ kubectl apply -f pdb-tester-deploy.yaml -n pdb-test
```
- Deploy PDB
```
$ kubectl apply -f pdb-tester-pdb.yaml -n pdb-test
```
- 1 for watching the pods
```
$ watch kubectl get pods -n pdb-test -o wide
```

- 1 for watching the PDB
```
$ watch kubectl get pdb -n pdb-test pdb-tester
```

## Walkthrough
- Show Sample workload with liveness/readiness probe
```
$ kubectl get deploy -n pdb-test pdb-tester -o yaml
```
- Show PDB configuration
```
$ kubectl get pdb -n pdb-test pdb-tester -o yaml
```
- Show Pods running across different nodes
```
$ kubectl get pods -n pdb-test -o wide
```
- Show how a single node drain affects the workload
```
$ kubectl drain --ignore-daemonsets --delete-local-data
```
- Watching secondary windows showing the pod recreation and wait for probes
- Watch PDB metrics update based on currently unavailable pods
- Show concecutive drain operations being blocked by PDB
```
$ kubectl drain --ignore-daemonsets --delete-local-data; sleep 5; k drain --ignore-daemonsets --delete-local-data
```
