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>
85 lines
22 KiB
HTML
85 lines
22 KiB
HTML
<a name="ucs_01_0255"></a><a name="ucs_01_0255"></a>
|
||
|
||
<h1 class="topictitle1">Deployments</h1>
|
||
<div id="body0000001554365993"><p id="ucs_01_0255__p889918465207">The federation function of UCS allows you to manage Kubernetes clusters in different regions or clouds, deploy applications globally in a unified manner, and deploy different workloads, such as <span class="keyword" id="ucs_01_0255__keyword42909359537">Deployments</span>, <span class="keyword" id="ucs_01_0255__keyword10290163514535">StatefulSets</span>, and <span class="keyword" id="ucs_01_0255__keyword122901635115314">DaemonSets</span>, to clusters in a federation.</p>
|
||
<p id="ucs_01_0255__p57281152224">Deployments are a type of workloads that do not store any data or status while running. An example of this is Nginx. You can create a Deployment using the console or kubectl.</p>
|
||
<div class="section" id="ucs_01_0255__section146991320135316"><a name="ucs_01_0255__section146991320135316"></a><a name="section146991320135316"></a><h4 class="sectiontitle">Creating a Deployment</h4><ol id="ucs_01_0255__ol9779152341112"><li id="ucs_01_0255__li135792781317"><span>Log in to the UCS console. In the navigation pane, choose <span class="uicontrol" id="ucs_01_0255__uicontrol1243119359564"><b>Fleets</b></span>.</span></li><li id="ucs_01_0255__li1175242111413"><span>On the <span class="uicontrol" id="ucs_01_0255__uicontrol7972195055517"><b>Fleets</b></span> tab, click the name of the federation-enabled fleet to access its details page.</span></li><li id="ucs_01_0255__li1973241542611"><span>In the navigation pane, choose <strong id="ucs_01_0255__b291613410196">Workloads</strong>. On the displayed page, click the <strong id="ucs_01_0255__b16916144191910">Deployments</strong> tab. Then, click <strong id="ucs_01_0255__b1691634181916">Create from Image</strong>.</span><p><div class="note" id="ucs_01_0255__note21561251164814"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="ucs_01_0255__p1823510218585">To use an existing YAML file to create a Deployment, click <strong id="ucs_01_0255__b92801539102512">Create from YAML</strong> in the upper right corner.</p>
|
||
</div></div>
|
||
</p></li><li id="ucs_01_0255__li103977351127"><span>Configure basic information about the workload.</span><p><ul id="ucs_01_0255__ul116719437351"><li id="ucs_01_0255__li41671143143516"><strong id="ucs_01_0255__b166611738144515">Type</strong>: Select <span class="uicontrol" id="ucs_01_0255__uicontrol7668638164512"><b>Deployment</b></span>.</li><li id="ucs_01_0255__li31671543163514"><strong id="ucs_01_0255__b171651344114513">Name</strong>: name of the workload, which must be unique.</li><li id="ucs_01_0255__li7167134319358"><strong id="ucs_01_0255__b33171590456">Namespace</strong>: namespace that the workload belongs to. For details about how to create a namespace, see <a href="ucs_01_0281.html#ucs_01_0281__section20381629121511">Creating a Namespace</a>.</li><li id="ucs_01_0255__li53122563115"><strong id="ucs_01_0255__b867519915469">Description</strong>: description of the workload.</li><li id="ucs_01_0255__li9167174312355"><strong id="ucs_01_0255__b97481512144615">Pods</strong>: number of pods in each cluster of the multi-cluster workload. The default value is <strong id="ucs_01_0255__b510910203462">2</strong>. Each workload pod consists of the same containers. On UCS, you can set an auto scaling policy to dynamically adjust the number of workload pods based on the workload resource usage.</li></ul>
|
||
</p></li><li id="ucs_01_0255__li102351132171611"><a name="ucs_01_0255__li102351132171611"></a><a name="li102351132171611"></a><span>Configure the container settings for the workload.</span><p><p id="ucs_01_0255__p1349643241618">Multiple containers can be configured in a pod. You can click <span class="uicontrol" id="ucs_01_0255__uicontrol6211065486"><b>Add Container</b></span> on the right to configure multiple containers for the pod.</p>
|
||
<p id="ucs_01_0255__p514715446188"></p>
|
||
<ul id="ucs_01_0255__ul17496832191619"><li id="ucs_01_0255__li124961732141613"><strong id="ucs_01_0255__b2671183035314">Basic Info</strong>
|
||
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ucs_01_0255__table6496632151617" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Basic information parameters</caption><thead align="left"><tr id="ucs_01_0255__row15493183281617"><th align="left" class="cellrowborder" valign="top" width="23%" id="mcps1.3.3.2.5.2.3.1.2.2.3.1.1"><p id="ucs_01_0255__p1549353221618">Parameter</p>
|
||
</th>
|
||
<th align="left" class="cellrowborder" valign="top" width="77%" id="mcps1.3.3.2.5.2.3.1.2.2.3.1.2"><p id="ucs_01_0255__p14937329164">Description</p>
|
||
</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody><tr id="ucs_01_0255__row54941932171614"><td class="cellrowborder" valign="top" width="23%" headers="mcps1.3.3.2.5.2.3.1.2.2.3.1.1 "><p id="ucs_01_0255__p44946321163">Container Name</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="77%" headers="mcps1.3.3.2.5.2.3.1.2.2.3.1.2 "><p id="ucs_01_0255__p149416326161">Name the container.</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="ucs_01_0255__row1449443241617"><td class="cellrowborder" valign="top" width="23%" headers="mcps1.3.3.2.5.2.3.1.2.2.3.1.1 "><p id="ucs_01_0255__p1349419328168">Image Name</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="77%" headers="mcps1.3.3.2.5.2.3.1.2.2.3.1.2 "><div class="p" id="ucs_01_0255__p18494133231611">Click <strong id="ucs_01_0255__b12121112618547">Select Image</strong> and select the image used by the container.<ul id="ucs_01_0255__ul15662111472614"><li id="ucs_01_0255__li949416327167"><strong id="ucs_01_0255__b207656717112">My Images</strong>: images in the image repository of the current region. If no images are available, click <strong id="ucs_01_0255__b179741213315">Upload Image</strong>.</li><li id="ucs_01_0255__li15494193251617"><strong id="ucs_01_0255__b178236313511">Open Source Images</strong>: official images in the open source image repository.</li><li id="ucs_01_0255__li8494832201619"><strong id="ucs_01_0255__b59439550311032">Shared Images</strong>: private images shared by another account. For details, see <a href="https://docs.otc.t-systems.com/software-repository-container/umn/image_management/sharing_private_images.html#swr-01-0026" target="_blank" rel="noopener noreferrer">Sharing Private Images</a>.</li></ul>
|
||
</div>
|
||
</td>
|
||
</tr>
|
||
<tr id="ucs_01_0255__row114951332161616"><td class="cellrowborder" valign="top" width="23%" headers="mcps1.3.3.2.5.2.3.1.2.2.3.1.1 "><p id="ucs_01_0255__p1949420327167">Image Tag</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="77%" headers="mcps1.3.3.2.5.2.3.1.2.2.3.1.2 "><p id="ucs_01_0255__p849593214168">Select the image tag to be deployed.</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="ucs_01_0255__row94953325166"><td class="cellrowborder" valign="top" width="23%" headers="mcps1.3.3.2.5.2.3.1.2.2.3.1.1 "><p id="ucs_01_0255__p4495932171617">Pull Policy</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="77%" headers="mcps1.3.3.2.5.2.3.1.2.2.3.1.2 "><p id="ucs_01_0255__p6495132201614">Image update or pull policy. If you select <strong id="ucs_01_0255__b18377127151517">Always</strong>, the image is pulled from the image repository each time. If you do not select <strong id="ucs_01_0255__b3383202716157">Always</strong>, the existing image of the node is preferentially used. If the image does not exist in the node, it is pulled from the image repository.</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="ucs_01_0255__row949513322166"><td class="cellrowborder" valign="top" width="23%" headers="mcps1.3.3.2.5.2.3.1.2.2.3.1.1 "><p id="ucs_01_0255__p16495153211617">CPU Quota</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="77%" headers="mcps1.3.3.2.5.2.3.1.2.2.3.1.2 "><ul id="ucs_01_0255__ul124951132141619"><li id="ucs_01_0255__li11495173271613"><strong id="ucs_01_0255__b51271551171616">Request</strong>: minimum number of CPU cores required by a container. The default value is 0.25 cores.</li><li id="ucs_01_0255__li749511321166"><strong id="ucs_01_0255__b74886714173">Limit</strong>: maximum number of CPU cores available for a container. Do not leave <strong id="ucs_01_0255__b18394627142214">Limit</strong> unspecified. Otherwise, intensive use of container resources will occur and your workload may exhibit unexpected behavior.</li></ul>
|
||
</td>
|
||
</tr>
|
||
<tr id="ucs_01_0255__row8495332131612"><td class="cellrowborder" valign="top" width="23%" headers="mcps1.3.3.2.5.2.3.1.2.2.3.1.1 "><p id="ucs_01_0255__p1549503210167">Memory Quota</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="77%" headers="mcps1.3.3.2.5.2.3.1.2.2.3.1.2 "><ul id="ucs_01_0255__ul13495183214164"><li id="ucs_01_0255__li13495632181612"><strong id="ucs_01_0255__b54062132411">Request</strong>: minimum amount of memory required by a container. The default value is 512 MiB.</li><li id="ucs_01_0255__li1149573219162"><strong id="ucs_01_0255__b66481728192410">Limit</strong>: maximum amount of memory available for a container. When memory usage exceeds the specified memory limit, the container will be terminated.</li></ul>
|
||
<p id="ucs_01_0255__p17495932151616">For details about <strong id="ucs_01_0255__b15805565253">Request</strong> and <strong id="ucs_01_0255__b092614592611">Limit</strong> of CPU or memory, see <a href="ucs_01_0260.html">Setting Container Specifications</a>.</p>
|
||
</td>
|
||
</tr>
|
||
<tr id="ucs_01_0255__row6496153291617"><td class="cellrowborder" valign="top" width="23%" headers="mcps1.3.3.2.5.2.3.1.2.2.3.1.1 "><p id="ucs_01_0255__p144951732161620">Init Container</p>
|
||
</td>
|
||
<td class="cellrowborder" valign="top" width="77%" headers="mcps1.3.3.2.5.2.3.1.2.2.3.1.2 "><p id="ucs_01_0255__p15495183221618">Select whether to use the container as an init container.</p>
|
||
<p id="ucs_01_0255__p1749612322164">An init container is a special container that runs before app containers in a pod. For details, see <a href="https://kubernetes.io/docs/concepts/workloads/pods/init-containers/" target="_blank" rel="noopener noreferrer">Init Containers</a>.</p>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</li><li id="ucs_01_0255__li18496143251618"><strong id="ucs_01_0255__b19143341203710">Lifecycle</strong>: The lifecycle callback functions can be called in specific phases of the container. For example, if you want the container to perform a certain operation before stopping, set the corresponding function. Currently, lifecycle callback functions, such as <span class="keyword" id="ucs_01_0255__keyword8267142172114">startup</span>, <span class="keyword" id="ucs_01_0255__keyword82671921192112">post-start</span>, and <span class="keyword" id="ucs_01_0255__keyword0267521192112">pre-stop</span> are provided. For details, see <a href="ucs_01_0261.html">Setting Container Lifecycle Parameters</a>.</li><li id="ucs_01_0255__li184967327169"><strong id="ucs_01_0255__b108091521481">Health Check</strong>: Set health check parameters to periodically check the health status of the container during container running. For details, see <a href="ucs_01_0262.html">Setting Health Check for a Container</a>.</li><li id="ucs_01_0255__li1496153217163"><strong id="ucs_01_0255__b1430585111613">Environment Variable</strong>: Environment variables affect the way a running container will behave. Configuration items set by environment variables will not change if the pod lifecycle ends. For details, see <a href="ucs_01_0263.html">Setting Environment Variables</a>.</li><li id="ucs_01_0255__li17496203271612"><strong id="ucs_01_0255__b10451133125215">Data Storage</strong>: Store container data using <strong id="ucs_01_0255__b448141335310">Local Volumes</strong> and <strong id="ucs_01_0255__b17659555115320">PersistentVolumeClaims (PVCs)</strong>. You are advised to use PVCs to store workload pod data on a cloud volume. If you store pod data on a local volume and a fault occurs on the node, the data cannot be restored. For details about container storage, see <a href="ucs_01_0276.html">Storage</a>.</li><li id="ucs_01_0255__li12496832181610"><strong id="ucs_01_0255__b068711215223">Security Context</strong>: Set container permissions to protect the system and other containers from being affected. Enter a user ID and the container will run with the user permissions you specify.</li></ul>
|
||
<ul id="ucs_01_0255__ul34967321160"><li id="ucs_01_0255__li1449653291613"><strong id="ucs_01_0255__b138980362519">Image Access Credential</strong>: Select the credential for accessing the image repository. This credential is used only for accessing a private image repository. If the selected image is a public image, you do not need to select a secret. For details on how to create a secret, see <a href="ucs_01_0268.html#ucs_01_0268__section129181141173214">Creating a Secret</a>.</li></ul>
|
||
</p></li><li id="ucs_01_0255__li66041547161"><span>(Optional) Click <span><img id="ucs_01_0255__image2992536141818" src="en-us_image_0000001554286565.png"></span> in the <strong id="ucs_01_0255__b175343422588">Service Settings</strong> area to configure a Service for the workload.</span><p><p id="ucs_01_0255__p16549542164">If your workload will be reachable to other workloads or public networks, add a Service to define the workload access type. The workload access type determines the network attributes of the workload. Workloads with different access types can provide different network capabilities. For details, see <a href="ucs_01_0269.html">Services and Ingresses</a>.</p>
|
||
<p id="ucs_01_0255__p126541354111616">You can also create a Service after creating a workload. For details, see <a href="ucs_01_0271.html">ClusterIP</a> and <a href="ucs_01_0272.html">NodePort</a>.</p>
|
||
<ul id="ucs_01_0255__ul16654125491616"><li id="ucs_01_0255__li17816191012341"><strong id="ucs_01_0255__b330395812190">Name</strong>: name of the Service to be added. It is customizable and must be unique.</li><li id="ucs_01_0255__li11711139341"><strong id="ucs_01_0255__b29879356543133">Type</strong><ul id="ucs_01_0255__ul1131422123418"><li id="ucs_01_0255__li965455471618"><strong id="ucs_01_0255__b1545815510218">ClusterIP</strong>: The Service is only reachable from within the cluster.</li><li id="ucs_01_0255__li565410548166"><strong id="ucs_01_0255__b118166117226">NodePort</strong>: The Service can be accessed from any node in the cluster.</li></ul>
|
||
</li><li id="ucs_01_0255__li1124414713616"><strong id="ucs_01_0255__b529612153518">Affinity</strong> (for node access only)<ul id="ucs_01_0255__ul20813557153920"><li id="ucs_01_0255__li933485711396"><strong id="ucs_01_0255__b5658175311713">Cluster-level</strong>: The IP addresses and access ports of all nodes in a cluster can be used to access the workloads associated with the Service. However, performance loss is introduced due to hops, and source IP addresses cannot be obtained.</li><li id="ucs_01_0255__li202984322404"><strong id="ucs_01_0255__b19161101124819">Node-level</strong>: Only the IP address and access port of the node where the workload is located can be used to access the workload associated with the Service. Service access will not cause performance loss due to route redirection, and the source IP address of the client can be obtained.</li></ul>
|
||
</li><li id="ucs_01_0255__li355492917345"><strong id="ucs_01_0255__b1712414113403">Port</strong><ul id="ucs_01_0255__ul9262141163412"><li id="ucs_01_0255__li25641447141"><strong id="ucs_01_0255__b2041245564511">Protocol</strong>: Select <strong id="ucs_01_0255__b13412105534514">TCP</strong> or <strong id="ucs_01_0255__b4412105544519">UDP</strong>.</li><li id="ucs_01_0255__li1018433010388"><strong id="ucs_01_0255__b797143984815">Service Port</strong>: Port mapped to the container port at the cluster-internal IP address. The application can be accessed at <<em id="ucs_01_0255__i715234874912">cluster-internal IP address</em>>:<<em id="ucs_01_0255__i1528951104911">access port</em>>. The port number range is 1–65535.</li><li id="ucs_01_0255__li142471635131918"><strong id="ucs_01_0255__b79216591851">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><li id="ucs_01_0255__li419736201616"><strong id="ucs_01_0255__b1154654351319">Node Port</strong> (for NodePort only): Port to which the container port will be mapped when the node private IP address is used for accessing the application. The port number ranges from <strong id="ucs_01_0255__b5988173963617">30000</strong> to <strong id="ucs_01_0255__b17630043153613">32767</strong>. You are advised to select <strong id="ucs_01_0255__b655216435136">Auto</strong>.<ul id="ucs_01_0255__ul12255617963"><li id="ucs_01_0255__li537910611618"><strong id="ucs_01_0255__b62599304343133">Auto</strong>: The system automatically assigns a port number.</li><li id="ucs_01_0255__li7962160113720"><strong id="ucs_01_0255__b40759720043133">Custom</strong>: Specify a fixed node port. The port number ranges from <strong id="ucs_01_0255__b1214716295378">30000</strong> to <strong id="ucs_01_0255__b131711833193718">32767</strong>. Ensure that the port is unique in a cluster.</li></ul>
|
||
</li></ul>
|
||
</li></ul>
|
||
</p></li><li id="ucs_01_0255__li172605871711"><span>(Optional) Click <span class="uicontrol" id="ucs_01_0255__uicontrol634955415813"><b>Expand</b></span> to set advanced settings for the workload.</span><p><ul id="ucs_01_0255__ul1965505491611"><li id="ucs_01_0255__li10655115416169"><strong id="ucs_01_0255__b314258125912">Upgrade</strong>: upgrade mode of the Deployment, including <strong id="ucs_01_0255__b17149485599">Replace upgrade</strong> and <strong id="ucs_01_0255__b1514917815910">Rolling upgrade</strong>. For details, see <a href="ucs_01_0264.html">Configuring a Workload Upgrade Policy</a>.<ul id="ucs_01_0255__ul176550546160"><li id="ucs_01_0255__li66556543166"><strong id="ucs_01_0255__b65402033105916">Rolling upgrade</strong>: An old pod is gradually replaced with a new pod. During the upgrade, service traffic is evenly distributed to the old and new pods to ensure service continuity.</li><li id="ucs_01_0255__li1065555418169"><span class="parmvalue" id="ucs_01_0255__parmvalue158703217418"><b>Replace upgrade</b></span>: Old pods are deleted before new pods are created. Services will be interrupted during a replace upgrade.</li></ul>
|
||
</li><li id="ucs_01_0255__li265515541162"><strong id="ucs_01_0255__b10394182212914">Scheduling</strong>: You can set affinity and anti-affinity to implement planned scheduling for pods. For details, see <a href="ucs_01_0265.html">Configuring a Scheduling Policy (Affinity/Anti-affinity)</a>.</li><li id="ucs_01_0255__li19655105431615"><strong id="ucs_01_0255__b15419814679">Labels and Annotations</strong>: You can click <span class="uicontrol" id="ucs_01_0255__uicontrol54198141772"><b>Confirm</b></span> to add a label or annotation for the pod. The key of the new label or annotation cannot be the same as that of an existing one.</li><li id="ucs_01_0255__li865595401619"><strong id="ucs_01_0255__b953895017108">Toleration</strong>: When the node where the workload pods are located is unavailable for the specified amount of time, the pods will be rescheduled to other available nodes. By default, the toleration time window is 300s.</li></ul>
|
||
</p></li><li id="ucs_01_0255__li167215314916"><span>Click <span class="uicontrol" id="ucs_01_0255__uicontrol569416539468"><b>Next: Scheduling and Differentiation</b></span>. After selecting clusters to which the workload can be scheduled, configure the differentiated settings for the containers.</span><p><ul id="ucs_01_0255__ul1677648195211"><li id="ucs_01_0255__li135891650162618"><strong id="ucs_01_0255__b13777599453">Scheduling Policy</strong><ul id="ucs_01_0255__ul142971854112616"><li id="ucs_01_0255__li921534615813"><strong id="ucs_01_0255__b203611424617">Scheduling Mode</strong><ul id="ucs_01_0255__ul4908204817584"><li id="ucs_01_0255__li6774487526"><strong id="ucs_01_0255__b1455511812252">Weight</strong>: Manually set the weight of each cluster. The number of pods in each cluster is allocated based on the configured weight.</li><li id="ucs_01_0255__li16771848125213"><strong id="ucs_01_0255__b1746205014298">Auto balancing</strong>: The workload is automatically deployed in the selected clusters based on available resources.</li></ul>
|
||
</li><li id="ucs_01_0255__li1334939165810"><strong id="ucs_01_0255__b36457445348">Cluster</strong>: Select clusters to which the workload can be scheduled. The number of clusters depends on your service requirements.<ul id="ucs_01_0255__ul1838583618596"><li id="ucs_01_0255__li147161935135920">If you use cluster weighted scheduling, you need to manually set the weight of each cluster. If you set the weight of a cluster to a value other than <strong id="ucs_01_0255__b14742242204111">0</strong>, the cluster is automatically selected as a cluster to which the workload can be scheduled. If you set it to <strong id="ucs_01_0255__b161341024164010">0</strong>, the workload will not be scheduled to the cluster. Weights cannot be set for clusters in abnormal state.</li><li id="ucs_01_0255__li1939734403">If you use auto scaling, you can click a cluster to select it as a cluster to which the workload can be scheduled.</li></ul>
|
||
</li></ul>
|
||
</li><li id="ucs_01_0255__li4622161132717"><strong id="ucs_01_0255__b55355561414">Differentiated Settings</strong><p id="ucs_01_0255__p846031182617">When deploying a workload in multiple clusters, you can configure differentiated settings for these clusters. Click <span><img id="ucs_01_0255__image1363016352307" src="en-us_image_0000001503446844.png"></span> in the upper right corner of a target cluster to configure differentiated settings. The configured differentiated container settings take effect only for this cluster.</p>
|
||
<p id="ucs_01_0255__p4200131463210">For parameter description, see <a href="#ucs_01_0255__li102351132171611">Container Settings</a>.</p>
|
||
</li></ul>
|
||
</p></li><li id="ucs_01_0255__li179020469190"><span>After completing the settings, click <span class="uicontrol" id="ucs_01_0255__uicontrol910242519140"><b>Create Workload</b></span>, then you can click <strong id="ucs_01_0255__b1204192316158">Back to Workload List</strong> to view the created workload.</span></li></ol>
|
||
</div>
|
||
</div>
|
||
<div>
|
||
<div class="familylinks">
|
||
<div class="parentlink"><strong>Parent topic:</strong> <a href="ucs_01_0406.html">Workload Creation</a></div>
|
||
</div>
|
||
</div>
|
||
|