Skip to content

Instantly share code, notes, and snippets.

@arajkumar
Last active November 11, 2021 12:22
Show Gist options
  • Save arajkumar/d337965c92bc674d90aea81d4c7ea6e9 to your computer and use it in GitHub Desktop.
Save arajkumar/d337965c92bc674d90aea81d4c7ea6e9 to your computer and use it in GitHub Desktop.
ResourceQuota test
apiVersion: v1
kind: Pod
metadata:
name: low-priority
spec:
containers:
- name: low-priority
image: ubuntu
command: ["/bin/sh"]
args: ["-c", "while true; do echo hello; sleep 10;done"]
resources:
requests:
memory: "10Gi"
cpu: "8m"
limits:
memory: "10Gi"
cpu: "8m"
priorityClassName: low
apiVersion: scheduling.k8s.io/v1
kind: PriorityClass
metadata:
name: low
value: 10000
globalDefault: false
description: "This priority class should be used for XYZ service pods only."
apiVersion: v1
kind: List
items:
- apiVersion: v1
kind: ResourceQuota
metadata:
name: pods-high
spec:
hard:
cpu: "1000"
memory: 200Gi
pods: "10"
scopeSelector:
matchExpressions:
- operator : In
scopeName: PriorityClass
values: ["high"]
- apiVersion: v1
kind: ResourceQuota
metadata:
name: pods-medium
spec:
hard:
cpu: "10"
memory: 20Gi
pods: "10"
scopeSelector:
matchExpressions:
- operator : In
scopeName: PriorityClass
values: ["medium"]
- apiVersion: v1
kind: ResourceQuota
metadata:
name: pods-low
spec:
hard:
requests.cpu: "9m"
cpu: "8m"
memory: 10Gi
pods: "10"
scopeSelector:
matchExpressions:
- operator : In
scopeName: PriorityClass
values: ["low"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment