Skip to content

Instantly share code, notes, and snippets.

@thoraxe
Last active August 18, 2020 19:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thoraxe/3c047a1c9910f1ee975ad4094e8972df to your computer and use it in GitHub Desktop.
Save thoraxe/3c047a1c9910f1ee975ad4094e8972df to your computer and use it in GitHub Desktop.
kind: LimitRange
apiVersion: v1
metadata:
name: stressy-core-resource-limits
spec:
limits:
- type: Container
max:
cpu: '4'
memory: 6Gi
default:
cpu: 500m
memory: 1536Mi
defaultRequest:
cpu: 50m
memory: 256Mi
- type: Pod
max:
cpu: '4'
memory: 12Gi
apiVersion: apps/v1
kind: Deployment
metadata:
name: stress
spec:
selector:
matchLabels:
app: stress
replicas: 2
template:
metadata:
labels:
app: stress
spec:
containers:
- name: hamster
image: k8s.gcr.io/ubuntu-slim:0.1
resources:
requests:
cpu: 100m
memory: 50Mi
command: ["/bin/sh"]
args:
- "-c"
- "while true; do timeout 0.5s yes >/dev/null; sleep 0.5s; done"
apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
name: stress-recommender
spec:
targetRef:
apiVersion: "apps/v1"
kind: Deployment
name: stress
updatePolicy:
updateMode: "Auto"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment