Skip to content

Support configuration of security list management modes as LB service annotation #225

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

Merged
merged 13 commits into from
Aug 2, 2018

Conversation

bdourallawzi
Copy link
Contributor

For customers running in a management environment, they will not be able to modify the configuration of the CCM.This allows for dynamic configuration of security list management mode (All, Frontend, None) by adding an annotation when creating a LB service.
This covers the following enhancement #217 as well as covering the seg fault issue #221

Copy link
Contributor

@prydie prydie left a comment

Choose a reason for hiding this comment

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

A few minor tweaks and we'll need to get the CI pipeline green but awesome work 👍

@@ -130,24 +129,22 @@ func (cp *CloudProvider) Initialize(clientBuilder controller.ControllerClientBui

nodeInformer := factory.Core().V1().Nodes()
go nodeInformer.Informer().Run(wait.NeverStop)
serviceInformer := factory.Core().V1().Services()
go serviceInformer.Informer().Run(wait.NeverStop)
Copy link
Contributor

Choose a reason for hiding this comment

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

Might want to stick a \n under here to separate out the setup vs the cache sync

// have SSL enabled.
// See: https://kubernetes.io/docs/concepts/services-networking/ingress/#tls
ServiceAnnotationLoadBalancerTLSSecret = "service.beta.kubernetes.io/oci-load-balancer-tls-secret"

// ServiceAnnotationLoadBalancerConnectionIdleTimeout is the annotation used
// on the service to specify the idle connection timeout.
ServiceAnnotationLoadBalancerConnectionIdleTimeout = "service.beta.kubernetes.io/oci-load-balancer-connection-idle-timeout"

//ServiceAnnotaionLoadBalancerSecurityListManagementMode is a Service annotation for
Copy link
Contributor

Choose a reason for hiding this comment

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

Space after //

// have SSL enabled.
// See: https://kubernetes.io/docs/concepts/services-networking/ingress/#tls
ServiceAnnotationLoadBalancerTLSSecret = "service.beta.kubernetes.io/oci-load-balancer-tls-secret"

// ServiceAnnotationLoadBalancerConnectionIdleTimeout is the annotation used
// on the service to specify the idle connection timeout.
ServiceAnnotationLoadBalancerConnectionIdleTimeout = "service.beta.kubernetes.io/oci-load-balancer-connection-idle-timeout"

//ServiceAnnotaionLoadBalancerSecurityListManagementMode is a Service annotation for
//specifying the security list managment mode ("All","Frontend","None") that configures how security lists are managed by the CCM
Copy link
Contributor

Choose a reason for hiding this comment

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

Space after // and ("All", "Frontend", "None")

Ports map[string]portSpec
SourceCIDRs []string
SSLConfig *SSLConfig
SecurityListManager securityListManager
Copy link
Contributor

Choose a reason for hiding this comment

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

I wouldn't export this field so securityListManager

@@ -134,6 +135,10 @@ func NewLBSpec(svc *v1.Service, nodes []*v1.Node, defaultSubnets []string, sslCf
return nil, err
}

//A security list manager will be configured based on the annotation specified when creating the service,
Copy link
Contributor

Choose a reason for hiding this comment

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

Space after //

@@ -134,6 +135,10 @@ func NewLBSpec(svc *v1.Service, nodes []*v1.Node, defaultSubnets []string, sslCf
return nil, err
}

//A security list manager will be configured based on the annotation specified when creating the service,
//if an annotation is not specified, then the mode specified in cloud provider config file is used.
Copy link
Contributor

Choose a reason for hiding this comment

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

Space after //

nodes: nodes,
service: svc,
nodes: nodes,
SecurityListManager: slManagerSpec,
Copy link
Contributor

Choose a reason for hiding this comment

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

SecurityListManager: secListFactory(
	svc.Annotations[ServiceAnnotaionLoadBalancerSecurityListManagementMode],
)

@@ -312,7 +318,11 @@ func TestNewLBSpecSuccess(t *testing.T) {
// we expect the service to be unchanged
tc.expected.service = tc.service
subnets := []string{tc.defaultSubnetOne, tc.defaultSubnetTwo}
result, err := NewLBSpec(tc.service, tc.nodes, subnets, nil)
//reference default cp added
Copy link
Contributor

Choose a reason for hiding this comment

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

Space after //

@@ -330,7 +340,8 @@ func TestNewLBSpecFailure(t *testing.T) {
defaultSubnetTwo string
nodes []*v1.Node
service *v1.Service
expectedErrMsg string
//add cp or cp security list
Copy link
Contributor

Choose a reason for hiding this comment

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

Space after //

@@ -415,6 +426,7 @@ func TestNewLBSpecFailure(t *testing.T) {
Spec: v1.ServiceSpec{
SessionAffinity: v1.ServiceAffinityNone,
Ports: []v1.ServicePort{},
//add security list mananger in spec
Copy link
Contributor

Choose a reason for hiding this comment

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

Space after //

@jhorwit2
Copy link
Member

jhorwit2 commented Aug 2, 2018

The seg fault issue is already fixed in master.

@prydie
Copy link
Contributor

prydie commented Aug 2, 2018

Awesome work @bdourallawzi 👍

@prydie prydie merged commit d3d2191 into master Aug 2, 2018
@prydie prydie deleted the bl/support-configuration-security-list-modes branch August 2, 2018 14:38
@prydie prydie added this to the 0.6.0 milestone Aug 14, 2018
ayushverma14 pushed a commit to ayushverma14/oci-cloud-controller-manager that referenced this pull request Jul 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants