Skip to content
This repository was archived by the owner on Jun 6, 2025. It is now read-only.

Commit 686eb37

Browse files
committed
release 1.0.9
1 parent 1649960 commit 686eb37

File tree

2 files changed

+47
-1
lines changed

2 files changed

+47
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ If you are looking to provision an OKE cluster for RDMA and GPUs using this stac
7575
# What to do next?
7676

7777
Provisioning an OKE cluster is just the first step, be sure to also check out these guides to learn how to configure it:
78+
* [OKE policies](https://github.com/oracle-devrel/technology-engineering/blob/main/app-dev/devops-and-containers/oke/oke-policies/policies.md)
7879
* [GitOps with ArgoCD](https://github.com/alcampag/oke-gitops)
7980
* [Ingress guide](ingress.md)
8081

ingress.md

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ ALLOW any-user to manage vcns in compartment <network-compartment-name> where re
1313
ALLOW any-user to manage virtual-network-family in compartment <network-compartment-name> where request.principal.type = 'cluster'
1414
```
1515
Note that these policies are necessary even if the network compartment and the cluster compartment are the same!
16+
1617
These policies can also be further restricted by specifying the OKE cluster id.
1718

1819
## Configuring the Service of type LoadBalancer
@@ -219,7 +220,33 @@ ports:
219220
```
220221
Where 10.0.0.0/16 is the CIDR block of the VCN where the OKE cluster has been provisioned and where the Load Balancer is located.
221222
222-
## Change the default Load Balancer policy
223+
## Select only the necessary worker nodes to be included in the Load Balancer
224+
225+
By default, OKE will include all the worker nodes in a cluster as backend set of the Load Balancer. If nodes increase a lot, having many nodes in the backend set
226+
may slow down the Load Balancer.
227+
We can restrict the nodes to be included in the backend set by using labels and the annotation **oci.oraclecloud.com/node-label-selector**:
228+
```yaml
229+
service:
230+
type: LoadBalancer
231+
annotations:
232+
oci.oraclecloud.com/load-balancer-type: "lb"
233+
service.beta.kubernetes.io/oci-load-balancer-shape: "flexible"
234+
service.beta.kubernetes.io/oci-load-balancer-shape-flex-min: "10"
235+
service.beta.kubernetes.io/oci-load-balancer-shape-flex-max: "100"
236+
oci.oraclecloud.com/oci-network-security-groups: "ocid1.networksecuritygroup.oc1...." # It is the oke-lb-nsg OCID
237+
oci.oraclecloud.com/security-rule-management-mode: "NSG"
238+
service.beta.kubernetes.io/oci-load-balancer-backend-protocol: "TCP" # Proxy Protocol only works with a TCP listener
239+
service.beta.kubernetes.io/oci-load-balancer-connection-proxy-protocol-version: "2" # Enable Proxy Protocol v2
240+
oci.oraclecloud.com/node-label-selector: "env=test"
241+
spec:
242+
externalTrafficPolicy: "Local"
243+
loadBalancerIP: "121.127.6.12"
244+
loadBalancerSourceRanges:
245+
- "10.1.0.0/16"
246+
```
247+
See the [documentation](https://docs.oracle.com/en-us/iaas/Content/ContEng/Tasks/contengconfiguringloadbalancersnetworkloadbalancers-subtopic.htm#contengcreatingloadbalancer_topic-Selecting_worker_nodes_to_include_in_backend_sets) for more examples.
248+
249+
## Change the default Load Balancer policy if needed
223250
224251
The default Load Balancer policy is ROUND_ROBIN. If your applications require long connection times, better change the policy to LEAST_CONNECTIONS:
225252
```yaml
@@ -234,6 +261,7 @@ service:
234261
oci.oraclecloud.com/security-rule-management-mode: "NSG"
235262
service.beta.kubernetes.io/oci-load-balancer-backend-protocol: "TCP" # Proxy Protocol only works with a TCP listener
236263
service.beta.kubernetes.io/oci-load-balancer-connection-proxy-protocol-version: "2" # Enable Proxy Protocol v2
264+
oci.oraclecloud.com/node-label-selector: "env=test"
237265
oci.oraclecloud.com/loadbalancer-policy: "LEAST_CONNECTIONS"
238266
spec:
239267
externalTrafficPolicy: "Local"
@@ -259,6 +287,7 @@ service:
259287
oci.oraclecloud.com/security-rule-management-mode: "NSG"
260288
service.beta.kubernetes.io/oci-load-balancer-backend-protocol: "TCP" # Proxy Protocol only works with a TCP listener
261289
service.beta.kubernetes.io/oci-load-balancer-connection-proxy-protocol-version: "2" # Enable Proxy Protocol v2
290+
oci.oraclecloud.com/node-label-selector: "env=test"
262291
service.beta.kubernetes.io/oci-load-balancer-connection-idle-timeout: "60"
263292
spec:
264293
externalTrafficPolicy: "Local"
@@ -284,6 +313,7 @@ service:
284313
oci.oraclecloud.com/security-rule-management-mode: "NSG"
285314
service.beta.kubernetes.io/oci-load-balancer-backend-protocol: "TCP" # Proxy Protocol only works with a TCP listener
286315
service.beta.kubernetes.io/oci-load-balancer-connection-proxy-protocol-version: "2" # Enable Proxy Protocol v2
316+
oci.oraclecloud.com/node-label-selector: "env=test"
287317
service.beta.kubernetes.io/oci-load-balancer-connection-idle-timeout: "60"
288318
service.beta.kubernetes.io/oci-load-balancer-health-check-interval: "3000"
289319
service.beta.kubernetes.io/oci-load-balancer-health-check-timeout: "2000"
@@ -311,6 +341,7 @@ service:
311341
oci.oraclecloud.com/security-rule-management-mode: "NSG"
312342
service.beta.kubernetes.io/oci-load-balancer-backend-protocol: "TCP" # Proxy Protocol only works with a TCP listener
313343
service.beta.kubernetes.io/oci-load-balancer-connection-proxy-protocol-version: "2" # Enable Proxy Protocol v2
344+
oci.oraclecloud.com/node-label-selector: "env=test"
314345
service.beta.kubernetes.io/oci-load-balancer-connection-idle-timeout: "60"
315346
service.beta.kubernetes.io/oci-load-balancer-health-check-interval: "3000"
316347
service.beta.kubernetes.io/oci-load-balancer-health-check-timeout: "2000"
@@ -333,6 +364,20 @@ service:
333364
- "10.1.0.0/16"
334365
```
335366
367+
## Additional best practices
368+
369+
If you expect to have multiple environments in the same OKE cluster, it's better to create multiple IngressClasses for every environment, each with its own ingress controller and Load Balancer.
370+
371+
To better manage costs, do not forget to add cost-tracking tags to the Load Balancer! See [here](https://docs.oracle.com/en-us/iaas/Content/ContEng/Tasks/contengtaggingclusterresources_tagging-oke-resources_load-balancer-tags.htm#contengtaggingclusterresources_tagging_oke_resources_load_balancer_tags) for more information.
372+
373+
NOTE: Remember that to apply tags additional policies may be needed, see [here](https://docs.oracle.com/en-us/iaas/Content/ContEng/Tasks/contengtaggingclusterresources_iam-tag-namespace-policy.htm#contengtaggingclusterresources_iam-tag-namespace-policy).
374+
375+
This guide shows how to configure an ingress controller with a Load Balancer configured with TLS passthrough. SSL/TLS termination will happen at the Ingress level.
376+
377+
Usually, this is preferable as the Ingress controller is directly integrated with cert-manager and is capable to handle multiple certificates.
378+
379+
If you only have one certificate, you can also terminate TLS at the Load Balancer level and there are some additional [annotations](https://docs.oracle.com/en-us/iaas/Content/ContEng/Tasks/contengcreatingloadbalancers-subtopic.htm#creatinglbhttps).
380+
336381
## Enable API Gateway features (requires an enterprise license)
337382
338383
Generally speaking, all the major Ingress controllers (Nginx, Traefik, Kong) are open source, but many useful features require an enterprise license.

0 commit comments

Comments
 (0)