forked from docs/doc-exports
Reviewed-by: Eotvos, Oliver <oliver.eotvos@t-systems.com> Co-authored-by: qiujiandong1 <qiujiandong1@huawei.com> Co-committed-by: qiujiandong1 <qiujiandong1@huawei.com>
125 lines
19 KiB
HTML
125 lines
19 KiB
HTML
<a name="ucs_01_0273"></a><a name="ucs_01_0273"></a>
|
||
|
||
<h1 class="topictitle1">LoadBalancer</h1>
|
||
<div id="body0000001554366005"><p id="ucs_01_0273__p11162185314530">A workload can be accessed from a public network through a load balancer. This access type is applicable to Services that need to be exposed to a public network in the system. The access address is in the format of <IP address of public network load balancer>:<access port>, for example, <strong id="ucs_01_0273__b18709125072516">10.117.117.117:80</strong>.</p>
|
||
<div class="section" id="ucs_01_0273__section277113795213"><h4 class="sectiontitle">Prerequisites</h4><p id="ucs_01_0273__p1759873633811">A workload is available. If no workload is available, create one by following the procedure described in <a href="ucs_01_0254.html">Workloads</a>.</p>
|
||
</div>
|
||
<div class="section" id="ucs_01_0273__section233991271612"><h4 class="sectiontitle">Creating a Service</h4><ol id="ucs_01_0273__ol1321170617144"><li id="ucs_01_0273__li135792781317"><span>Log in to the UCS console. In the navigation pane, choose <span class="uicontrol" id="ucs_01_0273__uicontrol152861319163116"><b>Fleets</b></span>.</span></li><li id="ucs_01_0273__li1175242111413"><span>On the <span class="uicontrol" id="ucs_01_0273__uicontrol1524110158401"><b>Fleets</b></span> tab, click the name of the federation-enabled fleet to access its details page.</span></li><li id="ucs_01_0273__li189706451458"><span>In the navigation pane, choose <span class="uicontrol" id="ucs_01_0273__uicontrol380832523120"><b>Services and Ingresses</b></span>.</span></li><li id="ucs_01_0273__li68411493511"><span>On the <strong id="ucs_01_0273__ucs_01_0271_b3558103195113">Services</strong> tab, select the namespace that the Service will belong to and click <strong id="ucs_01_0273__ucs_01_0271_b96158338102">Create Service</strong> in the upper right corner. For details about how to create a namespace, see <a href="ucs_01_0281.html#ucs_01_0281__section20381629121511">Creating a Namespace</a>.</span></li><li id="ucs_01_0273__li3476651017144"><a name="ucs_01_0273__li3476651017144"></a><a name="li3476651017144"></a><span>On the <strong id="ucs_01_0273__b1765913105618">Services</strong> tab, click <strong id="ucs_01_0273__b147651813125617">Create Service</strong>. Then, configure the parameters.</span><p><p id="ucs_01_0273__p15427720124618"></p>
|
||
<div class="p" id="ucs_01_0273__p142331648133411"><ul id="ucs_01_0273__ul772914282141"><li id="ucs_01_0273__li1729102821414"><strong id="ucs_01_0273__b119851471498">Name</strong>: Enter a Service name consisting of 1 to 50 characters.</li><li id="ucs_01_0273__li1872902861419"><strong id="ucs_01_0273__b15795044430">Type</strong>: Select <strong id="ucs_01_0273__b146792047121616">LoadBalancer</strong>.</li><li id="ucs_01_0273__li1622571518145"><strong id="ucs_01_0273__b173695374589">Affinity</strong><ul id="ucs_01_0273__ul15225415131414"><li id="ucs_01_0273__li2022511541414"><strong id="ucs_01_0273__b1920191881713">Cluster-level</strong>: The IP addresses and ports of all nodes in a cluster can access the workload associated with the Service. However, accessing the Service may result in a performance decrease due to route redirection, and the client's source IP address may not be obtainable.</li><li id="ucs_01_0273__li222517153145"><strong id="ucs_01_0273__b779314712178">Node-level</strong>: Only the IP address and port of the node where the workload is located can access the workload associated with the Service. Accessing the Service will not result in a performance decrease due to route redirection, and client's source IP address can be obtained.</li></ul>
|
||
</li><li id="ucs_01_0273__li355492917345"><strong id="ucs_01_0273__b2098967026105713">Port</strong><ul id="ucs_01_0273__ul9262141163412"><li id="ucs_01_0273__li25641447141"><strong id="ucs_01_0273__b199910211436">Protocol</strong>: Select <strong id="ucs_01_0273__b9840162294315">TCP</strong> or <strong id="ucs_01_0273__b7249925154317">UDP</strong>.</li><li id="ucs_01_0273__li1018433010388"><strong id="ucs_01_0273__b266006634105713">Service Port</strong>: Specify a port to map a container port to the load balancer. The port range is 1–65535. The port will be used when the application is accessed through the load balancer.</li><li id="ucs_01_0273__li142471635131918"><strong id="ucs_01_0273__b194014491105713">Container Port</strong>: Port on which the workload listens, defined in the container image. For example, the Nginx application listens on port 80 (container port).</li></ul>
|
||
</li><li id="ucs_01_0273__li1289211364173"><strong id="ucs_01_0273__b980418533457">Cluster</strong>: Add a cluster where load balancers are to be deployed and complete differentiated load balancer settings.<ul id="ucs_01_0273__ul1870324841815"><li id="ucs_01_0273__li194527824511">CCE cluster:<ul id="ucs_01_0273__ul08361435113311"><li id="ucs_01_0273__li12690103319339"><strong id="ucs_01_0273__b1276185755913">Load Balancer</strong>: Only load balancers in the VPC where the cluster resides are supported.</li><li id="ucs_01_0273__li33104413335"><strong id="ucs_01_0273__b191781812012">Algorithm</strong><p id="ucs_01_0273__p549525319404"><strong id="ucs_01_0273__b7373731118">Weighted round robin</strong>: Distributes requests to backend servers based on weights.</p>
|
||
<p id="ucs_01_0273__p4495753144010"><strong id="ucs_01_0273__b667611712111">Weighted least connections</strong>: Distributes requests to backend servers with the smallest ratio (current connections divided by weight).</p>
|
||
<p id="ucs_01_0273__p149519533407"><strong id="ucs_01_0273__b86019111618">Source IP hash</strong>: Allocates requests from the client IP address to a fixed server, allowing the entire session to be processed by the same server.</p>
|
||
</li><li id="ucs_01_0273__li10517259203316"><strong id="ucs_01_0273__b517774411111">Sticky Session</strong>: This function is disabled by default. You can select <strong id="ucs_01_0273__b61779441110">Source IP</strong>. Listeners ensure session stickiness based on IP addresses. Requests from the same IP address will be routed to the same backend server.</li><li id="ucs_01_0273__li83149663418"><strong id="ucs_01_0273__b16207418921">Health Check</strong>: This function is disabled by default. You can select either HTTP or TCP to enable health checks for your load balancer. For details about the parameters, see <a href="#ucs_01_0273__table14802612204814">Table 1</a>.
|
||
<div class="tablenoborder"><a name="ucs_01_0273__table14802612204814"></a><a name="table14802612204814"></a><table cellpadding="4" cellspacing="0" summary="" id="ucs_01_0273__table14802612204814" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Health check parameters</caption><thead align="left"><tr id="ucs_01_0273__row108031512164817"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.3.2.5.2.2.1.5.2.1.1.4.3.2.4.1.1"><p id="ucs_01_0273__p1803141220480">Parameter</p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.3.2.5.2.2.1.5.2.1.1.4.3.2.4.1.2"><p id="ucs_01_0273__p10803812104817">Description</p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.3.2.5.2.2.1.5.2.1.1.4.3.2.4.1.3"><p id="ucs_01_0273__p2803112104815">Example</p>
|
||
</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody><tr id="ucs_01_0273__row158034126480"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.5.2.2.1.5.2.1.1.4.3.2.4.1.1 "><p id="ucs_01_0273__p880381212483">Check Path</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.3.2.5.2.2.1.5.2.1.1.4.3.2.4.1.2 "><p id="ucs_01_0273__p08031312194812">This parameter is available if you have selected <strong id="ucs_01_0273__b64111421134">HTTP</strong> for <strong id="ucs_01_0273__b14111621938">Health Check</strong>. Specify the URL for health checks. The check path must start with a slash (/) and contain 1 to 80 characters.</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.5.2.2.1.5.2.1.1.4.3.2.4.1.3 "><p id="ucs_01_0273__p380301204813">/</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="ucs_01_0273__row480319128483"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.5.2.2.1.5.2.1.1.4.3.2.4.1.1 "><p id="ucs_01_0273__p3803412164813">Port</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.3.2.5.2.2.1.5.2.1.1.4.3.2.4.1.2 "><p id="ucs_01_0273__p12803141217484">Health check port. The port number ranges from 1 to 65535.</p>
|
||
<p id="ucs_01_0273__p1150815115416">By default, the Service ports (node port and container port of the NodePort Service) are used.</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.5.2.2.1.5.2.1.1.4.3.2.4.1.3 "><p id="ucs_01_0273__p380311213483">80</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="ucs_01_0273__row1099411120492"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.5.2.2.1.5.2.1.1.4.3.2.4.1.1 "><p id="ucs_01_0273__p129951811104915">Check Interval (s)</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.3.2.5.2.2.1.5.2.1.1.4.3.2.4.1.2 "><p id="ucs_01_0273__p18523131105213">Maximum time between health checks, in seconds.</p>
|
||
<p id="ucs_01_0273__p952315114529">The value ranges from 1 to 50.</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.5.2.2.1.5.2.1.1.4.3.2.4.1.3 "><p id="ucs_01_0273__p2099511119497">5</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="ucs_01_0273__row1349291320496"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.5.2.2.1.5.2.1.1.4.3.2.4.1.1 "><p id="ucs_01_0273__p1449321314496">Timeout (s)</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.3.2.5.2.2.1.5.2.1.1.4.3.2.4.1.2 "><p id="ucs_01_0273__p143115855219">Maximum time required for waiting for a response from the health check, in seconds.</p>
|
||
<p id="ucs_01_0273__p74930133492">The value ranges from 1 to 50.</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.5.2.2.1.5.2.1.1.4.3.2.4.1.3 "><p id="ucs_01_0273__p549311364914">10</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="ucs_01_0273__row13374141155113"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.5.2.2.1.5.2.1.1.4.3.2.4.1.1 "><p id="ucs_01_0273__p3374941195119">Max. Retries</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.3.2.5.2.2.1.5.2.1.1.4.3.2.4.1.2 "><p id="ucs_01_0273__p173741241185113">Maximum number of health check retries. The value ranges from 1 to 10.</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.5.2.2.1.5.2.1.1.4.3.2.4.1.3 "><p id="ucs_01_0273__p7374641115116">5</p>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</li></ul>
|
||
<p id="ucs_01_0273__p687844984720"></p>
|
||
<p id="ucs_01_0273__p873911323617"></p>
|
||
</li><li id="ucs_01_0273__li16529553188">Other clouds<ul id="ucs_01_0273__ul1634245111299"><li id="ucs_01_0273__li117856309816"><strong id="ucs_01_0273__b1292411115510">Ingress Class</strong>: You can select an existing ingress class or manually enter an ingress class name. For details, see <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/" target="_blank" rel="noopener noreferrer">Ingress</a>.</li><li id="ucs_01_0273__li18176171015919"><strong id="ucs_01_0273__b73419149553">Annotation</strong>: Enter an annotation in a key-value pair based on your service and vendor requirements.</li></ul>
|
||
</li><li id="ucs_01_0273__li16486038191218">To create an internal load balancer, add the annotation based on the cloud service provider of your cluster. For details, see <a href="https://kubernetes.io/docs/concepts/services-networking/service/" target="_blank" rel="noopener noreferrer">Internal load balancer</a>.</li></ul>
|
||
</li><li id="ucs_01_0273__li1272932810147"><strong id="ucs_01_0273__b4406158195910">Namespace</strong>: namespace that the Service belongs to.</li><li id="ucs_01_0273__li722511531415"><strong id="ucs_01_0273__ucs_01_0271_b12660174151116">Selector</strong>: Services are associated with workloads (labels) through selectors. Click <strong id="ucs_01_0273__ucs_01_0271_b558195917113">Reference Workload Label</strong> to reference the labels of an existing workload.<ul id="ucs_01_0273__ucs_01_0271_ul19361358171317"><li id="ucs_01_0273__ucs_01_0271_li23625801315"><strong id="ucs_01_0273__ucs_01_0271_b2749141441410">Type</strong>: Select the desired workload type.</li><li id="ucs_01_0273__ucs_01_0271_li83665861311"><strong id="ucs_01_0273__ucs_01_0271_b1255111921513">Workload</strong>: Select an existing workload. If your workload is not displayed in the list, click <span><img id="ucs_01_0273__ucs_01_0271_image636115818133" src="en-us_image_0000001554906629.png"></span> to refresh it.</li><li id="ucs_01_0273__ucs_01_0271_li1336115811135"><strong id="ucs_01_0273__ucs_01_0271_b2044173112178">Label</strong>: After a workload is selected, its labels are displayed and cannot be modified.</li></ul>
|
||
<p id="ucs_01_0273__ucs_01_0271_p167168415387"></p>
|
||
<p id="ucs_01_0273__ucs_01_0271_p72876228378"></p>
|
||
</li></ul>
|
||
</div>
|
||
</p></li><li id="ucs_01_0273__li5563226917144"><span>Click <strong id="ucs_01_0273__b1453366994105713">OK</strong>.</span></li><li id="ucs_01_0273__li1318315121713"><span>Obtain the access address.</span><p><ol type="a" id="ucs_01_0273__ol1810111620718"><li id="ucs_01_0273__li17941520077">In the navigation pane, choose <span class="uicontrol" id="ucs_01_0273__uicontrol1867974863112"><b>Services and Ingresses</b></span>.</li><li id="ucs_01_0273__li01061618711">On the <strong id="ucs_01_0273__b19614144118569">Services</strong> tab, click the name of the added Service to go to its details page. Then, obtain the access address of the cluster. You can access a backend pod using the EIP and port number of the load balancer.</li></ol>
|
||
</p></li></ol>
|
||
</div>
|
||
<div class="section" id="ucs_01_0273__section359413445405"><h4 class="sectiontitle">Related Operations</h4><div class="p" id="ucs_01_0273__p98641861268">You can also perform operations described in <a href="#ucs_01_0273__table1619535674020">Table 2</a>.
|
||
<div class="tablenoborder"><a name="ucs_01_0273__table1619535674020"></a><a name="table1619535674020"></a><table cellpadding="4" cellspacing="0" summary="" id="ucs_01_0273__table1619535674020" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Related operations</caption><thead align="left"><tr id="ucs_01_0273__row16740630125918"><th align="left" class="cellrowborder" valign="top" width="32%" id="mcps1.3.4.2.2.2.3.1.1"><p id="ucs_01_0273__p17740730115914">Operation</p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="68%" id="mcps1.3.4.2.2.2.3.1.2"><p id="ucs_01_0273__p1574018303592">Description</p>
|
||
</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody><tr id="ucs_01_0273__row7185670013"><td class="cellrowborder" valign="top" width="32%" headers="mcps1.3.4.2.2.2.3.1.1 "><p id="ucs_01_0273__p122351921135812">Creating a Service from a YAML file</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="68%" headers="mcps1.3.4.2.2.2.3.1.2 "><p id="ucs_01_0273__p1823510218585">Click <span class="uicontrol" id="ucs_01_0273__uicontrol14423161811596"><b>Create from YAML</b></span> in the upper right corner to create a Service from an existing YAML file.</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="ucs_01_0273__row1246161918313"><td class="cellrowborder" valign="top" width="32%" headers="mcps1.3.4.2.2.2.3.1.1 "><p id="ucs_01_0273__p187045297314">Viewing details</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="68%" headers="mcps1.3.4.2.2.2.3.1.2 "><ol id="ucs_01_0273__ol10304111620417"><li id="ucs_01_0273__li193047169420">Select the namespace that the Service belongs to.</li><li id="ucs_01_0273__li1391328542">(Optional) Search for a Service by its name.</li><li id="ucs_01_0273__li05089517410">Click the Service name to view its details, including the basic information and cluster deployment information.</li><li id="ucs_01_0273__li20377186563">On the <strong id="ucs_01_0273__b861603917118">Service Details</strong> page, click <span class="uicontrol" id="ucs_01_0273__uicontrol197553258610"><b>View YAML</b></span> in the <strong id="ucs_01_0273__b763381714210">Cluster</strong> area to view or download YAML files of Service instances deployed in each cluster.</li></ol>
|
||
</td>
|
||
</tr>
|
||
<tr id="ucs_01_0273__row133318512019"><td class="cellrowborder" valign="top" width="32%" headers="mcps1.3.4.2.2.2.3.1.1 "><p id="ucs_01_0273__p163331851201">Editing a YAML file</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="68%" headers="mcps1.3.4.2.2.2.3.1.2 "><p id="ucs_01_0273__p1633314512016">Click <span class="uicontrol" id="ucs_01_0273__uicontrol89896300203"><b>Edit YAML</b></span> in the row where the target Service resides to view and edit the YAML file of the Service.</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="ucs_01_0273__row12740103016592"><td class="cellrowborder" valign="top" width="32%" headers="mcps1.3.4.2.2.2.3.1.1 "><p id="ucs_01_0273__p4740153012590">Updating a Service</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="68%" headers="mcps1.3.4.2.2.2.3.1.2 "><ol id="ucs_01_0273__ol187401330145919"><li id="ucs_01_0273__li57402030165918">Choose <strong id="ucs_01_0273__b115983018142">More</strong> > <strong id="ucs_01_0273__b1760410151412">Update</strong> in the row where the target Service resides.</li><li id="ucs_01_0273__li20740730145912">Modify the information by referring to <a href="#ucs_01_0273__li3476651017144">5</a>.</li><li id="ucs_01_0273__li15740930135911">Click <span class="uicontrol" id="ucs_01_0273__uicontrol13369141671614"><b>OK</b></span> to submit the modified information.</li></ol>
|
||
</td>
|
||
</tr>
|
||
<tr id="ucs_01_0273__row263419121693"><td class="cellrowborder" valign="top" width="32%" headers="mcps1.3.4.2.2.2.3.1.1 "><p id="ucs_01_0273__p136342121894">Deleting a Service</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="68%" headers="mcps1.3.4.2.2.2.3.1.2 "><p id="ucs_01_0273__p9634111213912">Choose <span class="uicontrol" id="ucs_01_0273__uicontrol155981209142"><b>More</b></span> > <strong id="ucs_01_0273__b14599132010146">Delete</strong> in the row where the target Service resides, and click <span class="uicontrol" id="ucs_01_0273__uicontrol759922019142"><b>Yes</b></span>.</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="ucs_01_0273__row874013304597"><td class="cellrowborder" valign="top" width="32%" headers="mcps1.3.4.2.2.2.3.1.1 "><p id="ucs_01_0273__p17740330175915">Deleting Services in batches</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="68%" headers="mcps1.3.4.2.2.2.3.1.2 "><ol id="ucs_01_0273__ol2018182981712"><li id="ucs_01_0273__li4181182991710">Select the Services to be deleted.</li><li id="ucs_01_0273__li181811529181711">Click <span class="uicontrol" id="ucs_01_0273__uicontrol5266611151612"><b>Delete</b></span> in the upper left corner.</li><li id="ucs_01_0273__li9181929161712">Click <span class="uicontrol" id="ucs_01_0273__uicontrol1243151815184"><b>Yes</b></span>.</li></ol>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div>
|
||
<div class="familylinks">
|
||
<div class="parentlink"><strong>Parent topic:</strong> <a href="ucs_01_0300.html">Services</a></div>
|
||
</div>
|
||
</div>
|
||
|