-
Notifications
You must be signed in to change notification settings - Fork 261
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
[WIP] ✨Disable/enable PortSecurity at port level #914
Conversation
Hi @Xenwar. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
/assign @sbueringer |
@@ -1264,6 +1264,11 @@ spec: | |||
type: array | |||
description: | |||
type: string | |||
disablePortSecurity: | |||
description: DisablePortSecurity disables the port security |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where this description come from? Description should be auto generated from a comment in api/v1alpha4/types.go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. I did not re-generate the yaml files after removing the comment.
Will add the comment back.
@@ -505,6 +515,28 @@ func (s *Service) getOrCreatePort(eventObject runtime.Object, clusterName string | |||
} | |||
|
|||
record.Eventf(eventObject, "SuccessfulCreatePort", "Created port %s with id %s", port.Name, port.ID) | |||
if portOpts.DisablePortSecurity == true || networkDisabledPortSecurity == true { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we create port with/without port security not updating after creating port?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, we cannot.
At the port level, PortSecurity is immutable.
For the network level, there is a bug reporter (#913)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is possible from gophercloud docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. The link you provided is more efficient as it does not need retrieving the port to update it, I will update my PR accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot
b6347f9
to
84a4551
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Xenwar The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@hidekazuna
|
@Xenwar Thanks investigating. I have no idea to combine them as of now. |
@hidekazuna Thanks. |
84a4551
to
6bfa2fa
Compare
/ok-to-test |
I just made a similar PR not realizing this was already out there. Lets combine efforts and share homework: #921 Rather than inheriting the port security settings from the cluster spec, I think its better to just inherit them from the network (which openstack does automatically on create) since these ports can be created on any network in theory. This is why I chose to make it *bool. |
Another thing to watch out for is that because we typically set the security groups at the instance level, OpenStack will apply that security group to all port interfaces of that instance. This will cause ugly bugs when setting the port security on those ports. |
Thanks, we can combine efforts. Also, Network level setting is relevant when PortSecurity is disabled at the network level so the setting is disabled for each port. i.e. Ports do not inherit the setting from the network in all cases. |
We have a use case to enable/disable PortSecurity at the port(s) level. I am not quite sure yet at what point the bug you mentioned could show up, during Port creation or during an update as we have the option of specifying security groups at the port level. We could probably open a discussion on slack on the this and the other comment. |
/assign @iamemilio |
6bfa2fa
to
4db197b
Compare
/hold alternatives ways under discussion, #921 |
/unhold |
ac16771
to
4816166
Compare
@Xenwar hold/unfold does not mean ready for review. If PR is not ready for review, rename title starting with WIP, please. |
/test pull-cluster-api-provider-openstack-e2e-test |
6f72039
to
be7d601
Compare
@@ -327,6 +327,13 @@ A floating IP is created and associated to the bastion host automatically, but y | |||
|
|||
If `managedSecurityGroups: true`, security group rule opening 22/tcp is added to security groups for bastion, controller, and worker nodes respectively. Otherwise, you have to add `securityGroups` to the `bastion` in `OpenStackCluster` spec and `OpenStackMachineTemplate` spec template respectively. | |||
|
|||
If PortSecurity disable for all ports either by setting `OpenStackCluster.spec.disablePortSecurity: true` or for each port individually, `managedSecurityGroups: false` is the only valid option. The following is not a valid coonfiguration and is not supported. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is in "Accessing nodes through the bastion host via SSH" section, not security group section. How about moving to Ports?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, moved
be7d601
to
7d71d42
Compare
/test pull-cluster-api-provider-openstack-e2e-test |
7d71d42
to
b5fe28a
Compare
11b6d31
to
4e9edf6
Compare
d8e2ee7
to
248dcaa
Compare
/test pull-cluster-api-provider-openstack-e2e-test |
Signed-off-by: Anwar Hassen <[email protected]>
248dcaa
to
3537479
Compare
/test pull-cluster-api-provider-openstack-e2e-test |
@Xenwar: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. |
This PR is no longer needed. |
@Xenwar: PR needs rebase. 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. |
This PR adds the capability of enabling/disabling PortSecurity at the port level.
Example Manifest
Example output:
`
`
Fixes #911
Signed-off-by: Anwar Hassen [email protected]