Limiting the resources consumed by containers, pods, and projects
Applying Quotas, Applying Limit Ranges
......................................
** If new to Docker, Podman, Kubernetes and Openshift then first see -- • Docker, Podman, Containers, Kubernetes and...
** For detail about OpenShift development --
• OpenShift Tutorial
......................................
commands--
Login as developer
oc new-project schedule-limit
oc create deployment hello-limit --image quay.io/redhattraining/hello-world-nginx:v1.0 --dry-run=client -o yaml gt hello-limit.yaml
resources:
requests:
cpu: "3"
memory: 20Mi
oc apply -f hello-limit.yaml
oc get pods
oc get events --field-selector type=Warning
vim hello-limit.yaml
resources:
requests:
cpu: "1200m"
memory: 20Mi
oc apply -f hello-limit.yaml
oc scale --replicas 4 deployment/hello-limit
oc get pods
oc get events --field-selector type=Warning
oc delete all -l app=hello-limit
vim hello-limit.yaml
resources:
requests:
cpu: "100m"
memory: 20Mi
limits:
cpu: "200m"
memory: 100Mi
-- Applying Quotas on project --
Login as the admin user
oc create quota project-quota --hard cpu="3",memory="1G",configmaps="2" -n schedule-limit
Login as developer
oc create configmap my-config