{"id":4969,"date":"2023-08-12T15:17:22","date_gmt":"2023-08-12T13:17:22","guid":{"rendered":"http:\/\/miro.borodziuk.eu\/?p=4969"},"modified":"2023-09-22T09:17:50","modified_gmt":"2023-09-22T07:17:50","slug":"pod-scaling-and-scheduling-on-openshift","status":"publish","type":"post","link":"http:\/\/miro.borodziuk.eu\/index.php\/2023\/08\/12\/pod-scaling-and-scheduling-on-openshift\/","title":{"rendered":"Pod scaling, limit ranges and quotas on Openshift"},"content":{"rendered":"<p><!--more--><\/p>\n<p><span style=\"color: #3366ff;\">Understanding pod scaling<\/span><\/p>\n<ul>\n<li>The desired number of Pods is set in the Deployment or Deployment Configuration<\/li>\n<li>From there, the replicaset or replication controller is used to guarantee that this number of replicas is running<\/li>\n<li>The deployment is using a selector for identifying the replicated Pods<\/li>\n<\/ul>\n<p><span style=\"color: #3366ff;\">Scaling Pods Manually<\/span><\/p>\n<ul>\n<li>Use <code>oc scale<\/code> to manually scale the number of Pods\n<ul>\n<li><code>oc scale --replicas 3 deployment myapp<\/code><\/li>\n<\/ul>\n<\/li>\n<li>While doing this, the new desired number of replicas is added to the Deployment, and from there written to the ReplicaSet<\/li>\n<\/ul>\n<p>Let&#8217;s try to scale pod manually:<\/p>\n<pre class=\"lang:default decode:true \"># oc login -u developer -p developer\r\nLogin successful.\r\n\r\nYou have access to the following projects and can switch between them with 'oc project &lt;projectname&gt;':\r\n\r\n    debug\r\n    myproject\r\n    network-security\r\n  * nodesel\r\n\r\nUsing project \"nodesel\".\r\n[root@okd ~]# oc get all\r\nNAME                          READY     STATUS    RESTARTS   AGE\r\npod\/simple-6f55965d79-5d59d   1\/1       Running   0          18m\r\npod\/simple-6f55965d79-5dt56   1\/1       Running   0          18m\r\npod\/simple-6f55965d79-mklpc   1\/1       Running   0          18m\r\npod\/simple-6f55965d79-q8pq9   1\/1       Running   0          18m\r\n\r\nNAME                     DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE\r\ndeployment.apps\/simple   4         4         4            4           3h\r\n\r\nNAME                                DESIRED   CURRENT   READY     AGE\r\nreplicaset.apps\/simple-57f7866b4b   0         0         0         2h\r\nreplicaset.apps\/simple-6f55965d79   4         4         4         18m\r\nreplicaset.apps\/simple-776bd789d8   0         0         0         3h\r\nreplicaset.apps\/simple-77bd5f84cf   0         0         0         3h\r\nreplicaset.apps\/simple-8559698ddc   0         0         0         1h\r\n[root@okd ~]#\r\n[root@okd ~]# oc scale --replicas=3 deployment deployment.apps\/simple\r\nerror: there is no need to specify a resource type as a separate argument when passing arguments in resource\/name form (e.g. 'oc get resource\/&lt;resource_name&gt;' instead of 'oc get resource resource\/&lt;resource_name&gt;'\r\n[root@okd ~]# oc scale --replicas=3 deployment.apps\/simple\r\ndeployment.apps\/simple scaled\r\n[root@okd ~]#\r\n[root@okd ~]# oc get all\r\nNAME                          READY     STATUS    RESTARTS   AGE\r\npod\/simple-6f55965d79-5d59d   1\/1       Running   0          19m\r\npod\/simple-6f55965d79-mklpc   1\/1       Running   0          19m\r\npod\/simple-6f55965d79-q8pq9   1\/1       Running   0          19m\r\n\r\nNAME                     DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE\r\ndeployment.apps\/simple   3         3         3            3           3h\r\n\r\nNAME                                DESIRED   CURRENT   READY     AGE\r\nreplicaset.apps\/simple-57f7866b4b   0         0         0         2h\r\nreplicaset.apps\/simple-6f55965d79   3         3         3         19m\r\nreplicaset.apps\/simple-776bd789d8   0         0         0         3h\r\nreplicaset.apps\/simple-77bd5f84cf   0         0         0         3h\r\nreplicaset.apps\/simple-8559698ddc   0         0         0         1h\r\n<\/pre>\n<p>Another way to do the same:<\/p>\n<pre class=\"lang:default decode:true\">$ oc edit  deployment.apps\/simple\r\ndeployment.apps\/simple edited\r\n<\/pre>\n<p>And change :<\/p>\n<pre class=\"lang:default decode:true \">spec:\r\nprogressDeadlineSeconds: 600\r\nreplicas: 3<\/pre>\n<p>to<\/p>\n<pre class=\"lang:default decode:true \">spec:\r\nprogressDeadlineSeconds: 600\r\nreplicas: 2<\/pre>\n<p>Now the number of pods is limited to two:<\/p>\n<pre class=\"lang:default decode:true \">$ oc get all\r\nNAME                          READY     STATUS    RESTARTS   AGE\r\npod\/simple-6f55965d79-mklpc   1\/1       Running   0          23m\r\npod\/simple-6f55965d79-q8pq9   1\/1       Running   0          23m\r\n\r\nNAME                     DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE\r\ndeployment.apps\/simple   2         2         2            2           3h\r\n\r\nNAME                                DESIRED   CURRENT   READY     AGE\r\nreplicaset.apps\/simple-57f7866b4b   0         0         0         3h\r\nreplicaset.apps\/simple-6f55965d79   2         2         2         23m\r\nreplicaset.apps\/simple-776bd789d8   0         0         0         3h\r\nreplicaset.apps\/simple-77bd5f84cf   0         0         0         3h\r\nreplicaset.apps\/simple-8559698ddc   0         0         0         2h\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #3366ff;\">Autoscaling Pods<\/span><\/p>\n<ul>\n<li>OpenShift provides the <code>HorizontalPodAutoscaler<\/code> resource for automatically scaling Pods<\/li>\n<li>This resource depends on the OpenShift Metrics subsystem, which is pre-installed in OpenShift 4<\/li>\n<li>To use autoscaling, resource requests need to be specified so that the autoscaler knows when to do what:\n<ul>\n<li>Use Resource Requests or project resource limitations to take care of this<\/li>\n<\/ul>\n<\/li>\n<li>Currently, Autoscaling is based on CPU usage, autoscaling for memory utilization is in tech preview<\/li>\n<\/ul>\n<pre class=\"lang:default decode:true \">$ oc login -u developer -p developer\r\nLogin successful.\r\n\r\nYou have access to the following projects and can switch between them with 'oc project &lt;projectname&gt;':\r\n\r\n  * nodesel\r\n\r\nUsing project \"nodesel\".\r\n\r\n$ oc new-project auto\r\nNow using project \"auto\" on server \"https:\/\/172.30.9.22:8443\".\r\n\r\nYou can add applications to this project with the 'new-app' command. For example, try:\r\n\r\n    oc new-app centos\/ruby-25-centos7~https:\/\/github.com\/sclorg\/ruby-ex.git\r\n\r\nto build a new example application in Ruby.\r\n\r\n\r\n$ oc new-app --name auto php-https:\/\/github.com\/sandervanvugt\/simpleapp\r\nerror: git ls-remote failed with: fatal: Unable to find remote helper for 'php-https';  local file access failed with: stat php-https:\/\/github.le or directory\r\nerror: unable to locate any images in image streams, templates loaded in accessible projects, template files, local docker images with name \"phleapp\"\r\n\r\nArgument 'php-https:\/\/github.com\/sandervanvugt\/simpleapp' was classified as an image, image~source, or loaded template reference.\r\n\r\nThe 'oc new-app' command will match arguments to the following types:\r\n\r\n  1. Images tagged into image streams in the current project or the 'openshift' project\r\n     - if you don't specify a tag, we'll add ':latest'\r\n  2. Images in the Docker Hub, on remote registries, or on the local Docker engine\r\n  3. Templates in the current project or the 'openshift' project\r\n  4. Git repository URLs or local paths that point to Git repositories\r\n\r\n--allow-missing-images can be used to point to an image that does not exist yet.\r\n\r\nSee 'oc new-app -h' for examples.\r\n\r\n$ oc new-app --name auto https:\/\/github.com\/sandervanvugt\/simpleapp\r\n--&gt; Found Docker image 5d0da3d (22 months old) from Docker Hub for \"centos\"\r\n\r\n    * An image stream tag will be created as \"centos:latest\" that will track the source image\r\n    * A Docker build using source code from https:\/\/github.com\/sandervanvugt\/simpleapp will be created\r\n      * The resulting image will be pushed to image stream tag \"auto:latest\"\r\n      * Every time \"centos:latest\" changes a new build will be triggered\r\n    * This image will be deployed in deployment config \"auto\"\r\n    * The image does not expose any ports - if you want to load balance or send traffic to this component\r\n      you will need to create a service with 'expose dc\/auto --port=[port]' later\r\n    * WARNING: Image \"centos\" runs as the 'root' user which may not be permitted by your cluster administrator\r\n\r\n--&gt; Creating resources ...\r\n    imagestream.image.openshift.io \"centos\" created\r\n    imagestream.image.openshift.io \"auto\" created\r\n    buildconfig.build.openshift.io \"auto\" created\r\n    deploymentconfig.apps.openshift.io \"auto\" created\r\n--&gt; Success\r\n    Build scheduled, use 'oc logs -f bc\/auto' to track its progress.\r\n    Run 'oc status' to view your app.\r\n\r\n$ oc status\r\nIn project auto on server https:\/\/172.30.9.22:8443\r\n\r\ndc\/auto deploys istag\/auto:latest &lt;-\r\n  bc\/auto docker builds https:\/\/github.com\/sandervanvugt\/simpleapp on istag\/centos:latest\r\n    build #1 failed 26 seconds ago - a6c13bc: message (sandervanvugt &lt;mail@sandervanvugt.nl&gt;)\r\n  deployment #1 waiting on image or update\r\n\r\nErrors:\r\n  * build\/auto-1 has failed.\r\n\r\n1 error, 1 warning, 2 infos identified, use 'oc status --suggest' to see details.\r\n\r\n$ oc get deploy\r\nNo resources found.\r\n\r\n$ oc new-app --name auto php-https:\/\/github.com\/sandervanvugt\/simpleapp\r\nerror: git ls-remote failed with: fatal: Unable to find remote helper for 'php-https';  local file access failed with: stat php-https:\/\/github.le or directory\r\nerror: unable to locate any images in image streams, templates loaded in accessible projects, template files, local docker images with name \"phleapp\"\r\n\r\nArgument 'php-https:\/\/github.com\/sandervanvugt\/simpleapp' was classified as an image, image~source, or loaded template reference.\r\n\r\nThe 'oc new-app' command will match arguments to the following types:\r\n\r\n  1. Images tagged into image streams in the current project or the 'openshift' project\r\n     - if you don't specify a tag, we'll add ':latest'\r\n  2. Images in the Docker Hub, on remote registries, or on the local Docker engine\r\n  3. Templates in the current project or the 'openshift' project\r\n  4. Git repository URLs or local paths that point to Git repositories\r\n\r\n--allow-missing-images can be used to point to an image that does not exist yet.\r\n\r\nSee 'oc new-app -h' for examples.\r\n\r\n\r\n$ oc get pods\r\nNAME           READY     STATUS    RESTARTS   AGE\r\nauto-1-build   0\/1       Error     0          2m\r\n\r\n$ oc get deploy\r\nNo resources found.\r\n\r\n$ oc autoscale deploy auto --min 5 --max 10 --cpu-percent 20\r\nError from server (NotFound): deployments.extensions \"auto\" not found\r\n\r\n$ oc get hpa\r\nNo resources found.\r\n\r\n$ oc get pods\r\nNAME           READY     STATUS    RESTARTS   AGE\r\nauto-1-build   0\/1       Error     0          18m\r\n\r\n$ oc get deploy\r\nNo resources found.\r\n\r\n$ oc get hpa -o yaml\r\napiVersion: v1\r\nitems: []\r\nkind: List\r\nmetadata:\r\n  resourceVersion: \"\"\r\n  selfLink: \"\"\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #3366ff;\">Resource Requests and Limits<\/span><\/p>\n<ul>\n<li>Resource requests and limits are used on a per-application basis<\/li>\n<li>Quota are enforced on a project or cluster basis<\/li>\n<li>In Pods spec.containers.resources.requests, a Pod can request minimal amounts of CPU and memory resources\n<ul>\n<li>The scheduler will look for a node that meets these requirements<\/li>\n<\/ul>\n<\/li>\n<li>In Pods spec.containers.resources.iimits, the Pod can be limited to a maximum use of resources\n<ul>\n<li>CGroups are used on the node to enforce the limits<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #3366ff;\">Setting Resources<\/span><\/p>\n<ul>\n<li>Use <code>oc set resources<\/code> to set resource requests as well as limits, or edit the YAML code directly<\/li>\n<li>Resource restrictions can be set on individual containers, as well as on a complete deployment<\/li>\n<li><code>oc set resources deployment hello-world-nginx --requests cpu=10m,memory=10Mi --limits cpu=50m,memory=50Mi<\/code><\/li>\n<li>Use <code>oc set resources -h<\/code> for ready-to-use examples<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #3366ff;\">Setting Resource Limits<\/span><\/p>\n<ul>\n<li><code>oc create deployment nee --image=bitnami\/nginx:latest --replicas=3 <\/code><\/li>\n<li><code>oc get pods <\/code><\/li>\n<li><code>oc set resources deploy nee --requests cpu lOm, memory=1Mi --limits cpu=20m,memory=5Mi <\/code><\/li>\n<li><code>oc get pods<\/code> # one new pod will be stuck in state &#8220;Creating&#8221;<\/li>\n<li><code>oc describe pods nee-xxxx<\/code> # will show this is because of resource limits<\/li>\n<li><code> oc set resources deploy nee --requests cpu=0m,memory=0Mi --limits cpu=0m,memory=0Mi<\/code><\/li>\n<li><code>oc get pods<\/code><\/li>\n<\/ul>\n<pre class=\"lang:default decode:true\">$ oc login -u developer -p developer\r\nLogin successful.\r\n\r\nYou have access to the following projects and can switch between them with 'oc project &lt;projectname&gt;':\r\n\r\n  * auto\r\n\r\nUsing project \"auto\".\r\n\r\n$ oc new-project limits\r\nNow using project \"limits\" on server \"https:\/\/172.30.9.22:8443\".\r\n\r\nYou can add applications to this project with the 'new-app' command. For example, try:\r\n\r\n    oc new-app centos\/ruby-25-centos7~https:\/\/github.com\/sclorg\/ruby-ex.git\r\n\r\nto build a new example application in Ruby.\r\n\r\n$oc create deployment nee --image=bitnami\/nginx --replicas=3\r\nError: unknown flag: --replicas\r\n\r\n$  oc create deployment -h\r\nCreate a deployment with the specified name.\r\n\r\nAliases:\r\ndeployment, deploy\r\n\r\nUsage:\r\n  oc create deployment NAME --image=image [--dry-run] [flags]\r\n\r\nExamples:\r\n  # Create a new deployment named my-dep that runs the busybox image.\r\n  oc create deployment my-dep --image=busybox\r\n\r\nOptions:\r\n      --allow-missing-template-keys=true: If true, ignore any errors in templates when a field or map key is missing in\r\nthe template. Only applies to golang and jsonpath output formats.\r\n      --dry-run=false: If true, only print the object that would be sent, without sending it.\r\n      --generator='': The name of the API generator to use.\r\n      --image=[]: Image name to run.\r\n  -o, --output='': Output format. One of:\r\njson|yaml|name|go-template|go-template-file|templatefile|template|jsonpath|jsonpath-file.\r\n      --save-config=false: If true, the configuration of current object will be saved in its annotation. Otherwise, the\r\nannotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.\r\n      --template='': Template string or path to template file to use when -o=go-template, -o=go-template-file. The\r\ntemplate format is golang templates [http:\/\/golang.org\/pkg\/text\/template\/#pkg-overview].\r\n      --validate=false: If true, use a schema to validate the input before sending it\r\n\r\nUse \"oc options\" for a list of global command-line options (applies to all commands).\r\n\r\n$ oc create deployment nee --image=bitnami\/nginx\r\ndeployment.apps\/nee created\r\n\r\n$ oc get all\r\nNAME                       READY     STATUS    RESTARTS   AGE\r\npod\/nee-6f4f4dbf77-p247v   1\/1       Running   0          26s\r\n\r\nNAME                  DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE\r\ndeployment.apps\/nee   1         1         1            1           26s\r\n\r\nNAME                             DESIRED   CURRENT   READY     AGE\r\nreplicaset.apps\/nee-6f4f4dbf77   1         1         1         26s\r\n\r\n$ oc get pods\r\nNAME                   READY     STATUS    RESTARTS   AGE\r\nnee-6f4f4dbf77-p247v   1\/1       Running   0          37s\r\n\r\n$ oc set resources deploy nee --requests=cpu=10m,memory=1Mi --limits=cpu=20m,memory=5Mi\r\ndeployment.extensions\/nee resource requirements updated\r\n\r\n$ oc get pods\r\nNAME                   READY     STATUS                 RESTARTS   AGE\r\nnee-6f4f4dbf77-p247v   1\/1       Running                0          7m\r\nnee-7b855dcd99-zh7z6   0\/1       CreateContainerError   0          3m\r\n\r\n$ oc get deploy\r\nNAME      DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE\r\nnee       1         2         1            1           8m\r\n[root@okd ~]# oc describe pods nee-7b855dcd99-zh7z6\r\nName:               nee-7b855dcd99-zh7z6\r\nNamespace:          limits\r\nPriority:           0\r\nPriorityClassName:  &lt;none&gt;\r\nNode:               localhost\/172.30.9.22\r\nStart Time:         Fri, 28 Jul 2023 18:16:29 +0200\r\nLabels:             app=nee\r\n                    pod-template-hash=3641187855\r\nAnnotations:        openshift.io\/scc=restricted\r\nStatus:             Pending\r\nIP:                 172.17.0.24\r\nControlled By:      ReplicaSet\/nee-7b855dcd99\r\nContainers:\r\n  nginx:\r\n    Container ID:\r\n    Image:          bitnami\/nginx\r\n    Image ID:\r\n    Port:           &lt;none&gt;\r\n    Host Port:      &lt;none&gt;\r\n    State:          Waiting\r\n      Reason:       CreateContainerError\r\n    Ready:          False\r\n    Restart Count:  0\r\n    Limits:\r\n      cpu:     20m\r\n      memory:  5Mi\r\n    Requests:\r\n      cpu:        10m\r\n      memory:     1Mi\r\n    Environment:  &lt;none&gt;\r\n    Mounts:\r\n      \/var\/run\/secrets\/kubernetes.io\/serviceaccount from default-token-h5g6h (ro)\r\nConditions:\r\n  Type              Status\r\n  Initialized       True\r\n  Ready             False\r\n  ContainersReady   False\r\n  PodScheduled      True\r\nVolumes:\r\n  default-token-h5g6h:\r\n    Type:        Secret (a volume populated by a Secret)\r\n    SecretName:  default-token-h5g6h\r\n    Optional:    false\r\nQoS Class:       Burstable\r\nNode-Selectors:  &lt;none&gt;\r\nTolerations:     node.kubernetes.io\/memory-pressure:NoSchedule\r\nEvents:\r\n  Type     Reason     Age              From                Message\r\n  ----     ------     ----             ----                -------\r\n  Normal   Scheduled  4m               default-scheduler   Successfully assigned limits\/nee-7b855dcd99-zh7z6 to localhost\r\n  Normal   Pulled     3m (x8 over 4m)  kubelet, localhost  Successfully pulled image \"bitnami\/nginx\"\r\n  Warning  Failed     3m (x8 over 4m)  kubelet, localhost  Error: Error response from daemon: Minimum memory limit allowed is 6MB\r\n  Normal   Pulling    3m (x9 over 4m)  kubelet, localhost  pulling image \"bitnami\/nginx\"\r\n\r\n$ oc set resources deploy nee --requests=cpu=0m,memory=0Mi --limits=cpu=0m,memory=0Mi\r\ndeployment.extensions\/nee resource requirements updated\r\n\r\n$ oc get pods\r\nNAME                   READY     STATUS        RESTARTS   AGE\r\nnee-597889d8c7-p6tc2   1\/1       Running       0          4s\r\nnee-6f4f4dbf77-p247v   0\/1       Terminating   0          10m\r\n\r\n$ oc describe deployment nee-6f4f4dbf77-p247v\r\nError from server (NotFound): deployments.extensions \"nee-6f4f4dbf77-p247v\" not found\r\n\r\n$ oc describe deployment nee\r\nName:                   nee\r\nNamespace:              limits\r\nCreationTimestamp:      Fri, 28 Jul 2023 18:12:04 +0200\r\nLabels:                 app=nee\r\nAnnotations:            deployment.kubernetes.io\/revision=5\r\nSelector:               app=nee\r\nReplicas:               1 desired | 1 updated | 1 total | 1 available | 0 unavailable\r\nStrategyType:           RollingUpdate\r\nMinReadySeconds:        0\r\nRollingUpdateStrategy:  25% max unavailable, 25% max surge\r\nPod Template:\r\n  Labels:  app=nee\r\n  Containers:\r\n   nginx:\r\n    Image:      bitnami\/nginx\r\n    Port:       &lt;none&gt;\r\n    Host Port:  &lt;none&gt;\r\n    Limits:\r\n      cpu:     0\r\n      memory:  0\r\n    Requests:\r\n      cpu:        0\r\n      memory:     0\r\n    Environment:  &lt;none&gt;\r\n    Mounts:       &lt;none&gt;\r\n  Volumes:        &lt;none&gt;\r\nConditions:\r\n  Type           Status  Reason\r\n  ----           ------  ------\r\n  Available      True    MinimumReplicasAvailable\r\n  Progressing    True    NewReplicaSetAvailable\r\nOldReplicaSets:  &lt;none&gt;\r\nNewReplicaSet:   nee-597889d8c7 (1\/1 replicas created)\r\nEvents:\r\n  Type    Reason             Age               From                   Message\r\n  ----    ------             ----              ----                   -------\r\n  Normal  ScalingReplicaSet  10m               deployment-controller  Scaled up replica set nee-6f4f4dbf77 to 1\r\n  Normal  ScalingReplicaSet  6m                deployment-controller  Scaled up replica set nee-c944fdfd6 to 1\r\n  Normal  ScalingReplicaSet  6m (x2 over 6m)   deployment-controller  Scaled up replica set nee-7b855dcd99 to 1\r\n  Normal  ScalingReplicaSet  6m                deployment-controller  Scaled down replica set nee-c944fdfd6 to 0\r\n  Normal  ScalingReplicaSet  32s (x2 over 6m)  deployment-controller  Scaled down replica set nee-7b855dcd99 to 0\r\n  Normal  ScalingReplicaSet  32s               deployment-controller  Scaled up replica set nee-597889d8c7 to 1\r\n  Normal  ScalingReplicaSet  30s               deployment-controller  Scaled down replica set nee-6f4f4dbf77 to 0\r\n\r\n$ oc get pods\r\nNAME                   READY     STATUS    RESTARTS   AGE\r\nnee-597889d8c7-p6tc2   1\/1       Running   0          44s\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #3366ff;\">Monitoring resource availability:<\/span><\/p>\n<ul>\n<li>Use <code>oc describe node nodename<\/code> to get information about current CPU and memory usage for each Pod running on the node\n<ul>\n<li>Notice the summary line at the end of the output, where you&#8217;ll see requests as well as limits that have been set<\/li>\n<\/ul>\n<\/li>\n<li>Use <code>oc adm top<\/code> to get actual resource usage\n<ul>\n<li>Notice this requires metrics server to be installed and configured<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<pre class=\"lang:default decode:true\">$ oc login -u developer -p developer\r\n\r\n$ oc describe node localhost\r\nError from server (Forbidden): nodes \"localhost\" is forbidden: User \"developer\" cannot get nodes at the cluster scope: no RBAC policy matched\r\n\r\n$ oc login -u kubadmin -p kubepass\r\n\r\n$ oc describe node localhost\r\nError from server (Forbidden): nodes \"localhost\" is forbidden: User \"kubadmin\" cannot get nodes at the cluster scope: no RBAC policy matched\r\n\r\n$ oc login -u system:admin\r\nLogged into \"https:\/\/172.30.9.22:8443\" as \"system:admin\" using existing credentials.\r\n\r\nYou have access to the following projects and can switch between them with 'oc project &lt;projectname&gt;':\r\n\r\n    auto\r\n    debug\r\n  * default\r\nUsing project \"default\".\r\n\r\n$ oc describe node localhost\r\nName:               localhost\r\nRoles:              &lt;none&gt;\r\nLabels:             beta.kubernetes.io\/arch=amd64\r\n                    beta.kubernetes.io\/os=linux\r\n                    kubernetes.io\/hostname=localhost\r\nAnnotations:        volumes.kubernetes.io\/controller-managed-attach-detach=true\r\nCreationTimestamp:  Sat, 22 Jul 2023 20:54:32 +0200\r\nTaints:             &lt;none&gt;\r\nUnschedulable:      false\r\nConditions:\r\n  Type             Status  LastHeartbeatTime                 LastTransitionTime                Reason                       Message\r\n  ----             ------  -----------------                 ------------------                ------                       -------\r\n  OutOfDisk        False   Fri, 28 Jul 2023 18:29:58 +0200   Sat, 22 Jul 2023 20:54:22 +0200   KubeletHasSufficientDisk     kubelet has sufficient disk space available\r\n  MemoryPressure   False   Fri, 28 Jul 2023 18:29:58 +0200   Sat, 22 Jul 2023 20:54:22 +0200   KubeletHasSufficientMemory   kubelet has sufficient memory available\r\n  DiskPressure     False   Fri, 28 Jul 2023 18:29:58 +0200   Sat, 22 Jul 2023 20:54:22 +0200   KubeletHasNoDiskPressure     kubelet has no disk pressure\r\n  PIDPressure      False   Fri, 28 Jul 2023 18:29:58 +0200   Sat, 22 Jul 2023 20:54:22 +0200   KubeletHasSufficientPID      kubelet has sufficient PID available\r\n  Ready            True    Fri, 28 Jul 2023 18:29:58 +0200   Sat, 22 Jul 2023 20:54:22 +0200   KubeletReady                 kubelet is posting ready status\r\nAddresses:\r\n  InternalIP:  172.30.9.22\r\n  Hostname:    localhost\r\nCapacity:\r\n cpu:            8\r\n hugepages-1Gi:  0\r\n hugepages-2Mi:  0\r\n memory:         7981844Ki\r\n pods:           250\r\nAllocatable:\r\n cpu:            8\r\n hugepages-1Gi:  0\r\n hugepages-2Mi:  0\r\n memory:         7879444Ki\r\n pods:           250\r\nSystem Info:\r\n Machine ID:                     a37388a4746444f1b3f079f777748845\r\n System UUID:                    6099DE02-9EA8-C210-7553-A7697F2C302A\r\n Boot ID:                        7c076895-85e9-45ce-ae2c-8bbe7127be73\r\n Kernel Version:                 3.10.0-1160.92.1.el7.x86_64\r\n OS Image:                       CentOS Linux 7 (Core)\r\n Operating System:               linux\r\n Architecture:                   amd64\r\n Container Runtime Version:      docker:\/\/24.0.3\r\n Kubelet Version:                v1.11.0+d4cacc0\r\n Kube-Proxy Version:             v1.11.0+d4cacc0\r\nNon-terminated Pods:             (32 in total)\r\n  Namespace                      Name                                                       CPU Requests  CPU Limits  Memory Requests  Memory Limits\r\n  ---------                      ----                                                       ------------  ----------  ---------------  -------------\r\n  debug                          dnginx-88c7766dd-hlbtd                                     0 (0%)        0 (0%)      0 (0%)           0 (0%)\r\n  default                        bitginx-1-jzk9r                                            0 (0%)        0 (0%)      0 (0%)           0 (0%)\r\n  default                        busybox                                                    0 (0%)        0 (0%)      0 (0%)           0 (0%)\r\n  default                        docker-registry-1-ctgff                                    100m (1%)     0 (0%)      256Mi (3%)       0 (0%)\r\n  default                        lab4pod                                                    0 (0%)        0 (0%)      0 (0%)           0 (0%)\r\n  default                        linginx1-dc9f65f54-6zw8j                                   0 (0%)        0 (0%)      0 (0%)           0 (0%)\r\n  default                        linginx2-69bf6fc66b-mv6wx                                  0 (0%)        0 (0%)      0 (0%)           0 (0%)\r\n  default                        nginx                                                      0 (0%)        0 (0%)      0 (0%)           0 (0%)\r\n  default                        nginx-cm                                                   0 (0%)        0 (0%)      0 (0%)           0 (0%)\r\n  default                        pv-pod                                                     0 (0%)        0 (0%)      0 (0%)           0 (0%)\r\n  default                        router-1-k8zgt                                             100m (1%)     0 (0%)      256Mi (3%)       0 (0%)\r\n  default                        test1                                                      0 (0%)        0 (0%)      0 (0%)           0 (0%)\r\n  kube-dns                       kube-dns-t727w                                             0 (0%)        0 (0%)      0 (0%)           0 (0%)\r\n  kube-proxy                     kube-proxy-cr7kh                                           0 (0%)        0 (0%)      0 (0%)           0 (0%)\r\n  kube-system                    kube-controller-manager-localhost                          0 (0%)        0 (0%)      0 (0%)           0 (0%)\r\n  kube-system                    kube-scheduler-localhost                                   0 (0%)        0 (0%)      0 (0%)           0 (0%)\r\n  kube-system                    master-api-localhost                                       0 (0%)        0 (0%)      0 (0%)           0 (0%)\r\n  kube-system                    master-etcd-localhost                                      0 (0%)        0 (0%)      0 (0%)           0 (0%)\r\n  limits                         nee-597889d8c7-p6tc2                                       0 (0%)        0 (0%)      0 (0%)           0 (0%)\r\n  network-security               nginxlab-1-bcgkt                                           0 (0%)        0 (0%)      0 (0%)           0 (0%)\r\n  nodesel                        simple-6f55965d79-mklpc                                    0 (0%)        0 (0%)      0 (0%)           0 (0%)\r\n  nodesel                        simple-6f55965d79-q8pq9                                    0 (0%)        0 (0%)      0 (0%)           0 (0%)\r\n  openshift-apiserver            openshift-apiserver-thwpd                                  0 (0%)        0 (0%)      0 (0%)           0 (0%)\r\n  openshift-controller-manager   openshift-controller-manager-c9ms5                         0 (0%)        0 (0%)      0 (0%)           0 (0%)\r\n  openshift-core-operators       openshift-service-cert-signer-operator-6d477f986b-jzcgw    0 (0%)        0 (0%)      0 (0%)           0 (0%)\r\n  openshift-core-operators       openshift-web-console-operator-664b974ff5-px7gw            0 (0%)        0 (0%)      0 (0%)           0 (0%)\r\n  openshift-service-cert-signer  apiservice-cabundle-injector-8ffbbb6dc-x9l4r               0 (0%)        0 (0%)      0 (0%)           0 (0%)\r\n  openshift-service-cert-signer  service-serving-cert-signer-668c45d5f-lxvff                0 (0%)        0 (0%)      0 (0%)           0 (0%)\r\n  openshift-web-console          webconsole-78f59b4bfb-qqv4p                                100m (1%)     0 (0%)      100Mi (1%)       0 (0%)\r\n  source-project                 nginx-access                                               0 (0%)        0 (0%)      0 (0%)           0 (0%)\r\n  source-project                 nginx-noaccess                                             0 (0%)        0 (0%)      0 (0%)           0 (0%)\r\n  target-project                 nginx-target-1-9kdn6                                       0 (0%)        0 (0%)      0 (0%)           0 (0%)\r\nAllocated resources:\r\n  (Total limits may be over 100 percent, i.e., overcommitted.)\r\n  Resource  Requests    Limits\r\n  --------  --------    ------\r\n  cpu       300m (3%)   0 (0%)\r\n  memory    612Mi (7%)  0 (0%)\r\nEvents:     &lt;none&gt;\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #3366ff;\">Using Quotas<\/span><\/p>\n<ul>\n<li>Quotas are used to apply limits\n<ul>\n<li>On the number of objects, such as Pods, services, and routes<\/li>\n<li>On compute resources, such as CPU, memory and storage<\/li>\n<\/ul>\n<\/li>\n<li>Quotas are useful for preventing the exhaustion of vital resources\n<ul>\n<li>Etcd<\/li>\n<li>IP addresses<\/li>\n<li>Compute capacity of worker nodes<\/li>\n<\/ul>\n<\/li>\n<li>Quotas are applied to new resources but do not limit current resources<\/li>\n<li>To apply quota, the ResourceQuota resource is used<\/li>\n<li>Use a YAML file, or <code>oc create quota my-quota --hard service 10,cpu=1400,memory-1.8Gi<\/code><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #3366ff;\">Quota Scope<\/span><\/p>\n<ul>\n<li>\u00a0<code>resourcequotas<\/code> are applied to projects to limit use of resources<\/li>\n<li><code>clusterresourcequotas<\/code> apply quota with a cluster scope<\/li>\n<li>Multiple resourcequotas can be applied on the same project\n<ul>\n<li>The effect is cummulative<\/li>\n<li>Limit one specific resource type for each quota resource used<\/li>\n<\/ul>\n<\/li>\n<li>Use <code>oc create quota -h<\/code> for command line help on how to apply<\/li>\n<li>Avoid using YAML<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #3366ff;\">Verifying Resource Quota<\/span><\/p>\n<ul>\n<li><code>oc get resourcequota<\/code> gives an overview of all resourcequota API resources<\/li>\n<li><code>oc describe quota<\/code> will show cumulative quotas from all resourcequota in the current project<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #3366ff;\">Quota-related Failure<\/span><\/p>\n<ul>\n<li>If a modification exceeds the resource count (like number of Pods), OpenShift will deny the modification immediately<\/li>\n<li>If a modification exceeds quota for a compute resource (such as available RAM), OpenShift will not fail immediately to give the administrator some time to fix the issue<\/li>\n<li>If a quota that restricts usage of compute resources is used, OpenShift will not create Pods that do not have resource requests or limits set also<\/li>\n<li>It&#8217;s also recommended to use LimitRange to specify the default values for resource requests<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #3366ff;\">Applying Resource Quota <\/span><\/p>\n<ul>\n<li><code>oc login -u developer -p password <\/code><\/li>\n<li><code>oc new-project quota-test <\/code><\/li>\n<li><code>oc login -u admin -p password <\/code><\/li>\n<li><code>oc create quota qtest --hard pods=3,cpu=100,memory=500Mi <\/code><\/li>\n<li><code>oc describe quota <\/code><\/li>\n<li><code>oc login -u developer -p password <\/code><\/li>\n<li><code>oc create deploy bitginx --image=bitnami\/nginx:latest --replicas =3<\/code><\/li>\n<li><code> oc get all<\/code> # no pods<\/li>\n<li><code>oc describe rs\/bitginx-xxx<\/code> # it fails because no quota have been set on the deployment<\/li>\n<li><code>oc set resources deploy bitginx --requests cpu=10m,memory=5Mi --limits cpu=20m,memory=20Mi<\/code><\/li>\n<\/ul>\n<pre class=\"lang:default decode:true \">$ oc login -u developer -p developer\r\nLogin successful.\r\n\r\nYou have access to the following projects and can switch between them with 'oc project &lt;projectname&gt;':\r\n\r\n  * auto\r\nUsing project \"auto\".\r\n\r\n$ oc new-project quota-test\r\nNow using project \"quota-test\" on server \"https:\/\/172.30.9.22:8443\".\r\n\r\nYou can add applications to this project with the 'new-app' command. For example, try:\r\n\r\n    oc new-app centos\/ruby-25-centos7~https:\/\/github.com\/sclorg\/ruby-ex.git\r\n\r\nto build a new example application in Ruby.\r\n\r\n$ oc login -u system:admin\r\nLogged into \"https:\/\/172.30.9.22:8443\" as \"system:admin\" using existing credentials.\r\n\r\nYou have access to the following projects and can switch between them with 'oc project &lt;projectname&gt;':\r\n  * quota-test\r\nUsing project \"quota-test\".\r\n\r\n$ oc create quota qtest --hard pods=3,cpu=100,memory=500Mi\r\nresourcequota\/qtest created\r\n\r\n$ oc describe quota\r\nName:       qtest\r\nNamespace:  quota-test\r\nResource    Used  Hard\r\n--------    ----  ----\r\ncpu         0     100\r\nmemory      0     500Mi\r\npods        0     3\r\n\r\n\r\n$ oc login -u developer -p developer\r\nLogin successful.\r\n\r\nYou have access to the following projects and can switch between them with 'oc project &lt;projectname&gt;':\r\n\r\n  * quota-test\r\n\r\nUsing project \"quota-test\".\r\n\r\n$ oc create deploy bitginx --image=bitnami\/nginx:latest --replicas=3\r\nError: unknown flag: --replicas\r\n\r\n\r\nAliases:\r\ndeployment, deploy\r\n\r\nUsage:\r\n  oc create deployment NAME --image=image [--dry-run] [flags]\r\n\r\nExamples:\r\n  # Create a new deployment named my-dep that runs the busybox image.\r\n  oc create deployment my-dep --image=busybox\r\n\r\nOptions:\r\n      --allow-missing-template-keys=true: If true, ignore any errors in templates when a field or map key is missing in the template. Only appl                                                  ies to golang and jsonpath output formats.\r\n      --dry-run=false: If true, only print the object that would be sent, without sending it.\r\n      --generator='': The name of the API generator to use.\r\n      --image=[]: Image name to run.\r\n  -o, --output='': Output format. One of: json|yaml|name|go-template-file|templatefile|template|go-template|jsonpath|jsonpath-file.\r\n      --save-config=false: If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unch                                                  anged. This flag is useful when you want to perform kubectl apply on this object in the future.\r\n      --template='': Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang te                                                  mplates [http:\/\/golang.org\/pkg\/text\/template\/#pkg-overview].\r\n      --validate=false: If true, use a schema to validate the input before sending it\r\n\r\nUse \"oc options\" for a list of global command-line options (applies to all commands).\r\n\r\n$ oc create deploy bitginx --image=bitnami\/nginx:latest\r\ndeployment.apps\/bitginx created\r\n\r\n$ oc get all\r\nNAME                      DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE\r\ndeployment.apps\/bitginx   1         0         0            0           6s\r\n\r\nNAME                                 DESIRED   CURRENT   READY     AGE\r\nreplicaset.apps\/bitginx-794f7cf64f   1         0         0         6s\r\n\r\n$ oc get all\r\nNAME                      DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE\r\ndeployment.apps\/bitginx   1         0         0            0           21s\r\n\r\nNAME                                 DESIRED   CURRENT   READY     AGE\r\nreplicaset.apps\/bitginx-794f7cf64f   1         0         0         21s\r\n\r\n\r\n$ oc describe rs\/bitginx-794f7cf64f\r\nName:           bitginx-794f7cf64f\r\nNamespace:      quota-test\r\nSelector:       app=bitginx,pod-template-hash=3509379209\r\nLabels:         app=bitginx\r\n                pod-template-hash=3509379209\r\nAnnotations:    deployment.kubernetes.io\/desired-replicas=1\r\n                deployment.kubernetes.io\/max-replicas=2\r\n                deployment.kubernetes.io\/revision=1\r\nControlled By:  Deployment\/bitginx\r\nReplicas:       0 current \/ 1 desired\r\nPods Status:    0 Running \/ 0 Waiting \/ 0 Succeeded \/ 0 Failed\r\nPod Template:\r\n  Labels:  app=bitginx\r\n           pod-template-hash=3509379209\r\n  Containers:\r\n   nginx:\r\n    Image:        bitnami\/nginx:latest\r\n    Port:         &lt;none&gt;\r\n    Host Port:    &lt;none&gt;\r\n    Environment:  &lt;none&gt;\r\n    Mounts:       &lt;none&gt;\r\n  Volumes:        &lt;none&gt;\r\nConditions:\r\n  Type             Status  Reason\r\n  ----             ------  ------\r\n  ReplicaFailure   True    FailedCreate\r\nEvents:\r\n  Type     Reason        Age                From                   Message\r\n  ----     ------        ----               ----                   -------\r\n  Warning  FailedCreate  50s                replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-hk8l5\" is forbidden: failed quota:                                                   qtest: must specify cpu,memory\r\n  Warning  FailedCreate  49s                replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-jp7p9\" is forbidden: failed quota:                                                   qtest: must specify cpu,memory\r\n  Warning  FailedCreate  49s                replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-plhwc\" is forbidden: failed quota:                                                   qtest: must specify cpu,memory\r\n  Warning  FailedCreate  49s                replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-gc5l4\" is forbidden: failed quota:                                                   qtest: must specify cpu,memory\r\n  Warning  FailedCreate  49s                replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-bgrcz\" is forbidden: failed quota:                                                   qtest: must specify cpu,memory\r\n  Warning  FailedCreate  49s                replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-k89qz\" is forbidden: failed quota:                                                   qtest: must specify cpu,memory\r\n  Warning  FailedCreate  49s                replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-w5hv7\" is forbidden: failed quota:                                                   qtest: must specify cpu,memory\r\n  Warning  FailedCreate  49s                replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-xcknq\" is forbidden: failed quota:                                                   qtest: must specify cpu,memory\r\n  Warning  FailedCreate  48s                replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-r5frr\" is forbidden: failed quota:                                                   qtest: must specify cpu,memory\r\n  Warning  FailedCreate  29s (x5 over 47s)  replicaset-controller  (combined from similar events): Error creating: pods \"bitginx-794f7cf64f-p78                                                  6m\" is forbidden: failed quota: qtest: must specify cpu,memory\r\n\r\n\r\n$ oc set resources deploy bitginx --requests cpu=10m,memory=5Mi --limits cpu=50m,memory=20Mi\r\ndeployment.extensions\/bitginx resource requirements updated\r\n\r\n\r\n$ oc get all\r\nNAME                           READY     STATUS    RESTARTS   AGE\r\npod\/bitginx-84b698ff5c-x8228   1\/1       Running   0          7s\r\n\r\nNAME                      DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE\r\ndeployment.apps\/bitginx   1         1         1            1           2m\r\n\r\nNAME                                 DESIRED   CURRENT   READY     AGE\r\nreplicaset.apps\/bitginx-794f7cf64f   0         0         0         2m\r\nreplicaset.apps\/bitginx-84b698ff5c   1         1         1         7s\r\n[root@okd ~]# oc describe rs\/bitginx-794f7cf64f\r\nName:           bitginx-794f7cf64f\r\nNamespace:      quota-test\r\nSelector:       app=bitginx,pod-template-hash=3509379209\r\nLabels:         app=bitginx\r\n                pod-template-hash=3509379209\r\nAnnotations:    deployment.kubernetes.io\/desired-replicas=1\r\n                deployment.kubernetes.io\/max-replicas=2\r\n                deployment.kubernetes.io\/revision=1\r\nControlled By:  Deployment\/bitginx\r\nReplicas:       0 current \/ 0 desired\r\nPods Status:    0 Running \/ 0 Waiting \/ 0 Succeeded \/ 0 Failed\r\nPod Template:\r\n  Labels:  app=bitginx\r\n           pod-template-hash=3509379209\r\n  Containers:\r\n   nginx:\r\n    Image:        bitnami\/nginx:latest\r\n    Port:         &lt;none&gt;\r\n    Host Port:    &lt;none&gt;\r\n    Environment:  &lt;none&gt;\r\n    Mounts:       &lt;none&gt;\r\n  Volumes:        &lt;none&gt;\r\nEvents:\r\n  Type     Reason        Age               From                   Message\r\n  ----     ------        ----              ----                   -------\r\n  Warning  FailedCreate  2m                replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-hk8l5\" is forbidden: failed quota: q                                                  test: must specify cpu,memory\r\n  Warning  FailedCreate  2m                replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-jp7p9\" is forbidden: failed quota: q                                                  test: must specify cpu,memory\r\n  Warning  FailedCreate  2m                replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-plhwc\" is forbidden: failed quota: q                                                  test: must specify cpu,memory\r\n  Warning  FailedCreate  2m                replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-gc5l4\" is forbidden: failed quota: q                                                  test: must specify cpu,memory\r\n  Warning  FailedCreate  2m                replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-bgrcz\" is forbidden: failed quota: q                                                  test: must specify cpu,memory\r\n  Warning  FailedCreate  2m                replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-k89qz\" is forbidden: failed quota: q                                                  test: must specify cpu,memory\r\n  Warning  FailedCreate  2m                replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-w5hv7\" is forbidden: failed quota: q                                                  test: must specify cpu,memory\r\n  Warning  FailedCreate  2m                replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-xcknq\" is forbidden: failed quota: q                                                  test: must specify cpu,memory\r\n  Warning  FailedCreate  2m                replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-r5frr\" is forbidden: failed quota: q                                                  test: must specify cpu,memory\r\n  Warning  FailedCreate  27s (x7 over 2m)  replicaset-controller  (combined from similar events): Error creating: pods \"bitginx-794f7cf64f-m85v                                                  g\" is forbidden: failed quota: qtest: must specify cpu,memory\r\n\r\n\r\n$ oc scale deployment bitginx --replicas=3\r\ndeployment.extensions\/bitginx scaled\r\n\r\n$ oc get all\r\nNAME                           READY     STATUS    RESTARTS   AGE\r\npod\/bitginx-84b698ff5c-2tbzt   1\/1       Running   0          14s\r\npod\/bitginx-84b698ff5c-48mn7   1\/1       Running   0          14s\r\npod\/bitginx-84b698ff5c-x8228   1\/1       Running   0          1m\r\n\r\nNAME                      DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE\r\ndeployment.apps\/bitginx   3         3         3            3           4m\r\n\r\nNAME                                 DESIRED   CURRENT   READY     AGE\r\nreplicaset.apps\/bitginx-794f7cf64f   0         0         0         4m\r\nreplicaset.apps\/bitginx-84b698ff5c   3         3         3         1m\r\n\r\n\r\n$ oc describe rs\/bitginx-794f7cf64f\r\nName:           bitginx-794f7cf64f\r\nNamespace:      quota-test\r\nSelector:       app=bitginx,pod-template-hash=3509379209\r\nLabels:         app=bitginx\r\n                pod-template-hash=3509379209\r\nAnnotations:    deployment.kubernetes.io\/desired-replicas=1\r\n                deployment.kubernetes.io\/max-replicas=2\r\n                deployment.kubernetes.io\/revision=1\r\nControlled By:  Deployment\/bitginx\r\nReplicas:       0 current \/ 0 desired\r\nPods Status:    0 Running \/ 0 Waiting \/ 0 Succeeded \/ 0 Failed\r\nPod Template:\r\n  Labels:  app=bitginx\r\n           pod-template-hash=3509379209\r\n  Containers:\r\n   nginx:\r\n    Image:        bitnami\/nginx:latest\r\n    Port:         &lt;none&gt;\r\n    Host Port:    &lt;none&gt;\r\n    Environment:  &lt;none&gt;\r\n    Mounts:       &lt;none&gt;\r\n  Volumes:        &lt;none&gt;\r\nEvents:\r\n  Type     Reason        Age              From                   Message\r\n  ----     ------        ----             ----                   -------\r\n  Warning  FailedCreate  4m               replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-hk8l5\" is forbidden: failed quota: qt                                                  est: must specify cpu,memory\r\n  Warning  FailedCreate  4m               replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-jp7p9\" is forbidden: failed quota: qt                                                  est: must specify cpu,memory\r\n  Warning  FailedCreate  4m               replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-plhwc\" is forbidden: failed quota: qt                                                  est: must specify cpu,memory\r\n  Warning  FailedCreate  4m               replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-gc5l4\" is forbidden: failed quota: qt                                                  est: must specify cpu,memory\r\n  Warning  FailedCreate  4m               replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-bgrcz\" is forbidden: failed quota: qt                                                  est: must specify cpu,memory\r\n  Warning  FailedCreate  4m               replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-k89qz\" is forbidden: failed quota: qt                                                  est: must specify cpu,memory\r\n  Warning  FailedCreate  4m               replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-w5hv7\" is forbidden: failed quota: qt                                                  est: must specify cpu,memory\r\n  Warning  FailedCreate  4m               replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-xcknq\" is forbidden: failed quota: qt                                                  est: must specify cpu,memory\r\n  Warning  FailedCreate  4m               replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-r5frr\" is forbidden: failed quota: qt                                                  est: must specify cpu,memory\r\n  Warning  FailedCreate  2m (x7 over 4m)  replicaset-controller  (combined from similar events): Error creating: pods \"bitginx-794f7cf64f-m85vg                                                  \" is forbidden: failed quota: qtest: must specify cpu,memory\r\n\r\n\r\n$ oc get all\r\nNAME                           READY     STATUS    RESTARTS   AGE\r\npod\/bitginx-84b698ff5c-2tbzt   1\/1       Running   0          1m\r\npod\/bitginx-84b698ff5c-48mn7   1\/1       Running   0          1m\r\npod\/bitginx-84b698ff5c-x8228   1\/1       Running   0          2m\r\n\r\nNAME                      DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE\r\ndeployment.apps\/bitginx   3         3         3            3           5m\r\n\r\nNAME                                 DESIRED   CURRENT   READY     AGE\r\nreplicaset.apps\/bitginx-794f7cf64f   0         0         0         5m\r\nreplicaset.apps\/bitginx-84b698ff5c   3         3         3         2m\r\n\r\n\r\n$ oc delete rs bitginx-84b698ff5c-2tbzt\r\nError from server (NotFound): replicasets.extensions \"bitginx-84b698ff5c-2tbzt\" not found\r\n[root@okd ~]# oc delete rs pod\/bitginx-84b698ff5c-2tbzt\r\nerror: there is no need to specify a resource type as a separate argument when passing arguments in resource\/name form (e.g. 'oc get resource\/&lt;                                                  resource_name&gt;' instead of 'oc get resource resource\/&lt;resource_name&gt;'\r\n\r\n\r\n$ oc delete pod bitginx-84b698ff5c-2tbzt\r\npod \"bitginx-84b698ff5c-2tbzt\" deleted\r\n\r\n$ oc delete pod bitginx-84b698ff5c-48mn7\r\npod \"bitginx-84b698ff5c-48mn7\" deleted\r\n\r\n$ oc delete pod bitginx-84b698ff5c-x8228\r\npod \"bitginx-84b698ff5c-x8228\" deleted\r\n\r\n$ oc get all\r\nNAME                           READY     STATUS    RESTARTS   AGE\r\npod\/bitginx-84b698ff5c-h5j57   1\/1       Running   0          27s\r\npod\/bitginx-84b698ff5c-qxwd5   1\/1       Running   0          13s\r\npod\/bitginx-84b698ff5c-xfnp4   1\/1       Running   0          47s\r\n\r\nNAME                      DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE\r\ndeployment.apps\/bitginx   3         3         3            3           7m\r\n\r\nNAME                                 DESIRED   CURRENT   READY     AGE\r\nreplicaset.apps\/bitginx-794f7cf64f   0         0         0         7m\r\nreplicaset.apps\/bitginx-84b698ff5c   3         3         3         5m\r\n\r\n$ oc describe rs\/bitginx-794f7cf64f\r\nName:           bitginx-794f7cf64f\r\nNamespace:      quota-test\r\nSelector:       app=bitginx,pod-template-hash=3509379209\r\nLabels:         app=bitginx\r\n                pod-template-hash=3509379209\r\nAnnotations:    deployment.kubernetes.io\/desired-replicas=1\r\n                deployment.kubernetes.io\/max-replicas=2\r\n                deployment.kubernetes.io\/revision=1\r\nControlled By:  Deployment\/bitginx\r\nReplicas:       0 current \/ 0 desired\r\nPods Status:    0 Running \/ 0 Waiting \/ 0 Succeeded \/ 0 Failed\r\nPod Template:\r\n  Labels:  app=bitginx\r\n           pod-template-hash=3509379209\r\n  Containers:\r\n   nginx:\r\n    Image:        bitnami\/nginx:latest\r\n    Port:         &lt;none&gt;\r\n    Host Port:    &lt;none&gt;\r\n    Environment:  &lt;none&gt;\r\n    Mounts:       &lt;none&gt;\r\n  Volumes:        &lt;none&gt;\r\nEvents:\r\n  Type     Reason        Age              From                   Message\r\n  ----     ------        ----             ----                   -------\r\n  Warning  FailedCreate  7m               replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-hk8l5\" is forbidden: failed quota: qt                                                  est: must specify cpu,memory\r\n  Warning  FailedCreate  7m               replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-jp7p9\" is forbidden: failed quota: qt                                                  est: must specify cpu,memory\r\n  Warning  FailedCreate  7m               replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-plhwc\" is forbidden: failed quota: qt                                                  est: must specify cpu,memory\r\n  Warning  FailedCreate  7m               replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-gc5l4\" is forbidden: failed quota: qt                                                  est: must specify cpu,memory\r\n  Warning  FailedCreate  7m               replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-bgrcz\" is forbidden: failed quota: qt                                                  est: must specify cpu,memory\r\n  Warning  FailedCreate  7m               replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-k89qz\" is forbidden: failed quota: qt                                                  est: must specify cpu,memory\r\n  Warning  FailedCreate  7m               replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-w5hv7\" is forbidden: failed quota: qt                                                  est: must specify cpu,memory\r\n  Warning  FailedCreate  7m               replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-xcknq\" is forbidden: failed quota: qt                                                  est: must specify cpu,memory\r\n  Warning  FailedCreate  7m               replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-r5frr\" is forbidden: failed quota: qt                                                  est: must specify cpu,memory\r\n  Warning  FailedCreate  5m (x7 over 7m)  replicaset-controller  (combined from similar events): Error creating: pods \"bitginx-794f7cf64f-m85vg                                                  \" is forbidden: failed quota: qtest: must specify cpu,memory\r\n\r\n$ oc describe rs\/bitginx-794f7cf64f\r\nName:           bitginx-794f7cf64f\r\nNamespace:      quota-test\r\nSelector:       app=bitginx,pod-template-hash=3509379209\r\nLabels:         app=bitginx\r\n                pod-template-hash=3509379209\r\nAnnotations:    deployment.kubernetes.io\/desired-replicas=1\r\n                deployment.kubernetes.io\/max-replicas=2\r\n                deployment.kubernetes.io\/revision=1\r\nControlled By:  Deployment\/bitginx\r\nReplicas:       0 current \/ 0 desired\r\nPods Status:    0 Running \/ 0 Waiting \/ 0 Succeeded \/ 0 Failed\r\nPod Template:\r\n  Labels:  app=bitginx\r\n           pod-template-hash=3509379209\r\n  Containers:\r\n   nginx:\r\n    Image:        bitnami\/nginx:latest\r\n    Port:         &lt;none&gt;\r\n    Host Port:    &lt;none&gt;\r\n    Environment:  &lt;none&gt;\r\n    Mounts:       &lt;none&gt;\r\n  Volumes:        &lt;none&gt;\r\nEvents:\r\n  Type     Reason        Age              From                   Message\r\n  ----     ------        ----             ----                   -------\r\n  Warning  FailedCreate  8m               replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-hk8l5\" is forbidden: failed quota: qtest: must specify cpu,memory\r\n  Warning  FailedCreate  8m               replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-jp7p9\" is forbidden: failed quota: qtest: must specify cpu,memory\r\n  Warning  FailedCreate  8m               replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-plhwc\" is forbidden: failed quota: qtest: must specify cpu,memory\r\n  Warning  FailedCreate  8m               replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-gc5l4\" is forbidden: failed quota: qtest: must specify cpu,memory\r\n  Warning  FailedCreate  8m               replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-bgrcz\" is forbidden: failed quota: qtest: must specify cpu,memory\r\n  Warning  FailedCreate  8m               replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-k89qz\" is forbidden: failed quota: qtest: must specify cpu,memory\r\n  Warning  FailedCreate  8m               replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-w5hv7\" is forbidden: failed quota: qtest: must specify cpu,memory\r\n  Warning  FailedCreate  8m               replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-xcknq\" is forbidden: failed quota: qtest: must specify cpu,memory\r\n  Warning  FailedCreate  8m               replicaset-controller  Error creating: pods \"bitginx-794f7cf64f-r5frr\" is forbidden: failed quota: qtest: must specify cpu,memory\r\n  Warning  FailedCreate  5m (x7 over 8m)  replicaset-controller  (combined from similar events): Error creating: pods \"bitginx-794f7cf64f-m85vg\" is forbidden: failed quota: qtest: must specify cpu,memory\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #3366ff;\">Using Limit Ranges<\/span><\/p>\n<ul>\n<li>A limit range resource defines default, minimum and maximum values for compute resource requests<\/li>\n<li>Limit range can be set on a project, as well as on individual resources<\/li>\n<li>Limit range can specify CPU and memory for containers and Pods<\/li>\n<li>Limit range can specify storage for Image and PVC<\/li>\n<li>Use a template to apply the limit range to any new project created from that moment on<\/li>\n<li>The main difference between a limit range and a resource quota, is that the limit range specifies allowed values for individual resources, whereas project quota set the maximum values that can be used by all resources in a project<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #3366ff;\">Creating a Limit Range<\/span><\/p>\n<ul>\n<li><code>oc new-project limits <\/code><\/li>\n<li><code>oc login -u admin -p password <\/code><\/li>\n<li><code>oc explain limitrange.spec.limits <\/code><\/li>\n<li><code>oc create --save-config -f limits.yaml <\/code><\/li>\n<li><code>oc get limitrange <\/code><\/li>\n<li><code>oc describe limitrange limit-limits<\/code><\/li>\n<\/ul>\n<pre class=\"lang:default decode:true \">$ oc login -u developer -p developer\r\nLogin successful.\r\nYou have access to the following projects and can switch between them with 'oc project &lt;projectname&gt;':\r\n    debug\r\n    limits\r\n  * quota-test\r\n\r\nUsing project \"quota-test\".\r\n\r\n$ oc new-project limits\r\nError from server (AlreadyExists): project.project.openshift.io \"limits\" already exists\r\n\r\n$ oc project limits\r\nNow using project \"limits\" on server \"https:\/\/172.30.9.22:8443\".\r\n\r\n$ oc explain limitrange.spec.limits\r\nKIND:     LimitRange\r\nVERSION:  v1\r\nRESOURCE: limits &lt;[]Object&gt;\r\nDESCRIPTION:\r\n     Limits is the list of LimitRangeItem objects that are enforced.\r\n\r\n     LimitRangeItem defines a min\/max usage limit for any resource that matches\r\n     on kind.\r\n\r\nFIELDS:\r\n   default      &lt;map[string]string&gt;\r\n     Default resource requirement limit value by resource name if resource limit\r\n     is omitted.\r\n\r\n   defaultRequest       &lt;map[string]string&gt;\r\n     DefaultRequest is the default resource requirement request value by\r\n     resource name if resource request is omitted.\r\n\r\n   max  &lt;map[string]string&gt;\r\n     Max usage constraints on this kind by resource name.\r\n\r\n   maxLimitRequestRatio &lt;map[string]string&gt;\r\n     MaxLimitRequestRatio if specified, the named resource must have a request\r\n     and limit that are both non-zero where limit divided by request is less\r\n     than or equal to the enumerated value; this represents the max burst for\r\n     the named resource.\r\n\r\n   min  &lt;map[string]string&gt;\r\n     Min usage constraints on this kind by resource name.\r\n\r\n   type &lt;string&gt;\r\n     Type of resource that this limit applies to.\r\n\r\n$ oc explain limitrange.spec.limits.type\r\nKIND:     LimitRange\r\nVERSION:  v1\r\n\r\nFIELD:    type &lt;string&gt;\r\n\r\nDESCRIPTION:\r\n     Type of resource that this limit applies to.\r\n\r\n$ cd ex280\r\n$ vi limitrange.yaml\r\n$ cat limitrange.yaml\r\napiVersion: template.openshift.io\/v1\r\nkind: Template\r\nmetadata:\r\n  creationTimestamp: null\r\n  name: project-request\r\nobjects:\r\n- apiVersion: project.openshift.io\/v1\r\n  kind: Project\r\n  metadata:\r\n    annotations:\r\n      openshift.io\/description: ${PROJECT_DESCRIPTION}\r\n      openshift.io\/display-name: ${PROJECT_DISPLAYNAME}\r\n      openshift.io\/requester: ${PROJECT_REQUESTING_USER}\r\n    creationTimestamp: null\r\n    name: ${PROJECT_NAME}\r\n  spec: {}\r\n  status: {}\r\n- apiVersion: rbac.authorization.k8s.io\/v1\r\n  kind: RoleBinding\r\n  metadata:\r\n    creationTimestamp: null\r\n    name: admin\r\n    namespace: ${PROJECT_NAME}\r\n  roleRef:\r\n    apiGroup: rbac.authorization.k8s.io\r\n    kind: ClusterRole\r\n    name: admin\r\n  subjects:\r\n  - apiGroup: rbac.authorization.k8s.io\r\n    kind: User\r\n    name: ${PROJECT_ADMIN_USER}\r\n- apiVersion: v1\r\n  kind: ResourceQuota\r\n  metadata:\r\n    name: ${PROJECT_NAME}-quota\r\n  spec:\r\n    hard:\r\n      cpu: 3\r\n      memory: 10G\r\n- apiVersion: v1\r\n  kind: LimitRange\r\n  metadata:\r\n    name: ${PROJECT_NAME}-limits\r\n  spec:\r\n    limits:\r\n      - type: Container\r\n        defaultRequest:\r\n          cpu: 30m\r\n          memory: 30M\r\nparameters:\r\n- name: PROJECT_NAME\r\n- name: PROJECT_DISPLAYNAME\r\n- name: PROJECT_DESCRIPTION\r\n- name: PROJECT_ADMIN_USER\r\n- name: PROJECT_REQUESTING_USER\r\n\r\n$ cat limits.yaml\r\napiVersion: v1\r\nkind: LimitRange\r\nmetadata:\r\n  name: limit-limits\r\nspec:\r\n  limits:\r\n  - type: Pod\r\n    max:\r\n      cpu: 500m\r\n      memory: 2Mi\r\n    min:\r\n      cpu: 10m\r\n      memory: 1Mi\r\n  - type: Container\r\n    max:\r\n      cpu: 500m\r\n      memory: 500Mi\r\n    min:\r\n      cpu: 10m\r\n      memory: 5Mi\r\n    default:\r\n      cpu: 250m\r\n      memory: 200Mi\r\n    defaultRequest:\r\n      cpu: 20m\r\n      memory: 20Mi\r\n  - type: openshift.io\/Image\r\n    max:\r\n      storage: 1Gi\r\n  - type: openshift.io\/ImageStream\r\n    max:\r\n      openshift.io\/image-tags: 10\r\n      openshift.io\/images: 20\r\n  - type: PersistentVolumeClaim\r\n    min:\r\n      storage: 2Gi\r\n    max:\r\n      storage: 50Gi\r\n\r\n\r\n$ oc create --save-config -f limits.yaml\r\nError from server (Forbidden): error when creating \"limits.yaml\": limitranges is forbidden: User \"developer\" cannot create limitranges in the namespace \"limits\": no RBAC policy matched\r\n\r\n$ oc login -u system:admin\r\nLogged into \"https:\/\/172.30.9.22:8443\" as \"system:admin\" using existing credentials.\r\nYou have access to the following projects and can switch between them with 'oc project &lt;projectname&gt;':\r\n    default\r\n  * limits\r\nUsing project \"limits\".\r\n\r\n$ oc create --save-config -f limits.yaml\r\nlimitrange\/limit-limits created\r\n\r\n$ oc get limitrange\r\nNAME           CREATED AT\r\nlimit-limits   2023-07-29T07:34:24Z\r\n\r\n$ oc describe limitrange limit-limits\r\nName:                     limit-limits\r\nNamespace:                limits\r\nType                      Resource                 Min  Max    Default Request  Default Limit  Max Limit\/Request Ratio\r\n----                      --------                 ---  ---    ---------------  -------------  -----------------------\r\nPod                       cpu                      10m  500m   -                -              -\r\nPod                       memory                   1Mi  2Mi    -                -              -\r\nContainer                 cpu                      10m  500m   20m              250m           -\r\nContainer                 memory                   5Mi  500Mi  20Mi             200Mi          -\r\nopenshift.io\/Image        storage                  -    1Gi    -                -              -\r\nopenshift.io\/ImageStream  openshift.io\/image-tags  -    10     -                -              -\r\nopenshift.io\/ImageStream  openshift.io\/images      -    20     -                -              -\r\nPersistentVolumeClaim     storage                  2Gi  50Gi   -                -              -\r\n\r\n\r\n$ oc delete -f limits.yaml\r\nlimitrange \"limit-limits\" deleted\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #3366ff;\">Applying Quotas to Multiple Projects<\/span><\/p>\n<ul>\n<li>The ClusterResourceQuota resource is created at cluster level and applies to multiple projects<\/li>\n<li>Administrator can specify which projects are subject to cluster resource quotas\n<ul>\n<li>By using the <code>openshift.io\/requester<\/code> annotation to specify project owner, in which all projects with that specific owner are subject to the quota<\/li>\n<li>Using a selector and labels: all projects that have labels matching the selector are subject to the quota<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><span style=\"color: #3366ff;\">Using Annotations or labels<\/span><\/p>\n<ul>\n<li>This will set a cluster resource quota that applies to all projects owned by user developer\n<ul>\n<li><code>oc create clusterquota user-developer--project-annotation-selector openshift.io\/requester=developer--hard pods=10,secrets=10<\/code><\/li>\n<\/ul>\n<\/li>\n<li>This will add a quota for all projects that have the label env=testing\n<ul>\n<li><code>oc create clusterquota testing --project-label-selector env=testing --hard pods=5,services=2 <\/code><\/li>\n<li><code>oc new-project test-project <\/code><\/li>\n<li><code>oc label ns new-project env=testing<\/code><\/li>\n<\/ul>\n<\/li>\n<li>Project users can use oc describe quota to view quota that currently apply<\/li>\n<li>Tip! Set quota on individual projects and try to avoid cluster-wide quota, looking them up in large clusters may take a lot of time!<\/li>\n<\/ul>\n<pre class=\"lang:default decode:true\">$ oc login -u developer -p developer\r\nLogin successful.\r\nYou have access to the following projects and can switch between them with 'oc project &lt;projectname&gt;':\r\n\r\n  * limits\r\n\r\nUsing project \"limits\".\r\n\r\n$ oc create clusterquota testing --project-label-selector env=testing --hard pods=5,services=2\r\nError from server (Forbidden): clusterresourcequotas.quota.openshift.io is forbidden: User \"developer\" cannot create clusterresourcequotas.quota.openshift.io at the cluster scope                                                 : no RBAC policy matched\r\n\r\n$ oc login -u system:admin\r\nLogged into \"https:\/\/172.30.9.22:8443\" as \"system:admin\" using existing credentials.\r\n\r\nYou have access to the following projects and can switch between them with 'oc project &lt;projectname&gt;':\r\n  * limits\r\n\r\nUsing project \"limits\".\r\n\r\n$ oc create clusterquota testing --project-label-selector env=testing --hard pods=5,services=2\r\nclusterresourcequota.quota.openshift.io\/testing created\r\n\r\n$ oc get clusterquota\r\nNAME      LABEL SELECTOR   ANNOTATION SELECTOR\r\ntesting   env=testing      map[]\r\n\r\n$ oc get clusterquota -A\r\nError: unknown shorthand flag: 'A' in -A\r\n\r\n$ oc new-project test-project\r\nNow using project \"test-project\" on server \"https:\/\/172.30.9.22:8443\".\r\nYou can add applications to this project with the 'new-app' command. For example, try:\r\n    oc new-app centos\/ruby-25-centos7~https:\/\/github.com\/sclorg\/ruby-ex.git\r\nto build a new example application in Ruby.\r\n\r\n$ oc describe quota\r\n\r\n$ oc label ns test-project env=testing\r\nnamespace\/test-project labeled\r\n\r\n$ oc describe quota\r\n\r\n$ oc describe quota -A\r\nError: unknown shorthand flag: 'A' in -A\r\n\r\n$ oc describe ns test-project\r\nName:         test-project\r\nLabels:       env=testing\r\nAnnotations:  openshift.io\/description=\r\n              openshift.io\/display-name=\r\n              openshift.io\/requester=system:admin\r\n              openshift.io\/sa.scc.mcs=s0:c19,c9\r\n              openshift.io\/sa.scc.supplemental-groups=1000360000\/10000\r\n              openshift.io\/sa.scc.uid-range=1000360000\/10000\r\nStatus:       Active\r\nNo resource quota.\r\nNo resource limits.\r\n\r\n$ oc create deploy nginxmany --image=bitnami\/nginx\r\ndeployment.apps\/nginxmany created\r\n\r\n$ oc get all\r\nNAME                             READY     STATUS    RESTARTS   AGE\r\npod\/nginxmany-5859c9dbb6-6ljwm   1\/1       Running   0          37s\r\n\r\nNAME                        DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE\r\ndeployment.apps\/nginxmany   1         1         1            1           37s\r\n\r\nNAME                                   DESIRED   CURRENT   READY     AGE\r\nreplicaset.apps\/nginxmany-5859c9dbb6   1         1         1         37s\r\n\r\n$ oc scale --replicas 6 deployment.apps\/nginxmany\r\ndeployment.apps\/nginxmany scaled\r\n\r\n$ oc get pods\r\nNAME                         READY     STATUS    RESTARTS   AGE\r\nnginxmany-5859c9dbb6-5xxr6   1\/1       Running   0          15s\r\nnginxmany-5859c9dbb6-6ljwm   1\/1       Running   0          1m\r\nnginxmany-5859c9dbb6-9lv6c   1\/1       Running   0          15s\r\nnginxmany-5859c9dbb6-dgr7k   1\/1       Running   0          15s\r\nnginxmany-5859c9dbb6-hk2sm   1\/1       Running   0          15s\r\n\r\n$ oc describe deploy nginxmany\r\nName:                   nginxmany\r\nNamespace:              test-project\r\nCreationTimestamp:      Sat, 29 Jul 2023 09:58:33 +0200\r\nLabels:                 app=nginxmany\r\nAnnotations:            deployment.kubernetes.io\/revision=1\r\nSelector:               app=nginxmany\r\nReplicas:               6 desired | 5 updated | 5 total | 5 available | 1 unavailable\r\nStrategyType:           RollingUpdate\r\nMinReadySeconds:        0\r\nRollingUpdateStrategy:  25% max unavailable, 25% max surge\r\nPod Template:\r\n  Labels:  app=nginxmany\r\n  Containers:\r\n   nginx:\r\n    Image:        bitnami\/nginx\r\n    Port:         &lt;none&gt;\r\n    Host Port:    &lt;none&gt;\r\n    Environment:  &lt;none&gt;\r\n    Mounts:       &lt;none&gt;\r\n  Volumes:        &lt;none&gt;\r\nConditions:\r\n  Type             Status  Reason\r\n  ----             ------  ------\r\n  Progressing      True    NewReplicaSetAvailable\r\n  ReplicaFailure   True    FailedCreate\r\n  Available        True    MinimumReplicasAvailable\r\nOldReplicaSets:    &lt;none&gt;\r\nNewReplicaSet:     nginxmany-5859c9dbb6 (5\/6 replicas created)\r\nEvents:\r\n  Type    Reason             Age   From                   Message\r\n  ----    ------             ----  ----                   -------\r\n  Normal  ScalingReplicaSet  1m    deployment-controller  Scaled up replica set nginxmany-5859c9dbb6 to 1\r\n  Normal  ScalingReplicaSet  1m    deployment-controller  Scaled up replica set nginxmany-5859c9dbb6 to 6\r\n\r\n\r\n$ oc describe rs nginxmany-5859c9dbb6\r\nName:           nginxmany-5859c9dbb6\r\nNamespace:      test-project\r\nSelector:       app=nginxmany,pod-template-hash=1415758662\r\nLabels:         app=nginxmany\r\n                pod-template-hash=1415758662\r\nAnnotations:    deployment.kubernetes.io\/desired-replicas=6\r\n                deployment.kubernetes.io\/max-replicas=8\r\n                deployment.kubernetes.io\/revision=1\r\nControlled By:  Deployment\/nginxmany\r\nReplicas:       5 current \/ 6 desired\r\nPods Status:    5 Running \/ 0 Waiting \/ 0 Succeeded \/ 0 Failed\r\nPod Template:\r\n  Labels:  app=nginxmany\r\n           pod-template-hash=1415758662\r\n  Containers:\r\n   nginx:\r\n    Image:        bitnami\/nginx\r\n    Port:         &lt;none&gt;\r\n    Host Port:    &lt;none&gt;\r\n    Environment:  &lt;none&gt;\r\n    Mounts:       &lt;none&gt;\r\n  Volumes:        &lt;none&gt;\r\nConditions:\r\n  Type             Status  Reason\r\n  ----             ------  ------\r\n  ReplicaFailure   True    FailedCreate\r\nEvents:\r\n  Type     Reason            Age               From                   Message\r\n  ----     ------            ----              ----                   -------\r\n  Normal   SuccessfulCreate  2m                replicaset-controller  Created pod: nginxmany-5859c9dbb6-6ljwm\r\n  Warning  FailedCreate      1m                replicaset-controller  Error creating: pods \"nginxmany-5859c9dbb6-ksbmv\" is forbidden: exceeded quota: testing, requested: pods=1,                                                  used: pods=5, limited: pods=5\r\n  Normal   SuccessfulCreate  1m                replicaset-controller  Created pod: nginxmany-5859c9dbb6-9lv6c\r\n  Normal   SuccessfulCreate  1m                replicaset-controller  Created pod: nginxmany-5859c9dbb6-dgr7k\r\n  Warning  FailedCreate      1m                replicaset-controller  Error creating: pods \"nginxmany-5859c9dbb6-2njqh\" is forbidden: exceeded quota: testing, requested: pods=1,                                                  used: pods=5, limited: pods=5\r\n  Normal   SuccessfulCreate  1m                replicaset-controller  Created pod: nginxmany-5859c9dbb6-hk2sm\r\n  Warning  FailedCreate      1m                replicaset-controller  Error creating: pods \"nginxmany-5859c9dbb6-hxsp9\" is forbidden: exceeded quota: testing, requested: pods=1,                                                  used: pods=5, limited: pods=5\r\n  Normal   SuccessfulCreate  1m                replicaset-controller  Created pod: nginxmany-5859c9dbb6-5xxr6\r\n  Warning  FailedCreate      1m                replicaset-controller  Error creating: pods \"nginxmany-5859c9dbb6-g8x4g\" is forbidden: exceeded quota: testing, requested: pods=1,                                                  used: pods=5, limited: pods=5\r\n  Warning  FailedCreate      1m                replicaset-controller  Error creating: pods \"nginxmany-5859c9dbb6-49bcp\" is forbidden: exceeded quota: testing, requested: pods=1,                                                  used: pods=5, limited: pods=5\r\n  Warning  FailedCreate      1m                replicaset-controller  Error creating: pods \"nginxmany-5859c9dbb6-v7jgf\" is forbidden: exceeded quota: testing, requested: pods=1,                                                  used: pods=5, limited: pods=5\r\n  Warning  FailedCreate      1m                replicaset-controller  Error creating: pods \"nginxmany-5859c9dbb6-g78kq\" is forbidden: exceeded quota: testing, requested: pods=1,                                                  used: pods=5, limited: pods=5\r\n  Warning  FailedCreate      1m                replicaset-controller  Error creating: pods \"nginxmany-5859c9dbb6-tbnzj\" is forbidden: exceeded quota: testing, requested: pods=1,                                                  used: pods=5, limited: pods=5\r\n  Warning  FailedCreate      1m                replicaset-controller  Error creating: pods \"nginxmany-5859c9dbb6-2stw4\" is forbidden: exceeded quota: testing, requested: pods=1,                                                  used: pods=5, limited: pods=5\r\n  Warning  FailedCreate      1m (x10 over 1m)  replicaset-controller  (combined from similar events): Error creating: pods \"nginxmany-5859c9dbb6-k4qpx\" is forbidden: exceeded quo                                                 ta: testing, requested: pods=1, used: pods=5, limited: pods=5\r\n\r\n\r\n$ oc describe rs nginxmany-5859c9dbb6\r\nName:           nginxmany-5859c9dbb6\r\nNamespace:      test-project\r\nSelector:       app=nginxmany,pod-template-hash=1415758662\r\nLabels:         app=nginxmany\r\n                pod-template-hash=1415758662\r\nAnnotations:    deployment.kubernetes.io\/desired-replicas=6\r\n                deployment.kubernetes.io\/max-replicas=8\r\n                deployment.kubernetes.io\/revision=1\r\nControlled By:  Deployment\/nginxmany\r\nReplicas:       5 current \/ 6 desired\r\nPods Status:    5 Running \/ 0 Waiting \/ 0 Succeeded \/ 0 Failed\r\nPod Template:\r\n  Labels:  app=nginxmany\r\n           pod-template-hash=1415758662\r\n  Containers:\r\n   nginx:\r\n    Image:        bitnami\/nginx\r\n    Port:         &lt;none&gt;\r\n    Host Port:    &lt;none&gt;\r\n    Environment:  &lt;none&gt;\r\n    Mounts:       &lt;none&gt;\r\n  Volumes:        &lt;none&gt;\r\nConditions:\r\n  Type             Status  Reason\r\n  ----             ------  ------\r\n  ReplicaFailure   True    FailedCreate\r\nEvents:\r\n  Type     Reason            Age               From                   Message\r\n  ----     ------            ----              ----                   -------\r\n  Normal   SuccessfulCreate  2m                replicaset-controller  Created pod: nginxmany-5859c9dbb6-6ljwm\r\n  Warning  FailedCreate      2m                replicaset-controller  Error creating: pods \"nginxmany-5859c9dbb6-ksbmv\" is forbidden: exceeded quota: testing, requested: pods=1, used: pods=5, limited: pods=5\r\n  Normal   SuccessfulCreate  2m                replicaset-controller  Created pod: nginxmany-5859c9dbb6-9lv6c\r\n  Normal   SuccessfulCreate  2m                replicaset-controller  Created pod: nginxmany-5859c9dbb6-dgr7k\r\n  Warning  FailedCreate      2m                replicaset-controller  Error creating: pods \"nginxmany-5859c9dbb6-2njqh\" is forbidden: exceeded quota: testing, requested: pods=1, used: pods=5, limited: pods=5\r\n  Normal   SuccessfulCreate  2m                replicaset-controller  Created pod: nginxmany-5859c9dbb6-hk2sm\r\n  Warning  FailedCreate      2m                replicaset-controller  Error creating: pods \"nginxmany-5859c9dbb6-hxsp9\" is forbidden: exceeded quota: testing, requested: pods=1, used: pods=5, limited: pods=5\r\n  Normal   SuccessfulCreate  2m                replicaset-controller  Created pod: nginxmany-5859c9dbb6-5xxr6\r\n  Warning  FailedCreate      2m                replicaset-controller  Error creating: pods \"nginxmany-5859c9dbb6-g8x4g\" is forbidden: exceeded quota: testing, requested: pods=1, used: pods=5, limited: pods=5\r\n  Warning  FailedCreate      2m                replicaset-controller  Error creating: pods \"nginxmany-5859c9dbb6-49bcp\" is forbidden: exceeded quota: testing, requested: pods=1, used: pods=5, limited: pods=5\r\n  Warning  FailedCreate      2m                replicaset-controller  Error creating: pods \"nginxmany-5859c9dbb6-v7jgf\" is forbidden: exceeded quota: testing, requested: pods=1, used: pods=5, limited: pods=5\r\n  Warning  FailedCreate      2m                replicaset-controller  Error creating: pods \"nginxmany-5859c9dbb6-g78kq\" is forbidden: exceeded quota: testing, requested: pods=1, used: pods=5, limited: pods=5\r\n  Warning  FailedCreate      2m                replicaset-controller  Error creating: pods \"nginxmany-5859c9dbb6-tbnzj\" is forbidden: exceeded quota: testing, requested: pods=1, used: pods=5, limited: pods=5\r\n  Warning  FailedCreate      2m                replicaset-controller  Error creating: pods \"nginxmany-5859c9dbb6-2stw4\" is forbidden: exceeded quota: testing, requested: pods=1, used: pods=5, limited: pods=5\r\n  Warning  FailedCreate      1m (x10 over 2m)  replicaset-controller  (combined from similar events): Error creating: pods \"nginxmany-5859c9dbb6-k4qpx\" is forbidden: exceeded quota: testing, requested: pods=1, used: pods=5, limited: pods=5\r\n\r\n<\/pre>\n<p>As we see only 5 replicas has been created because of quota limit.<\/p>\n<pre class=\"lang:default decode:true \">$ oc delete clusterquota testing\r\nclusterresourcequota.quota.openshift.io \"testing\" deleted\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #3366ff;\">Templates<\/span><\/p>\n<ul>\n<li>A Template is an API resource that can set different properties when<br \/>\ncreating a new project<\/p>\n<ul>\n<li>quota<\/li>\n<li>limit ranges<\/li>\n<li>network policies<\/li>\n<\/ul>\n<\/li>\n<li>Use <code>oc adm create-bootstrap-project-template -o yaml &gt; mytemplate.yaml<\/code> to generate a YAML file that can be further modified<\/li>\n<li>Add new resources under objects, specifying the kind of resource you want to add<\/li>\n<li>Next, edit<code> projects.config.openshift.io\/cluster<\/code> to use the new template<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #3366ff;\">Setting Project Restrictions<\/span><\/p>\n<ul>\n<li><code>oc login -u admin -p password <\/code><\/li>\n<li><code>oc adm create-bootstrap-project-template -o yaml &gt; mytemplate.yaml<\/code> #ignoring that here as its a lot of work to create<\/li>\n<li><code>oc create -f limitrange.yaml -n openshift-config <\/code><\/li>\n<li><code>oc describe limitrange test-limits<\/code><\/li>\n<li><code>oc edit projects.config.openshift.io\/cluster <\/code><\/li>\n<\/ul>\n<p style=\"padding-left: 40px;\"><code>spec: <\/code><\/p>\n<p style=\"padding-left: 40px;\"><code>\u00a0 projectRequestTemplate: <\/code><\/p>\n<p style=\"padding-left: 40px;\"><code>\u00a0\u00a0\u00a0\u00a0 name: project-request <\/code><\/p>\n<ul>\n<li><code>watch oc get pods -n openshift-apiserver<\/code> # wait 2 minutes<\/li>\n<li><code>oc new-project test-project <\/code><\/li>\n<li><code>oc get resourcequotas,limitranges<\/code><\/li>\n<li><code> oc delete project test-project <\/code><\/li>\n<li><code>oc edit project.config.openshiftio\/cluster<\/code> # remove spec<\/li>\n<\/ul>\n<pre class=\"lang:default decode:true\">$ oc login -u system:admin\r\nLogged into \"https:\/\/172.30.9.22:8443\" as \"system:admin\" using existing credentials.\r\n\r\nYou have access to the following projects and can switch between them with 'oc project &lt;projectname&gt;':\r\n\r\n  * test-project\r\n\r\nUsing project \"test-project\".\r\n\r\n$ oc adm create-bootstrap-project-template -o yaml &gt; mytemplate.yaml\r\n$ cat mytemplate.yaml\r\napiVersion: template.openshift.io\/v1\r\nkind: Template\r\nmetadata:\r\n  creationTimestamp: null\r\n  name: project-request\r\nobjects:\r\n- apiVersion: project.openshift.io\/v1\r\n  kind: Project\r\n  metadata:\r\n    annotations:\r\n      openshift.io\/description: ${PROJECT_DESCRIPTION}\r\n      openshift.io\/display-name: ${PROJECT_DISPLAYNAME}\r\n      openshift.io\/requester: ${PROJECT_REQUESTING_USER}\r\n    creationTimestamp: null\r\n    name: ${PROJECT_NAME}\r\n  spec: {}\r\n  status: {}\r\n- apiVersion: rbac.authorization.k8s.io\/v1\r\n  kind: RoleBinding\r\n  metadata:\r\n    annotations:\r\n      openshift.io\/description: Allows all pods in this namespace to pull images from\r\n        this namespace.  It is auto-managed by a controller; remove subjects to disable.\r\n    creationTimestamp: null\r\n    name: system:image-pullers\r\n    namespace: ${PROJECT_NAME}\r\n  roleRef:\r\n    apiGroup: rbac.authorization.k8s.io\r\n    kind: ClusterRole\r\n    name: system:image-puller\r\n  subjects:\r\n  - apiGroup: rbac.authorization.k8s.io\r\n    kind: Group\r\n    name: system:serviceaccounts:${PROJECT_NAME}\r\n- apiVersion: rbac.authorization.k8s.io\/v1\r\n  kind: RoleBinding\r\n  metadata:\r\n    annotations:\r\n      openshift.io\/description: Allows builds in this namespace to push images to\r\n        this namespace.  It is auto-managed by a controller; remove subjects to disable.\r\n    creationTimestamp: null\r\n    name: system:image-builders\r\n    namespace: ${PROJECT_NAME}\r\n  roleRef:\r\n    apiGroup: rbac.authorization.k8s.io\r\n    kind: ClusterRole\r\n    name: system:image-builder\r\n  subjects:\r\n  - kind: ServiceAccount\r\n    name: builder\r\n    namespace: ${PROJECT_NAME}\r\n- apiVersion: rbac.authorization.k8s.io\/v1\r\n  kind: RoleBinding\r\n  metadata:\r\n    annotations:\r\n      openshift.io\/description: Allows deploymentconfigs in this namespace to rollout\r\n        pods in this namespace.  It is auto-managed by a controller; remove subjects\r\n        to disable.\r\n    creationTimestamp: null\r\n    name: system:deployers\r\n    namespace: ${PROJECT_NAME}\r\n  roleRef:\r\n    apiGroup: rbac.authorization.k8s.io\r\n    kind: ClusterRole\r\n    name: system:deployer\r\n  subjects:\r\n  - kind: ServiceAccount\r\n    name: deployer\r\n    namespace: ${PROJECT_NAME}\r\n- apiVersion: rbac.authorization.k8s.io\/v1\r\n  kind: RoleBinding\r\n  metadata:\r\n    creationTimestamp: null\r\n    name: admin\r\n    namespace: ${PROJECT_NAME}\r\n  roleRef:\r\n    apiGroup: rbac.authorization.k8s.io\r\n    kind: ClusterRole\r\n    name: admin\r\n  subjects:\r\n  - apiGroup: rbac.authorization.k8s.io\r\n    kind: User\r\n    name: ${PROJECT_ADMIN_USER}\r\nparameters:\r\n- name: PROJECT_NAME\r\n- name: PROJECT_DISPLAYNAME\r\n- name: PROJECT_DESCRIPTION\r\n- name: PROJECT_ADMIN_USER\r\n- name: PROJECT_REQUESTING_USER\r\n\r\n\r\n$ cat limitrange.yaml\r\napiVersion: template.openshift.io\/v1\r\nkind: Template\r\nmetadata:\r\n  creationTimestamp: null\r\n  name: project-request\r\nobjects:\r\n- apiVersion: project.openshift.io\/v1\r\n  kind: Project\r\n  metadata:\r\n    annotations:\r\n      openshift.io\/description: ${PROJECT_DESCRIPTION}\r\n      openshift.io\/display-name: ${PROJECT_DISPLAYNAME}\r\n      openshift.io\/requester: ${PROJECT_REQUESTING_USER}\r\n    creationTimestamp: null\r\n    name: ${PROJECT_NAME}\r\n  spec: {}\r\n  status: {}\r\n- apiVersion: rbac.authorization.k8s.io\/v1\r\n  kind: RoleBinding\r\n  metadata:\r\n    creationTimestamp: null\r\n    name: admin\r\n    namespace: ${PROJECT_NAME}\r\n  roleRef:\r\n    apiGroup: rbac.authorization.k8s.io\r\n    kind: ClusterRole\r\n    name: admin\r\n  subjects:\r\n  - apiGroup: rbac.authorization.k8s.io\r\n    kind: User\r\n    name: ${PROJECT_ADMIN_USER}\r\n- apiVersion: v1\r\n  kind: ResourceQuota\r\n  metadata:\r\n    name: ${PROJECT_NAME}-quota\r\n  spec:\r\n    hard:\r\n      cpu: 3\r\n      memory: 10G\r\n- apiVersion: v1\r\n  kind: LimitRange\r\n  metadata:\r\n    name: ${PROJECT_NAME}-limits\r\n  spec:\r\n    limits:\r\n      - type: Container\r\n        defaultRequest:\r\n          cpu: 30m\r\n          memory: 30M\r\nparameters:\r\n- name: PROJECT_NAME\r\n- name: PROJECT_DISPLAYNAME\r\n- name: PROJECT_DESCRIPTION\r\n- name: PROJECT_ADMIN_USER\r\n- name: PROJECT_REQUESTING_USER\r\n\r\n$ oc create -f limitrange.yaml -n openshift-config\r\nError from server (NotFound): error when creating \"limitrange.yaml\": namespaces \"openshift-config\" not found\r\n\r\n$ oc new-project openshift-config\r\nError from server (Forbidden): project.project.openshift.io \"openshift-config\" is forbidden: cannot request a project starting with \"openshift-\"\r\n\r\n$ oc create -f limitrange.yaml\r\ntemplate.template.openshift.io\/project-request created\r\n\r\n$ oc get template\r\nNAME              DESCRIPTION   PARAMETERS    OBJECTS\r\nproject-request                 5 (5 blank)   4\r\n\r\n$ oc get template -n openshift-config\r\nNo resources found.\r\n\r\n$ oc describe limitrange test-limits\r\nError from server (NotFound): limitranges \"test-limits\" not found\r\n\r\n$ oc edit projects.config.openshift.io\/cluster\r\nerror: the server doesn't have a resource type \"projects\"\r\n\r\n$ watch oc get pods -n openshift-apiserver\r\n\r\n$ oc new-project test-project\r\nError from server (AlreadyExists): project.project.openshift.io \"test-project\" already exists\r\n\r\n\r\n$ oc new-project template-project\r\nNow using project \"template-project\" on server \"https:\/\/172.30.9.22:8443\".\r\n\r\nYou can add applications to this project with the 'new-app' command. For example, try:\r\n\r\n    oc new-app centos\/ruby-25-centos7~https:\/\/github.com\/sclorg\/ruby-ex.git\r\n\r\nto build a new example application in Ruby.\r\n\r\n$ oc get resourcequotas,limitranges\r\nNo resources found.\r\n\r\n$ oc get resourcequotas\r\nNo resources found.\r\n\r\n$ oc get limitranges\r\nNo resources found.\r\n\r\n$ oc edit project.config.openshift.io\/cluster\r\nerror: the server doesn't have a resource type \"project\"\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #3366ff;\">Lab: Using Quota<\/span><\/p>\n<ul>\n<li>Create a new project with the name limit-project. Set quota on this project, that meet the following requirements:\n<ul>\n<li>Pods can use a max of 1Gi of memory<\/li>\n<li>A maximum of 4 Pods can be created<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<pre class=\"lang:default decode:true \">$ oc login -u system:admin\r\nLogged into \"https:\/\/172.30.9.22:8443\" as \"system:admin\" using existing credentials.\r\nYou have access to the following projects and can switch between them with 'oc project &lt;projectname&gt;':\r\n  * love\r\nUsing project \"love\".\r\n\r\n$ oc new-project limit-project\r\nNow using project \"limit-project\" on server \"https:\/\/172.30.9.22:8443\".\r\n\r\nYou can add applications to this project with the 'new-app' command. For example, try:\r\n\r\n    oc new-app centos\/ruby-25-centos7~https:\/\/github.com\/sclorg\/ruby-ex.git\r\n\r\nto build a new example application in Ruby.\r\n\r\n$ oc create quota qtest --hard pods=4,memory=1Gi\r\nresourcequota\/qtest created\r\n\r\n$ oc describe project limit-project\r\nName:           limit-project\r\nCreated:        41 seconds ago\r\nLabels:         &lt;none&gt;\r\nAnnotations:    openshift.io\/description=\r\n                openshift.io\/display-name=\r\n                openshift.io\/requester=system:admin\r\n                openshift.io\/sa.scc.mcs=s0:c21,c5\r\n                openshift.io\/sa.scc.supplemental-groups=1000430000\/10000\r\n                openshift.io\/sa.scc.uid-range=1000430000\/10000\r\nDisplay Name:   &lt;none&gt;\r\nDescription:    &lt;none&gt;\r\nStatus:         Active\r\nNode Selector:  &lt;none&gt;\r\nQuota:\r\n                        Name:           qtest\r\n                        Resource        Used    Hard\r\n                        --------        ----    ----\r\n                        memory          0       1Gi\r\n                        pods            0       4\r\nResource limits:        &lt;none&gt;\r\n\r\n$ oc get quota\r\nNAME      CREATED AT\r\nqtest     2023-07-29T11:34:08Z\r\n<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[93],"tags":[],"_links":{"self":[{"href":"http:\/\/miro.borodziuk.eu\/index.php\/wp-json\/wp\/v2\/posts\/4969"}],"collection":[{"href":"http:\/\/miro.borodziuk.eu\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/miro.borodziuk.eu\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/miro.borodziuk.eu\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/miro.borodziuk.eu\/index.php\/wp-json\/wp\/v2\/comments?post=4969"}],"version-history":[{"count":49,"href":"http:\/\/miro.borodziuk.eu\/index.php\/wp-json\/wp\/v2\/posts\/4969\/revisions"}],"predecessor-version":[{"id":5114,"href":"http:\/\/miro.borodziuk.eu\/index.php\/wp-json\/wp\/v2\/posts\/4969\/revisions\/5114"}],"wp:attachment":[{"href":"http:\/\/miro.borodziuk.eu\/index.php\/wp-json\/wp\/v2\/media?parent=4969"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/miro.borodziuk.eu\/index.php\/wp-json\/wp\/v2\/categories?post=4969"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/miro.borodziuk.eu\/index.php\/wp-json\/wp\/v2\/tags?post=4969"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}