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

Add support for NetworkACLs for LB on VPC networks #69

Merged
merged 16 commits into from
Jul 31, 2024
Merged

Conversation

Pearl1594
Copy link
Contributor

@Pearl1594 Pearl1594 commented Jul 2, 2024

This adds support to create and delete Network ACLs as done for Isolated networks (where Firewall rules are added)

On cluster creation:

image

On deploying nginx

kubectl apply -f <nginx.yaml>
image

On deleting nginx

kubectl delete -f <nginx.yaml>
image

@Pearl1594
Copy link
Contributor Author

need to upload the image to apache docker repo - before it's merged

@Pearl1594 Pearl1594 marked this pull request as ready for review July 22, 2024 12:57
cloudstack_loadbalancer.go Outdated Show resolved Hide resolved
// create ACL rule
acl := lb.NetworkACL.NewCreateNetworkACLParams(protocol.CSProtocol())
acl.SetAclid(network.Aclid)
acl.SetAction("Allow")
Copy link

@nvazquez nvazquez Jul 22, 2024

Choose a reason for hiding this comment

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

Can you make these values parametrized? (action, cidr, trafficType) - it looks like you currently want them for adding the default ACL allow but it can be reused later if parameters are used

Copy link
Contributor Author

@Pearl1594 Pearl1594 Jul 22, 2024

Choose a reason for hiding this comment

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

ideally should not be required. Because, these rules correspond to the LB service created on Kubernetes side. So these would ideally be fixed to action: "allow" and traffictype: "Ingress"

Choose a reason for hiding this comment

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

Ok, thanks

cloudstack_loadbalancer.go Show resolved Hide resolved
cloudstack_loadbalancer.go Outdated Show resolved Hide resolved
Copy link
Member

@weizhouapache weizhouapache left a comment

Choose a reason for hiding this comment

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

code lgtm

Copy link

@nvazquez nvazquez left a comment

Choose a reason for hiding this comment

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

Code LGTM, thanks @Pearl1594

// create ACL rule
acl := lb.NetworkACL.NewCreateNetworkACLParams(protocol.CSProtocol())
acl.SetAclid(network.Aclid)
acl.SetAction("Allow")

Choose a reason for hiding this comment

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

Ok, thanks

Copy link

@kiranchavala kiranchavala left a comment

Choose a reason for hiding this comment

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

@Pearl1594

This is not working on a vmware environment

It works fine on a Cloudstack +kvm environment

Let me know If i should create a separate issue(Cloudstack+vmware) to track it

@Pearl1594
Copy link
Contributor Author

@kiranchavala I don't think the issue is wrt to this PR, but in general there's an issue with vmware.

Copy link

@kiranchavala kiranchavala left a comment

Choose a reason for hiding this comment

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

LGTM, Tested the cks deployment on a vpc network custom acl.

The rules were successfully added/removed for kubernetes deployments

@nvazquez
Copy link

LGTM - thanks @Pearl1594

@nvazquez nvazquez merged commit a315d9e into main Jul 31, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants