-
Notifications
You must be signed in to change notification settings - Fork 93
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
Conversation
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.
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) |
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.
Might want to stick a \n
under here to separate out the setup vs the cache sync
pkg/oci/load_balancer.go
Outdated
// 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 |
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.
Space after //
pkg/oci/load_balancer.go
Outdated
// 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 |
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.
Space after //
and ("All", "Frontend", "None")
pkg/oci/load_balancer_spec.go
Outdated
Ports map[string]portSpec | ||
SourceCIDRs []string | ||
SSLConfig *SSLConfig | ||
SecurityListManager securityListManager |
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 wouldn't export this field so securityListManager
pkg/oci/load_balancer_spec.go
Outdated
@@ -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, |
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.
Space after //
pkg/oci/load_balancer_spec.go
Outdated
@@ -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. |
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.
Space after //
pkg/oci/load_balancer_spec.go
Outdated
nodes: nodes, | ||
service: svc, | ||
nodes: nodes, | ||
SecurityListManager: slManagerSpec, |
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.
SecurityListManager: secListFactory(
svc.Annotations[ServiceAnnotaionLoadBalancerSecurityListManagementMode],
)
pkg/oci/load_balancer_spec_test.go
Outdated
@@ -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 |
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.
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 |
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.
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 |
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.
Space after //
The seg fault issue is already fixed in master. |
Awesome work @bdourallawzi 👍 |
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