Files
doc-exports/docs/cce/umn/cce_faq_00099.html
Dong, Qiu Jian b05d81fd8b CCE UMN for 1.23 reuploaded -20221103
Reviewed-by: gtema <artem.goncharov@gmail.com>
Co-authored-by: Dong, Qiu Jian <qiujiandong1@huawei.com>
Co-committed-by: Dong, Qiu Jian <qiujiandong1@huawei.com>
2022-11-10 19:50:29 +00:00

262 lines
22 KiB
HTML

<a name="cce_faq_00099"></a><a name="cce_faq_00099"></a>
<h1 class="topictitle1">How Do I Use kubectl to Set the Workload Access Type to LoadBalancer (ELB)?</h1>
<div id="body0000001151315252"><p id="cce_faq_00099__p8060118">This section uses the Nginx workload as an example to describe how to set the workload access type to <span class="uicontrol" id="cce_faq_00099__uicontrol12203121203114"><b>LoadBalancer (ELB)</b></span>.</p>
<div class="section" id="cce_faq_00099__section7807122171"><h4 class="sectiontitle">Prerequisites</h4><ul id="cce_faq_00099__ul192611921976"><li id="cce_faq_00099__li93814241774">An ELB has been created.</li><li id="cce_faq_00099__li026152112717">You have connected an Elastic Cloud Server (ECS) to the cluster by running the kubectl command.</li></ul>
</div>
<div class="section" id="cce_faq_00099__section1341315116296"><h4 class="sectiontitle">Procedure</h4><ol id="cce_faq_00099__ol148266597374"><li id="cce_faq_00099__li38261059173717"><span>Log in to the <span class="keyword" id="cce_faq_00099__keyword102917575372">ECS</span> on which the <span class="keyword" id="cce_faq_00099__keyword17291145743712">kubectl</span> has been configured.</span></li><li id="cce_faq_00099__li356515612387"><span>Create and edit the <strong id="cce_faq_00099__b8565146103816">nginx-deployment.yaml</strong> and <strong id="cce_faq_00099__b135651164387">nginx-elb-svc.yaml</strong> files.</span><p><p id="cce_faq_00099__p2056510693812">The file names are user-defined. <strong id="cce_faq_00099__b1856536153820">nginx-deployment.yaml</strong> and <strong id="cce_faq_00099__b15654693813">nginx-elb-svc.yaml</strong> are merely example file names.</p>
<p id="cce_faq_00099__p12565368383"><strong id="cce_faq_00099__b1456506183813">vi nginx-deployment.yaml</strong></p>
<pre class="screen" id="cce_faq_00099__screen456619611387">apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: nginx
spec:
replicas: 1
selector:
matchLabels:
app: nginx
strategy:
type: RollingUpdate
template:
metadata:
labels:
app: nginx
spec:
containers:
- image: nginx
imagePullPolicy: Always
name: nginx
imagePullSecrets:
- name: default-secret</pre>
<p id="cce_faq_00099__p14566166133812"><strong id="cce_faq_00099__b1856615623811">vi nginx-elb-svc.yaml</strong></p>
<div class="note" id="cce_faq_00099__note1456615613383"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="cce_faq_00099__p55660693810">Before enabling session stickness, ensure that the following conditions are met:</p>
<ul id="cce_faq_00099__ul1156618613818"><li id="cce_faq_00099__li1856610693813">The workload protocol is TCP.</li><li id="cce_faq_00099__li35666643813">Anti-affinity has been configured between pods of the workload. That is, all pods of the workload are deployed on different nodes.</li></ul>
</div></div>
<ul id="cce_faq_00099__ul256712633816"><li id="cce_faq_00099__li17567146133819">Automatically creating load balancer<pre class="screen" id="cce_faq_00099__screen195670617382">apiVersion: v1
kind: Service
metadata:
annotations:
kubernetes.io/elb.class: union
kubernetes.io/session-affinity-mode: SOURCE_IP
kubernetes.io/elb.subnet-id: 5083f225-9bf8-48fa-9c8b-67bd9693c4c0
kubernetes.io/elb.enterpriseID: debb7ae2-6d2f-4e6c-a0aa-1ccafd92b8eb
kubernetes.io/elb.autocreate: '{"type":"public","bandwidth_name":"cce-bandwidth-1551163379627","bandwidth_chargemode":"traffic","bandwidth_size":5,"bandwidth_sharetype":"PER","eip_type":"5_bgp","name":"james"}'
labels:
app: nginx
name: nginx
spec:
externalTrafficPolicy: Local
ports:
- name: service0
port: 80
protocol: TCP
targetPort: 80
selector:
app: nginx
type: LoadBalancer</pre>
</li><li id="cce_faq_00099__li556715613812">Using existing load balancer<pre class="screen" id="cce_faq_00099__screen11567066387">apiVersion: v1
kind: Service
metadata:
annotations:
kubernetes.io/elb.class: union
kubernetes.io/session-affinity-mode: SOURCE_IP
kubernetes.io/elb.id: 3c7caa5a-a641-4bff-801a-feace27424b6
kubernetes.io/elb.subnet-id: 5083f225-9bf8-48fa-9c8b-67bd9693c4c0
labels:
app: nginx
name: nginx
spec:
loadBalancerIP: 10.78.42.242
externalTrafficPolicy: Local
ports:
- name: service0
port: 80
protocol: TCP
targetPort: 80
selector:
app: nginx
type: LoadBalancer</pre>
</li></ul>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="cce_faq_00099__table1756816623818" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Key parameters</caption><thead align="left"><tr id="cce_faq_00099__row185681764384"><th align="left" class="cellrowborder" valign="top" width="34.28657134286571%" id="mcps1.3.3.2.2.2.7.2.4.1.1"><p id="cce_faq_00099__p1956846183813">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="14.118588141185882%" id="mcps1.3.3.2.2.2.7.2.4.1.2"><p id="cce_faq_00099__p65680613389">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="51.594840515948405%" id="mcps1.3.3.2.2.2.7.2.4.1.3"><p id="cce_faq_00099__p9568069386">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="cce_faq_00099__row1556817623815"><td class="cellrowborder" valign="top" width="34.28657134286571%" headers="mcps1.3.3.2.2.2.7.2.4.1.1 "><p id="cce_faq_00099__p20568669388">kubernetes.io/elb.class</p>
</td>
<td class="cellrowborder" valign="top" width="14.118588141185882%" headers="mcps1.3.3.2.2.2.7.2.4.1.2 "><p id="cce_faq_00099__p656812617387">String</p>
</td>
<td class="cellrowborder" valign="top" width="51.594840515948405%" headers="mcps1.3.3.2.2.2.7.2.4.1.3 "><p id="cce_faq_00099__p15568169382">Mandatory and must be set to <span class="uicontrol" id="cce_faq_00099__uicontrol1956876133814"><b>union</b></span> if an enhanced load balancer is in use.</p>
</td>
</tr>
<tr id="cce_faq_00099__row205681669387"><td class="cellrowborder" valign="top" width="34.28657134286571%" headers="mcps1.3.3.2.2.2.7.2.4.1.1 "><p id="cce_faq_00099__p756876143810">kubernetes.io/session-affinity-mode</p>
</td>
<td class="cellrowborder" valign="top" width="14.118588141185882%" headers="mcps1.3.3.2.2.2.7.2.4.1.2 "><p id="cce_faq_00099__p175681461388">String</p>
</td>
<td class="cellrowborder" valign="top" width="51.594840515948405%" headers="mcps1.3.3.2.2.2.7.2.4.1.3 "><p id="cce_faq_00099__p75681623817">Optional. If session stickness is enabled, add this parameter.</p>
<p id="cce_faq_00099__p65689616388">The value <strong id="cce_faq_00099__b1756818693818">SOURCE_IP</strong> indicates that listeners ensure session stickiness based on source IP addresses.</p>
</td>
</tr>
<tr id="cce_faq_00099__row9568961384"><td class="cellrowborder" valign="top" width="34.28657134286571%" headers="mcps1.3.3.2.2.2.7.2.4.1.1 "><p id="cce_faq_00099__p45696617387">kubernetes.io/elb.id</p>
</td>
<td class="cellrowborder" valign="top" width="14.118588141185882%" headers="mcps1.3.3.2.2.2.7.2.4.1.2 "><p id="cce_faq_00099__p15569116193818">String</p>
</td>
<td class="cellrowborder" valign="top" width="51.594840515948405%" headers="mcps1.3.3.2.2.2.7.2.4.1.3 "><p id="cce_faq_00099__p956910616386">Optional. This parameter is mandatory if an existing load balancer is used.</p>
<p id="cce_faq_00099__p14569126183813">It indicates the ID of an enhanced load balancer.</p>
</td>
</tr>
<tr id="cce_faq_00099__row1256996173815"><td class="cellrowborder" valign="top" width="34.28657134286571%" headers="mcps1.3.3.2.2.2.7.2.4.1.1 "><p id="cce_faq_00099__p1856966113810">kubernetes.io/elb.subnet-id</p>
</td>
<td class="cellrowborder" valign="top" width="14.118588141185882%" headers="mcps1.3.3.2.2.2.7.2.4.1.2 "><p id="cce_faq_00099__p205698683810">String</p>
</td>
<td class="cellrowborder" valign="top" width="51.594840515948405%" headers="mcps1.3.3.2.2.2.7.2.4.1.3 "><p id="cce_faq_00099__p165691364381">Optional. This parameter is mandatory only if a load balancer will be automatically created. For clusters of v1.11.7-r0 or later, this parameter can be left unspecified.</p>
</td>
</tr>
<tr id="cce_faq_00099__row1156996123817"><td class="cellrowborder" valign="top" width="34.28657134286571%" headers="mcps1.3.3.2.2.2.7.2.4.1.1 "><p id="cce_faq_00099__p65698614383">kubernetes.io/elb.enterpriseID</p>
</td>
<td class="cellrowborder" valign="top" width="14.118588141185882%" headers="mcps1.3.3.2.2.2.7.2.4.1.2 "><p id="cce_faq_00099__p75692653813">String</p>
</td>
<td class="cellrowborder" valign="top" width="51.594840515948405%" headers="mcps1.3.3.2.2.2.7.2.4.1.3 "><p id="cce_faq_00099__p956956173816">Optional. This parameter is mandatory if a public/private network load balancer will be automatically created.</p>
<p id="cce_faq_00099__p18569960381">This parameter indicates the name of the ELB enterprise project in which the ELB will be created.</p>
</td>
</tr>
<tr id="cce_faq_00099__row18569106123820"><td class="cellrowborder" valign="top" width="34.28657134286571%" headers="mcps1.3.3.2.2.2.7.2.4.1.1 "><p id="cce_faq_00099__p056915633818">kubernetes.io/elb.autocreate</p>
</td>
<td class="cellrowborder" valign="top" width="14.118588141185882%" headers="mcps1.3.3.2.2.2.7.2.4.1.2 "><p id="cce_faq_00099__p2569267388"><a href="#cce_faq_00099__table957018613817">elb.autocreate</a> object</p>
</td>
<td class="cellrowborder" valign="top" width="51.594840515948405%" headers="mcps1.3.3.2.2.2.7.2.4.1.3 "><p id="cce_faq_00099__p95697613811">Optional. This parameter is mandatory if a public network load balancer will be automatically created. The system will create an enhanced load balancer and an EIP. This parameter is also mandatory if a private network load balancer will be automatically created. The system will create an enhanced load balancer.</p>
<p id="cce_faq_00099__p15690663813"><strong id="cce_faq_00099__b95696653812">Example:</strong></p>
<ul id="cce_faq_00099__ul55694683814"><li id="cce_faq_00099__li18569186133817">Automatically created public network load balancer:<p id="cce_faq_00099__p7569136133819"><a name="cce_faq_00099__li18569186133817"></a><a name="li18569186133817"></a>{"type":"public","bandwidth_name":"cce-bandwidth-1551163379627","bandwidth_chargemode":"traffic","bandwidth_size":5,"bandwidth_sharetype":"PER","eip_type":"5_bgp","name":"james"}</p>
</li><li id="cce_faq_00099__li556996133812">Automatically created private network load balancer:<p id="cce_faq_00099__p18569196153818"><a name="cce_faq_00099__li556996133812"></a><a name="li556996133812"></a>{"type":"inner", "name": "A-location-d-test"}</p>
</li></ul>
</td>
</tr>
<tr id="cce_faq_00099__row75691869386"><td class="cellrowborder" valign="top" width="34.28657134286571%" headers="mcps1.3.3.2.2.2.7.2.4.1.1 "><p id="cce_faq_00099__p1156913616382">loadBalancerIP</p>
</td>
<td class="cellrowborder" valign="top" width="14.118588141185882%" headers="mcps1.3.3.2.2.2.7.2.4.1.2 "><p id="cce_faq_00099__p1956911663819">String</p>
</td>
<td class="cellrowborder" valign="top" width="51.594840515948405%" headers="mcps1.3.3.2.2.2.7.2.4.1.3 "><p id="cce_faq_00099__p85695653815">Private IP address of a private network load balancer or public IP address of a public network load balancer.</p>
</td>
</tr>
<tr id="cce_faq_00099__row1756911673817"><td class="cellrowborder" valign="top" width="34.28657134286571%" headers="mcps1.3.3.2.2.2.7.2.4.1.1 "><p id="cce_faq_00099__p556920616384">externalTrafficPolicy</p>
</td>
<td class="cellrowborder" valign="top" width="14.118588141185882%" headers="mcps1.3.3.2.2.2.7.2.4.1.2 "><p id="cce_faq_00099__p14570136193813">String</p>
</td>
<td class="cellrowborder" valign="top" width="51.594840515948405%" headers="mcps1.3.3.2.2.2.7.2.4.1.3 "><p id="cce_faq_00099__p14570969388">Optional. If session stickness is enabled, add this parameter so requests are transferred to a fixed node. If a LoadBalancer service with this parameter set to <strong id="cce_faq_00099__b0570063385">Local</strong> is created for a workload, the workload can be accessed only when the client is installed on the same node as the server.</p>
</td>
</tr>
<tr id="cce_faq_00099__row13570126103813"><td class="cellrowborder" valign="top" width="34.28657134286571%" headers="mcps1.3.3.2.2.2.7.2.4.1.1 "><p id="cce_faq_00099__p85700613810">port</p>
</td>
<td class="cellrowborder" valign="top" width="14.118588141185882%" headers="mcps1.3.3.2.2.2.7.2.4.1.2 "><p id="cce_faq_00099__p1057012614389">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="51.594840515948405%" headers="mcps1.3.3.2.2.2.7.2.4.1.3 "><p id="cce_faq_00099__p105704617386">Access port that is registered on the load balancer and mapped to the cluster-internal IP address.</p>
</td>
</tr>
<tr id="cce_faq_00099__row145704618381"><td class="cellrowborder" valign="top" width="34.28657134286571%" headers="mcps1.3.3.2.2.2.7.2.4.1.1 "><p id="cce_faq_00099__p157013613380">targetPort</p>
</td>
<td class="cellrowborder" valign="top" width="14.118588141185882%" headers="mcps1.3.3.2.2.2.7.2.4.1.2 "><p id="cce_faq_00099__p4570106183814">String</p>
</td>
<td class="cellrowborder" valign="top" width="51.594840515948405%" headers="mcps1.3.3.2.2.2.7.2.4.1.3 "><p id="cce_faq_00099__p45705673816">Container port on the CCE console.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="cce_faq_00099__table957018613817"></a><a name="table957018613817"></a><table cellpadding="4" cellspacing="0" summary="" id="cce_faq_00099__table957018613817" frame="border" border="1" rules="all"><caption><b>Table 2 </b>elb.autocreate parameters</caption><thead align="left"><tr id="cce_faq_00099__row185701673815"><th align="left" class="cellrowborder" valign="top" width="29.727027297270276%" id="mcps1.3.3.2.2.2.8.2.4.1.1"><p id="cce_faq_00099__p95708611389">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="18.678132186781323%" id="mcps1.3.3.2.2.2.8.2.4.1.2"><p id="cce_faq_00099__p3570162382">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="51.594840515948405%" id="mcps1.3.3.2.2.2.8.2.4.1.3"><p id="cce_faq_00099__p1257018623812">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="cce_faq_00099__row75705613388"><td class="cellrowborder" valign="top" width="29.727027297270276%" headers="mcps1.3.3.2.2.2.8.2.4.1.1 "><p id="cce_faq_00099__p1457013613388">name</p>
</td>
<td class="cellrowborder" valign="top" width="18.678132186781323%" headers="mcps1.3.3.2.2.2.8.2.4.1.2 "><p id="cce_faq_00099__p257166133817">String</p>
</td>
<td class="cellrowborder" valign="top" width="51.594840515948405%" headers="mcps1.3.3.2.2.2.8.2.4.1.3 "><p id="cce_faq_00099__p205711563381">Name of the load balancer that is automatically created.</p>
<p id="cce_faq_00099__p35711269383">The value is a string of 1 to 64 characters that consist of letters, digits, underscores (_), and hyphens (-).</p>
</td>
</tr>
<tr id="cce_faq_00099__row1957115693817"><td class="cellrowborder" valign="top" width="29.727027297270276%" headers="mcps1.3.3.2.2.2.8.2.4.1.1 "><p id="cce_faq_00099__p6571186193818">type</p>
</td>
<td class="cellrowborder" valign="top" width="18.678132186781323%" headers="mcps1.3.3.2.2.2.8.2.4.1.2 "><p id="cce_faq_00099__p2057114614383">String</p>
</td>
<td class="cellrowborder" valign="top" width="51.594840515948405%" headers="mcps1.3.3.2.2.2.8.2.4.1.3 "><p id="cce_faq_00099__p3571186173817">Network type of the load balancer.</p>
<ul id="cce_faq_00099__ul185711266384"><li id="cce_faq_00099__li25711633810"><strong id="cce_faq_00099__b1057146133817">public</strong>: public network load balancer.</li><li id="cce_faq_00099__li257119683815"><strong id="cce_faq_00099__b8571169389">inner</strong>: private network load balancer.</li></ul>
</td>
</tr>
<tr id="cce_faq_00099__row10571962388"><td class="cellrowborder" valign="top" width="29.727027297270276%" headers="mcps1.3.3.2.2.2.8.2.4.1.1 "><p id="cce_faq_00099__p657176133817">bandwidth_name</p>
</td>
<td class="cellrowborder" valign="top" width="18.678132186781323%" headers="mcps1.3.3.2.2.2.8.2.4.1.2 "><p id="cce_faq_00099__p155711268386">String</p>
</td>
<td class="cellrowborder" valign="top" width="51.594840515948405%" headers="mcps1.3.3.2.2.2.8.2.4.1.3 "><p id="cce_faq_00099__p7571967384">Bandwidth name. The default value is <strong id="cce_faq_00099__b11571106203819">cce-bandwidth-******</strong>.</p>
<p id="cce_faq_00099__p1757110643812">The value is a string of 1 to 64 characters that consist of letters, digits, underscores (_), hyphens (-), and periods (.).</p>
</td>
</tr>
<tr id="cce_faq_00099__row85712618386"><td class="cellrowborder" valign="top" width="29.727027297270276%" headers="mcps1.3.3.2.2.2.8.2.4.1.1 "><p id="cce_faq_00099__p11571061383">bandwidth_chargemode</p>
</td>
<td class="cellrowborder" valign="top" width="18.678132186781323%" headers="mcps1.3.3.2.2.2.8.2.4.1.2 "><p id="cce_faq_00099__p15571968380">String</p>
</td>
<td class="cellrowborder" valign="top" width="51.594840515948405%" headers="mcps1.3.3.2.2.2.8.2.4.1.3 "><p id="cce_faq_00099__p4571462386">Bandwidth billing mode.</p>
<p id="cce_faq_00099__p17993157195913">The value is <strong id="cce_faq_00099__b267410514014">traffic</strong>, indicating that the billing is based on traffic.</p>
</td>
</tr>
<tr id="cce_faq_00099__row1257166183813"><td class="cellrowborder" valign="top" width="29.727027297270276%" headers="mcps1.3.3.2.2.2.8.2.4.1.1 "><p id="cce_faq_00099__p1457217643813">bandwidth_size</p>
</td>
<td class="cellrowborder" valign="top" width="18.678132186781323%" headers="mcps1.3.3.2.2.2.8.2.4.1.2 "><p id="cce_faq_00099__p135729603817">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="51.594840515948405%" headers="mcps1.3.3.2.2.2.8.2.4.1.3 "><p id="cce_faq_00099__p057217613819">Bandwidth size. Set this parameter based on the bandwidth range supported by the region.</p>
</td>
</tr>
<tr id="cce_faq_00099__row75722061380"><td class="cellrowborder" valign="top" width="29.727027297270276%" headers="mcps1.3.3.2.2.2.8.2.4.1.1 "><p id="cce_faq_00099__p155726633810">bandwidth_sharetype</p>
</td>
<td class="cellrowborder" valign="top" width="18.678132186781323%" headers="mcps1.3.3.2.2.2.8.2.4.1.2 "><p id="cce_faq_00099__p7572196153815">String</p>
</td>
<td class="cellrowborder" valign="top" width="51.594840515948405%" headers="mcps1.3.3.2.2.2.8.2.4.1.3 "><p id="cce_faq_00099__p757220617386">Bandwidth sharing mode.</p>
<ul id="cce_faq_00099__ul1757217663812"><li id="cce_faq_00099__li557219615382"><strong id="cce_faq_00099__b857211615382">PER</strong>: dedicated bandwidth.</li><li id="cce_faq_00099__li95728653819"><strong id="cce_faq_00099__b857216693812">WHOLE</strong>: shared bandwidth.</li></ul>
</td>
</tr>
<tr id="cce_faq_00099__row35720615383"><td class="cellrowborder" valign="top" width="29.727027297270276%" headers="mcps1.3.3.2.2.2.8.2.4.1.1 "><p id="cce_faq_00099__p145721618380">eip_type</p>
</td>
<td class="cellrowborder" valign="top" width="18.678132186781323%" headers="mcps1.3.3.2.2.2.8.2.4.1.2 "><p id="cce_faq_00099__p18572368387">String</p>
</td>
<td class="cellrowborder" valign="top" width="51.594840515948405%" headers="mcps1.3.3.2.2.2.8.2.4.1.3 "><p id="cce_faq_00099__p1157366193818">EIP type.</p>
</td>
</tr>
</tbody>
</table>
</div>
</p></li><li id="cce_faq_00099__li14592533173814"><span>Create a workload.</span><p><p id="cce_faq_00099__p059273323813"><strong id="cce_faq_00099__b1259253320387">kubectl create -f nginx-deployment.yaml</strong></p>
<p id="cce_faq_00099__p759243312383">If information similar to the following is displayed, the workload is being created.</p>
<pre class="screen" id="cce_faq_00099__screen12592433123816">deployment "nginx" created</pre>
<p id="cce_faq_00099__p1659213343816"><strong id="cce_faq_00099__b45929337386">kubectl get po</strong></p>
<p id="cce_faq_00099__p8592183393819">If information similar to the following is displayed, the workload is running.</p>
<pre class="screen" id="cce_faq_00099__screen20592113311380">NAME READY STATUS RESTARTS AGE
etcd-0 0/1 ImagePullBackOff 0 1h
icagent-m9dkt 0/0 Running 0 3d
<strong id="cce_faq_00099__b12593163383810">nginx-2601814895-c1xhw 1/1 Running 0 6s</strong></pre>
</p></li><li id="cce_faq_00099__li3593033153812"><span>Create a service.</span><p><p id="cce_faq_00099__p1259343310386"><strong id="cce_faq_00099__b8593203319386">kubectl create -f nginx-elb-svc.yaml</strong></p>
<p id="cce_faq_00099__p459343393810">If information similar to the following is displayed, the service has been created.</p>
<pre class="screen" id="cce_faq_00099__screen125931233113817">service "nginx" created</pre>
<p id="cce_faq_00099__p195931133113818"><strong id="cce_faq_00099__b1359383319382">kubectl get svc</strong></p>
<p id="cce_faq_00099__p10593133317383">If information similar to the following is displayed, the service access type has been set successfully, and the workload is accessible.</p>
<pre class="screen" id="cce_faq_00099__screen559318331383">NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
etcd-svc ClusterIP None &lt;none&gt; 3120/TCP 1h
kubernetes ClusterIP 10.247.0.1 &lt;none&gt; 443/TCP 3d
<strong id="cce_faq_00099__b18593533123812">nginx LoadBalancer 10.247.130.196 10.78.42.242 80:31540/TCP 51s</strong></pre>
</p></li><li id="cce_faq_00099__li859353303819"><span>Enter the URL in the address box of the browser, for example, <strong id="cce_faq_00099__b1159363303816">10.78.42.242:31540</strong>. <strong id="cce_faq_00099__b135931334384">10.78.42.242</strong> indicates the IP address of the load balancer, and <strong id="cce_faq_00099__b14593833173814">31540</strong> indicates the access port displayed on the CCE console.</span></li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="cce_faq_0083.html">Reference</a></div>
</div>
</div>