Skip to content

Commit 0c1466e

Browse files
bdourallawziprydie
authored andcommitted
Document security list management mode annotation (#226)
1 parent d3d2191 commit 0c1466e

File tree

3 files changed

+46
-3
lines changed

3 files changed

+46
-3
lines changed

docs/load-balancer-annotations.md

+12
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ spec:
2727
| `oci-load-balancer-subnet1` | The OCID of the first [subnet][2] of the two required subnets to attach the load balancer to. Must be in separate Availability Domains. | Value provided in config file |
2828
| `oci-load-balancer-subnet2` | The OCID of the second [subnet][2] of the two required subnets to attach the load balancer to. Must be in separate Availability Domains. | Value provided in config file |
2929
| `oci-load-balancer-connection-idle-timeout` | The maximum idle time, in seconds, allowed between two successive receive or two successive send operations between the client and backend servers. | `300` for TCP listeners, `60` for HTTP listeners |
30+
| `oci-load-balancer-security-list-management-mode` | Specifies the [security list mode](##security-list-management-modes) (`"All"`, `"Frontend"`,`"None"`) to configure how security lists are managed by the CCM. | `"All"`
3031

3132
## TLS-related
3233

@@ -35,6 +36,17 @@ spec:
3536
| `oci-load-balancer-tls-secret` | A reference in the form `<namespace>/<secretName>` to a Kubernetes [TLS secret][3]. | `""` |
3637
| `oci-load-balancer-ssl-ports` | A `,` separated list of port number(s) for which to enable SSL termination. | `""` |
3738

39+
## Security List Management Modes
40+
| Mode | Description |
41+
| ---- | ----------- |
42+
| `"All"` | CCM will manage all required security list rules for load balancer services |
43+
| `"Frontend"` | CCM will manage only security list rules for ingress to the load balancer. Requires that the user has setup a rule that allows inbound traffic to the appropriate ports for kube proxy health port, node port ranges, and health check port ranges. |
44+
| `"None`" | Disables all security list management. Requires that the user has setup a rule that allows inbound traffic to the appropriate ports for kube proxy health port, node port ranges, and health check port ranges. *Additionally, requires the user to mange rules to allow inbound traffic to load balancers.* |
45+
46+
Note:
47+
- If an invalid mode is passed in the annotation, then the default (`"All"`) mode is configured.
48+
- If an annotation is not specified, the mode specified in the cloud provider config file is configured.
49+
3850
[1]: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer
3951
[2]: https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingVCNs.htm
4052
[3]: https://kubernetes.io/docs/concepts/services-networking/ingress/#tls
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
apiVersion: apps/v1beta1
2+
kind: Deployment
3+
metadata:
4+
name: nginx-deployment
5+
spec:
6+
replicas: 2
7+
template:
8+
metadata:
9+
labels:
10+
app: nginx
11+
spec:
12+
containers:
13+
- name: nginx
14+
image: nginx
15+
ports:
16+
- containerPort: 80
17+
---
18+
kind: Service
19+
apiVersion: v1
20+
metadata:
21+
name: nginx-service
22+
annotations:
23+
oci-load-balancer-security-list-management-mode: "None"
24+
spec:
25+
selector:
26+
app: nginx
27+
type: LoadBalancer
28+
ports:
29+
- name: http
30+
port: 80
31+
targetPort: 80

pkg/oci/load_balancer_security_lists.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -406,14 +406,14 @@ func getNodeIngressRules(rules []core.IngressSecurityRule, lbSubnets []*core.Sub
406406
if desiredPorts.BackendPort != 0 { // Can happen when there are no backends.
407407
for _, cidr := range desiredBackend.List() {
408408
rule := makeIngressSecurityRule(cidr, desiredPorts.BackendPort)
409-
glog.V(4).Infof("Addding node port ingress security rule %q %d-%d", *rule.Source, *rule.TcpOptions.DestinationPortRange.Min, *rule.TcpOptions.DestinationPortRange.Max)
409+
glog.V(4).Infof("Adding node port ingress security rule %q %d-%d", *rule.Source, *rule.TcpOptions.DestinationPortRange.Min, *rule.TcpOptions.DestinationPortRange.Max)
410410
ingressRules = append(ingressRules, rule)
411411
}
412412
}
413413
if desiredPorts.HealthCheckerPort != 0 {
414414
for _, cidr := range desiredHealthChecker.List() {
415415
rule := makeIngressSecurityRule(cidr, desiredPorts.HealthCheckerPort)
416-
glog.V(4).Infof("Addding health checker ingress security rule %q %d-%d", *rule.Source, *rule.TcpOptions.DestinationPortRange.Min, *rule.TcpOptions.DestinationPortRange.Max)
416+
glog.V(4).Infof("Adding health checker ingress security rule %q %d-%d", *rule.Source, *rule.TcpOptions.DestinationPortRange.Min, *rule.TcpOptions.DestinationPortRange.Max)
417417
ingressRules = append(ingressRules, rule)
418418
}
419419
}
@@ -471,7 +471,7 @@ func getLoadBalancerIngressRules(rules []core.IngressSecurityRule, sourceCIDRs [
471471
// so we need to create one for each.
472472
for _, cidr := range desired.List() {
473473
rule := makeIngressSecurityRule(cidr, port)
474-
glog.V(4).Infof("Addding load balancer ingress security rule %q %d-%d", *rule.Source, *rule.TcpOptions.DestinationPortRange.Min, *rule.TcpOptions.DestinationPortRange.Max)
474+
glog.V(4).Infof("Adding load balancer ingress security rule %q %d-%d", *rule.Source, *rule.TcpOptions.DestinationPortRange.Min, *rule.TcpOptions.DestinationPortRange.Max)
475475
ingressRules = append(ingressRules, rule)
476476
}
477477

0 commit comments

Comments
 (0)