Skip to content

Instantly share code, notes, and snippets.

@daxmc99
Created December 6, 2022 00:07
Show Gist options
  • Save daxmc99/b46f1dad27978a7c1aa1dee8dd71eb88 to your computer and use it in GitHub Desktop.
Save daxmc99/b46f1dad27978a7c1aa1dee8dd71eb88 to your computer and use it in GitHub Desktop.
Kubernetes test pods for restarting and cpu use
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: null
labels:
run: cpu-hungry
name: cpu-hungry
spec:
containers:
- image: ubuntu
name: hungry-container
command: ["/bin/sh"]
args:
- "-c"
- "apt-get update && apt-get install -y stress && stress --verbose --cpu 8"
resources:
limits:
cpu: "50m"
dnsPolicy: ClusterFirst
restartPolicy: Always
status: {}
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: null
labels:
run: restart
name: restart
spec:
containers:
- image: busybox
name: restart-container
command: ["/bin/sh"]
args:
- "-c"
- "sleep 5 && echo hi && exit 1"
resources: {}
dnsPolicy: ClusterFirst
restartPolicy: Always
status: {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment