Skip to content

Instantly share code, notes, and snippets.

@liveaverage
Last active July 2, 2019 19:35
Show Gist options
  • Save liveaverage/2697df78d13c0b87be0b00600903e228 to your computer and use it in GitHub Desktop.
Save liveaverage/2697df78d13c0b87be0b00600903e228 to your computer and use it in GitHub Desktop.
Sample Resource Quota Patch
spec:
hard:
limited-use-nfs.storageclass.storage.k8s.io/requests.storage: "0"
limited-use-nfs.storageclass.storage.k8s.io/persistentvolumeclaims: "0"
@liveaverage
Copy link
Author

liveaverage commented Jul 2, 2019

oc get project | grep Active | awk '{ print("oc patch quota core-project-quota --patch \"$(curl https://gist.githubusercontent.com/liveaverage/2697df78d13c0b87be0b00600903e228/raw/52a7da06cb678f3fbbc533685a422f5690fc167f/patch.yaml)\" -n " $1) }'

@liveaverage
Copy link
Author

Base command to apply/create quota:

oc apply -f https://gist.githubusercontent.com/liveaverage/a2b29fcde34ac2478264d8fab113eff3/raw/1b410fcbcdd69722e47b2086e8b6b593bb05ad1a/sample-storage-class-quota.yaml -n testy2

Base command to patch a quota:

oc patch quota base-project-quota --patch "$(curl https://gist.githubusercontent.com/liveaverage/2697df78d13c0b87be0b00600903e228/raw/8e1697eddd0c15c41a9a63d698f0154be7c48841/patch.yaml)" -n testy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment