Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCPBUGS-42177: Fix resource quota #12399

Merged
merged 1 commit into from
Sep 19, 2024

Conversation

Vincent056
Copy link
Contributor

@Vincent056 Vincent056 commented Sep 19, 2024

This PR fixes resource quota rule, resource_requests_quota did not include the updated jq filter from #12344

This PR fixes resource quota rule, resource_requests_quota did not include the updated jq filter from PR#12344
Copy link

Start a new ephemeral environment with changes proposed in this pull request:

Fedora Environment
Open in Gitpod

Oracle Linux 8 Environment
Open in Gitpod

Copy link

🤖 A k8s content image for this PR is available at:
ghcr.io/complianceascode/k8scontent:12399
This image was built from commit: 7a57333

Click here to see how to deploy it

If you alread have Compliance Operator deployed:
utils/build_ds_container.py -i ghcr.io/complianceascode/k8scontent:12399

Otherwise deploy the content and operator together by checking out ComplianceAsCode/compliance-operator and:
CONTENT_IMAGE=ghcr.io/complianceascode/k8scontent:12399 make deploy-local

Copy link

codeclimate bot commented Sep 19, 2024

Code Climate has analyzed commit 7a57333 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 59.5% (0.0% change).

View more on Code Climate.

@xiaojiey
Copy link
Collaborator

Pre-merge verification pass with ghcr.io/complianceascode/k8scontent:12399:

% oc get resourcequota --all-namespaces
NAMESPACE                NAME                            AGE    REQUEST                                                              LIMIT
foo                      test-quota                      109m   count/daemonsets.apps: 0/0, count/deployments.apps: 0/0, pods: 0/0   limits.cpu: 0/0, limits.memory: 0/0
openshift-host-network   host-network-namespace-quotas   149m   count/daemonsets.apps: 0/0, count/deployments.apps: 0/0, pods: 0/0   limits.cpu: 0/0, limits.memory: 0/0
test-no-rate-limit       example-1                       116m   pods: 0/4, requests.cpu: 0/1, requests.memory: 0/1Gi                 limits.cpu: 0/2, limits.memory: 0/2Gi

% oc get ccr | grep resource-requests-quota
ocp4-moderate-resource-requests-quota                                            FAIL     medium
upstream-ocp4-moderate-resource-requests-quota                                   PASS     medium

% oc get ccr upstream-ocp4-moderate-resource-requests-quota -o=jsonpath={.instructions}
Run the following command to retrieve the ClusterResourceQuota objects in the system:
$ oc get clusterquota --all-namespaces
Make sure there exists at least one ClusterResourceQuota object in the cluster.
 
Or
 
Verify that the every non-control plane namespace has an appropriate ResourceQuota.
 
To get all the non-control plane namespaces, you can do the
following command $ oc get  namespaces -o json | jq '[.items[] | select((.metadata.name | startswith("openshift") | not) and (.metadata.name | startswith("kube-") | not) and .metadata.name != "default" and .metadata.name != "rhacs-operator" and (true)) | .metadata.name]'
 
To get all the non-control plane namespaces with a ResourceQuota, you can do the
following command $ oc get --all-namespaces resourcequota -o json | jq '[.items[] | select((.metadata.namespace | startswith("openshift") | not) and (.metadata.namespace | startswith("kube-") | not) and .metadata.namespace != "default" and .metadata.namespace != "rhacs-operator" and (true)) | .metadata.namespace] | unique'
 
Make sure that the namespaces displayed in the commands of the commands match.
Is it the case that Resource requests and limits is not set?%                                                                           

 % oc get  namespaces -o json | jq '[.items[] | select((.metadata.name | startswith("openshift") | not) and (.metadata.name | startswith("kube-") | not) and .metadata.name != "default" and .metadata.name != "rhacs-operator" and (true)) | .metadata.name]'
[
  "foo",
  "test-no-rate-limit"
]
% oc get --all-namespaces resourcequota -o json | jq '[.items[] | select((.metadata.namespace | startswith("openshift") | not) and (.metadata.namespace | startswith("kube-") | not) and .metadata.namespace != "default" and .metadata.namespace != "rhacs-operator" and (true)) | .metadata.namespace] | unique'
[
  "foo",
  "test-no-rate-limit"
]

@xiaojiey
Copy link
Collaborator

lgtm

@Vincent056 Vincent056 changed the title OCP4: Fix resource quota OCPBUGS-42177: Fix resource quota Sep 19, 2024
@Vincent056
Copy link
Contributor Author

/test 4.15-e2e-aws-ocp4-stig
/test 4.16-e2e-aws-ocp4-stig
/test 4.17-e2e-aws-ocp4-stig

Copy link

openshift-ci bot commented Sep 19, 2024

@Vincent056: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/4.17-e2e-aws-ocp4-stig 7a57333 link true /test 4.17-e2e-aws-ocp4-stig

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@yuumasato yuumasato self-assigned this Sep 19, 2024
@yuumasato yuumasato added this to the 0.1.75 milestone Sep 19, 2024
Copy link
Member

@yuumasato yuumasato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @Vincent056

@yuumasato yuumasato added the OpenShift OpenShift product related. label Sep 19, 2024
@yuumasato yuumasato merged commit c96fc14 into ComplianceAsCode:master Sep 19, 2024
101 of 103 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OpenShift OpenShift product related.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants