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

NetPolicyTimeoutsHostNetworkedPodTraffic: Exclude cloud platforms from exposure #4762

Conversation

petr-muller
Copy link
Member

  • NetPolicyTimeoutsHostNetworkedPodTraffic: Add _id=="" placeholders
  • NetPolicyTimeoutsHostNetworkedPodTraffic: Limit exposure to baremetal-ish platforms

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 9, 2024
group(max_over_time(apiserver_storage_objects{resource="networkpolicies.networking.k8s.io"}[1h]) > 0)
or
0 * group(max_over_time(apiserver_storage_objects[1h]))
- type: PromQL
Copy link
Member Author

Choose a reason for hiding this comment

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

Apologize for the whitespace - it is coming from an automation which I'm not able to force to zero-indent :P

Copy link
Contributor

openshift-ci bot commented Feb 9, 2024

@petr-muller: all tests passed!

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/test-infra repository. I understand the commands that are listed here.

@petr-muller
Copy link
Member Author

Tested on b03 cluster which does have networkpolicies:

$ b03 get networkpolicy --all-namespaces
NAMESPACE                                  NAME                                POD-SELECTOR                                                                              AGE
openshift-deployment-validation-operator   allow-from-openshift-insights       <none>                                                                                    465d
openshift-deployment-validation-operator   allow-from-openshift-olm            <none>                                                                                    465d
openshift-monitoring                       token-refresher                     app.kubernetes.io/component=authentication-proxy,app.kubernetes.io/name=token-refresher   717d
openshift-ocm-agent-operator               ocm-agent-allow-muo-communication   app=ocm-agent                                                                             25d
openshift-ocm-agent-operator               ocm-agent-allow-only-alertmanager   app=ocm-agent                                                                             323d

B03 is an AWS cluster so we do not want it to be exposed:

image

I do not have a non-cloud cluster at hand, so I will simulate by simply rewriting one of the |-ed items in the list of platforms to AWS to test the "platform matches and there are network policies" semantics:

image

Finally, test the same thing on b01 cluster that does not have any network policies, expect it to not match (even with modified list of platforms to include AWS):

$ b01 get networkpolicy --all-namespaces
No resources found

image

Test looks good to me.

Copy link
Member

@wking wking left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 9, 2024
Copy link
Contributor

openshift-ci bot commented Feb 9, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: petr-muller, wking

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit 304e2ff into openshift:master Feb 9, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
3 participants