Skip to content

Commit 479783f

Browse files
authored
Merge pull request #76694 from ShaunaDiaz/OSDOCS-8896
OSDOCS-8896: adds clarification to LBs in MicroShift
2 parents 82c64a7 + 585c07f commit 479783f

File tree

2 files changed

+43
-14
lines changed

2 files changed

+43
-14
lines changed

microshift_networking/microshift-networking-settings.adoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ include::modules/microshift-cri-o-container-runtime.adoc[leveloffset=+1]
3333

3434
include::modules/microshift-ovs-snapshot.adoc[leveloffset=+1]
3535

36+
[id="microshift-about-load-balancer-service_{context}"]
37+
== The {microshift-short} LoadBalancer service for workloads
38+
39+
{microshift-short} has a built-in implementation of network load balancers that you can use for your workloads and applications within the cluster. You can create a `LoadBalancer` service by configuring a pod to interpret ingress rules and serve as an ingress controller. The following procedure gives an example of a deployment-based `LoadBalancer` service.
40+
3641
include::modules/microshift-deploying-a-load-balancer.adoc[leveloffset=+1]
3742

3843
include::modules/microshift-blocking-nodeport-access.adoc[leveloffset=+1]

modules/microshift-deploying-a-load-balancer.adoc

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,43 +4,65 @@
44

55
:_mod-docs-content-type: PROCEDURE
66
[id="microshift-deploying-a-load-balancer_{context}"]
7-
= Deploying a load balancer for a workload
7+
= Deploying a load balancer for an application
88

9-
{microshift-short} has a built-in implementation of network load balancers. The following example procedure uses the node IP address as the external IP address for the `LoadBalancer` service configuration file. You can use this example as guidance for how to deploy load balancers for your workloads.
9+
The following example procedure uses the node IP address as the external IP address for the `LoadBalancer` service configuration file. Use this example as guidance for how to deploy load balancers.
1010

1111
.Prerequisites
1212

1313
* The OpenShift CLI (`oc`) is installed.
14-
* You have access to the cluster as a user with the cluster administration role.
1514
* You installed a cluster on an infrastructure configured with the OVN-Kubernetes network plugin.
1615
* The `KUBECONFIG` environment variable is set.
1716
1817
.Procedure
1918

20-
. Verify that your pods are running by running the following command:
19+
. Verify that your pods are running by entering the following command:
2120
+
2221
[source,terminal]
2322
----
2423
$ oc get pods -A
2524
----
25+
+
26+
.Example output
27+
[source,terminal]
28+
----
29+
NAMESPACE NAME READY STATUS RESTARTS AGE
30+
default i-06166fbb376f14a8bus-west-2computeinternal-debug-qtwcr 1/1 Running 0 46m
31+
kube-system csi-snapshot-controller-5c6586d546-lprv4 1/1 Running 0 51m
32+
kube-system csi-snapshot-webhook-6bf8ddc7f5-kz6k9 1/1 Running 0 51m
33+
openshift-dns dns-default-45jl7 2/2 Running 0 50m
34+
openshift-dns node-resolver-7wmzf 1/1 Running 0 51m
35+
openshift-ingress router-default-78b86fbf9d-qvj9s 1/1 Running 0 51m
36+
openshift-multus dhcp-daemon-j7qnf 1/1 Running 0 51m
37+
openshift-multus multus-r758z 1/1 Running 0 51m
38+
openshift-operator-lifecycle-manager catalog-operator-85fb86fcb9-t6zm7 1/1 Running 0 51m
39+
openshift-operator-lifecycle-manager olm-operator-87656d995-fvz84 1/1 Running 0 51m
40+
openshift-ovn-kubernetes ovnkube-master-5rfhh 4/4 Running 0 51m
41+
openshift-ovn-kubernetes ovnkube-node-gcnt6 1/1 Running 0 51m
42+
openshift-service-ca service-ca-bf5b7c9f8-pn6rk 1/1 Running 0 51m
43+
openshift-storage topolvm-controller-549f7fbdd5-7vrmv 5/5 Running 0 51m
44+
openshift-storage topolvm-node-rht2m 3/3 Running 0 50m
45+
----
2646

27-
. Create the example namespace by running the following commands:
47+
. Create a namespace by running the following commands:
2848
+
2949
[source,terminal]
3050
----
31-
$ NAMESPACE=nginx-lb-test
51+
$ NAMESPACE=<nginx-lb-test> <1>
3252
----
53+
<1> Replace _<nginx-lb-test> with the application namespace that you want to create.
3354
+
3455
[source,terminal]
3556
----
3657
$ oc create ns $NAMESPACE
3758
----
38-
39-
. The following example deploys three replicas of the test `nginx` application in your namespace:
59+
+
60+
.Example namespace
61+
The following example deploys three replicas of the test `nginx` application in the created namespace:
4062
+
4163
[source,terminal]
4264
----
43-
$ oc apply -n $NAMESPACE -f - <<EOF
65+
oc apply -n $NAMESPACE -f - <<EOF
4466
apiVersion: v1
4567
kind: ConfigMap
4668
metadata:
@@ -97,11 +119,11 @@ EOF
97119
$ oc get pods -n $NAMESPACE
98120
----
99121
100-
. Create a `LoadBalancer` service for the `nginx` test application with the following sample commands:
122+
. Create a `LoadBalancer` service for the `nginx` test application by running the following command:
101123
+
102124
[source,terminal]
103125
----
104-
$ oc create -n $NAMESPACE -f - <<EOF
126+
oc create -n $NAMESPACE -f - <<EOF
105127
apiVersion: v1
106128
kind: Service
107129
metadata:
@@ -118,7 +140,7 @@ EOF
118140
+
119141
[NOTE]
120142
====
121-
You must ensure that the `port` parameter is a host port that is not occupied by other `LoadBalancer` services or {product-title} components.
143+
You must ensure that the `port` parameter is a host port that is not occupied by other `LoadBalancer` services or {microshift-short} components.
122144
====
123145
124146
. Verify that the service file exists, that the external IP address is properly assigned, and that the external IP is identical to the node IP by running the following command:
@@ -137,15 +159,17 @@ nginx LoadBalancer 10.43.183.104 192.168.1.241 81:32434/TCP 2m
137159
138160
.Verification
139161
140-
* The following command forms five connections to the example `nginx` application using the external IP address of the `LoadBalancer` service configuration. The result of the command is a list of those server IP addresses. Verify that the load balancer sends requests to all the running applications with the following command:
162+
The following command forms five connections to the example `nginx` application using the external IP address of the `LoadBalancer` service configuration. The result of the command is a list of those server IP addresses.
163+
164+
* Verify that the load balancer sends requests to all the running applications by running the following command:
141165
+
142166
[source,terminal]
143167
----
144168
EXTERNAL_IP=192.168.1.241
145169
seq 5 | xargs -Iz curl -s -I http://$EXTERNAL_IP:81 | grep X-Server-IP
146170
----
147171
+
148-
The output of the previous command contains different IP addresses if the load balancer is successfully distributing the traffic to the applications, for example:
172+
The output of the previous command contains different IP addresses if the `LoadBalancer` service is successfully distributing the traffic to the applications, for example:
149173
+
150174
.Example output
151175
[source,terminal]

0 commit comments

Comments
 (0)