forked from docs/doc-exports
Reviewed-by: Eotvos, Oliver <oliver.eotvos@t-systems.com> Co-authored-by: Dong, Qiu Jian <qiujiandong1@huawei.com> Co-committed-by: Dong, Qiu Jian <qiujiandong1@huawei.com>
38 lines
7.2 KiB
HTML
38 lines
7.2 KiB
HTML
<a name="cce_qs_0003"></a><a name="cce_qs_0003"></a>
|
|
|
|
<h1 class="topictitle1">Creating a Deployment (Nginx)</h1>
|
|
<div id="body1523431189176"><p id="cce_qs_0003__p19302172118175">You can use images to quickly create a single-pod workload that can be accessed from public networks. This section describes how to use CCE to quickly deploy an Nginx application and manage its lifecycle.</p>
|
|
<div class="section" id="cce_qs_0003__section12250663181"><h4 class="sectiontitle">Prerequisites</h4><p id="cce_qs_0003__p146677281947">You have created a CCE cluster that contains a node with 4 vCPUs and 8 GiB memory. The node is bound with an EIP.</p>
|
|
<p id="cce_qs_0003__p3897531842">A cluster is a logical group of cloud servers that run workloads. Each cloud server is a node in the cluster.</p>
|
|
<p id="cce_qs_0003__p196113618419">For details on how to create a cluster, see <a href="cce_qs_0008.html">Creating a Kubernetes Cluster</a>.</p>
|
|
</div>
|
|
<div class="section" id="cce_qs_0003__section18915182921212"><h4 class="sectiontitle">Nginx Overview</h4><p id="cce_qs_0003__p288664132416">Nginx is a lightweight web server. On CCE, you can quickly set up a Nginx web server.</p>
|
|
</div>
|
|
<p id="cce_qs_0003__p21473252210">This section uses the Nginx application as an example to describe how to create a workload. The creation takes about 5 minutes.</p>
|
|
<p id="cce_qs_0003__p1631217467325">After Nginx is created, you can access the Nginx web page.</p>
|
|
<div class="fignone" id="cce_qs_0003__fig14247183114337"><span class="figcap"><b>Figure 1 </b>Accessed the Nginx web page</span><br><span><img id="cce_qs_0003__image202481031183319" src="en-us_image_0000001751308206.png"></span></div>
|
|
<div class="section" id="cce_qs_0003__section13176115411313"><h4 class="sectiontitle">Creating Nginx on the CCE Console</h4><p id="cce_qs_0003__p105341412041">The following is the procedure for creating a containerized workload from a container image.</p>
|
|
<ol id="cce_qs_0003__ol19575164212915"><li id="cce_qs_0003__li2525844162213"><span>Log in to the CCE console.</span></li><li id="cce_qs_0003__li482679122317"><span>Click the name of the target cluster to access the cluster console.</span></li><li id="cce_qs_0003__li1885962692419"><span>In the navigation pane, choose <strong id="cce_qs_0003__b792118572410">Workloads</strong>. Then, click <strong id="cce_qs_0003__b1055407657">Create Workload</strong>.</span></li><li id="cce_qs_0003__li15350526133620"><span>Configure the following parameters and retain the default value for other parameters:</span><p><p id="cce_qs_0003__p725616141263"><strong id="cce_qs_0003__b7478173017514">Basic Info</strong></p>
|
|
<ul id="cce_qs_0003__ul163847572267"><li id="cce_qs_0003__li126242588262"><strong id="cce_qs_0003__b9385341552">Workload Type</strong>: Select <strong id="cce_qs_0003__b11398341659">Deployment</strong>.</li><li id="cce_qs_0003__li12178365273"><strong id="cce_qs_0003__b12377736756">Workload Name</strong>: Set it to <strong id="cce_qs_0003__b153782361356">nginx</strong>.</li><li id="cce_qs_0003__li1246627115510"><strong id="cce_qs_0003__b199886379173656">Namespace</strong>: Select <strong id="cce_qs_0003__b116337166073656">default</strong>.</li><li id="cce_qs_0003__li16652372271"><strong id="cce_qs_0003__b1680511423510">Pods</strong>: Set the quantity of pods to <strong id="cce_qs_0003__b1480674220519">1</strong>.</li></ul>
|
|
<p id="cce_qs_0003__p52831417122617"><strong id="cce_qs_0003__b14917201011618">Container Settings</strong></p>
|
|
<p id="cce_qs_0003__p18250104315111">Enter <strong id="cce_qs_0003__b57684574273656">nginx:latest</strong> in the <strong id="cce_qs_0003__b34144872273656">Image Name</strong> text box.</p>
|
|
<p id="cce_qs_0003__p124159208265"><strong id="cce_qs_0003__b717832651018">Service Settings</strong></p>
|
|
<p id="cce_qs_0003__p116910552322">Click the plus sign (+) to create a Service for accessing the workload from an external network. This example shows how to create a LoadBalancer. Configure the following parameters in the window that slides out from the right:</p>
|
|
<ul id="cce_qs_0003__ul998975223213"><li id="cce_qs_0003__li16262144343310"><strong id="cce_qs_0003__b116625791115">Service Name</strong>: Enter <strong id="cce_qs_0003__b966214712116">nginx</strong>. The name of the Service is exposed to external networks.</li><li id="cce_qs_0003__li7989135213219"><strong id="cce_qs_0003__b1316152241513">Service Type</strong>: Select <strong id="cce_qs_0003__b431632210159">LoadBalancer</strong>.</li><li id="cce_qs_0003__li198271412123413"><strong id="cce_qs_0003__b1058743013154">Service Affinity</strong>: Retain the default value.</li><li id="cce_qs_0003__li298975219322"><strong id="cce_qs_0003__b5696144493415">Load Balancer</strong>: If a load balancer is available, select an existing load balancer. If not, select <strong id="cce_qs_0003__b669716442345">Auto create</strong> to create one.</li><li id="cce_qs_0003__li1798975217321"><strong id="cce_qs_0003__b6125433191712">Ports</strong>:<ul id="cce_qs_0003__ul139893521326"><li id="cce_qs_0003__li1598915211322"><strong id="cce_qs_0003__b1554362111180">Protocol</strong>: Select <strong id="cce_qs_0003__b85447215182">TCP</strong>.</li><li id="cce_qs_0003__li811816144219"><strong id="cce_qs_0003__b0515103617180">Service Port</strong>: Set this parameter to <strong id="cce_qs_0003__b1251616367186">8080</strong>, which is mapped to the container port.</li><li id="cce_qs_0003__li13989175263211"><strong id="cce_qs_0003__b129341812181916">Container Port</strong>: port on which the application listens. For containers created using the nginx image, set this parameter to <strong id="cce_qs_0003__b893571241912">80</strong>. For other applications, set this parameter to the port of the application.</li></ul>
|
|
</li></ul>
|
|
</p></li><li id="cce_qs_0003__li151183363920"><span>Click <strong id="cce_qs_0003__b3259121216234">Create Workload</strong>.</span><p><p id="cce_qs_0003__p10133182724917">Wait until the workload is created.</p>
|
|
<p id="cce_qs_0003__p4295124231313">The created Deployment will be displayed on the <strong id="cce_qs_0003__b612755192311">Deployments</strong> tab.</p>
|
|
</p></li></ol>
|
|
</div>
|
|
<div class="section" id="cce_qs_0003__section742084320481"><h4 class="sectiontitle">Accessing Nginx</h4><ol id="cce_qs_0003__ol99181823490"><li id="cce_qs_0003__li16918122124912"><span>Obtain the external access address of Nginx.</span><p><p id="cce_qs_0003__p122031215155615">Click the Nginx workload name to enter its details page. On the page displayed, click the <span class="uicontrol" id="cce_qs_0003__uicontrol41961357194210"><b>Access Mode</b></span> tab, view the IP address of Nginx. The public IP address is the external access address.</p>
|
|
</p></li><li id="cce_qs_0003__li1891817224917"><span>Enter the <strong id="cce_qs_0003__b9679111116324">external access address</strong> in the address box of a browser. The following shows the welcome page if you successfully access the workload.</span><p><div class="fignone" id="cce_qs_0003__fig15608115604817"><span class="figcap"><b>Figure 2 </b>Accessing Nginx</span><br><span><img id="cce_qs_0003__image86081056164816" src="en-us_image_0000001798307901.png"></span></div>
|
|
</p></li></ol>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="cce_qs_0000.html">Getting Started</a></div>
|
|
</div>
|
|
</div>
|
|
|