forked from docs/doc-exports
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>
53 lines
8.5 KiB
HTML
53 lines
8.5 KiB
HTML
<a name="kubernetesapi"></a><a name="kubernetesapi"></a>
|
|
|
|
<h1 class="topictitle1">Overview</h1>
|
|
<div id="body0000001355453942"><div class="section" id="kubernetesapi__section3701731155417"><h4 class="sectiontitle">Description</h4><p id="kubernetesapi__p155192037173414">You can use Kubernetes native APIs to manage your Kubernetes clusters. For details, see <a href="https://kubernetes.io/docs/reference/using-api/api-concepts/" target="_blank" rel="noopener noreferrer">Kubernetes API Concepts</a>.</p>
|
|
<p id="kubernetesapi__p966734320541">To find detailed API definitions for different Kubernetes versions, visit the following links:</p>
|
|
<ul id="kubernetesapi__ul163062345469"><li id="kubernetesapi__li730693444617">1.19: <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/" target="_blank" rel="noopener noreferrer">https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/</a></li><li id="kubernetesapi__li2277248144615">1.21: <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.21/" target="_blank" rel="noopener noreferrer">https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.21/</a></li><li id="kubernetesapi__li1151127194715">1.23: <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/" target="_blank" rel="noopener noreferrer">https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/</a></li></ul>
|
|
<p id="kubernetesapi__p16108214174613">Based on the open source Kubernetes APIs, CCE enhances and adapts following functions.</p>
|
|
<ul id="kubernetesapi__ul104771927155520"><li id="kubernetesapi__li20477202715511">Ingress: For details, see <a href="https://docs.otc.t-systems.com/en-us/usermanual2/cce/cce_01_0252.html" target="_blank" rel="noopener noreferrer">Using kubectl to Create an ELB Ingress</a>.</li><li id="kubernetesapi__li3402181935019">PV and PVC: For details, see <a href="https://docs.otc.t-systems.com/en-us/usermanual2/cce/cce_01_0379.html" target="_blank" rel="noopener noreferrer">PV</a> and <a href="https://docs.otc.t-systems.com/en-us/usermanual2/cce/cce_01_0378.html" target="_blank" rel="noopener noreferrer">PVC</a>.<ul id="kubernetesapi__ul1086971985015"><li id="kubernetesapi__li1477627165520">EVS: For details, see <a href="https://docs.otc.t-systems.com/en-us/usermanual2/cce/cce_01_0257.html" target="_blank" rel="noopener noreferrer">Creating a Pod Mounted with an EVS Volume</a>.</li><li id="kubernetesapi__li12263113011517">SFS Turbo: For details, see <a href="https://docs.otc.t-systems.com/en-us/usermanual2/cce/cce_01_0274.html" target="_blank" rel="noopener noreferrer">Creating a Deployment Mounted with an SFS Turbo Volume</a> and <a href="https://docs.otc.t-systems.com/en-us/usermanual2/cce/cce_01_0273.html" target="_blank" rel="noopener noreferrer">Creating a StatefulSet Mounted with an SFS Turbo Volume</a>.</li><li id="kubernetesapi__li916333445011">OBS: For details, see <a href="https://docs.otc.t-systems.com/en-us/usermanual2/cce/cce_01_0269.html" target="_blank" rel="noopener noreferrer">Creating a Deployment Mounted with an OBS Volume</a> and <a href="https://docs.otc.t-systems.com/en-us/usermanual2/cce/cce_01_0268.html" target="_blank" rel="noopener noreferrer">Creating a StatefulSet Mounted with an OBS Volume</a>.</li><li id="kubernetesapi__li1162512911544">SFS: For details, see <a href="https://docs.otc.t-systems.com/en-us/usermanual2/cce/cce_01_0263.html" target="_blank" rel="noopener noreferrer">Creating a Deployment Mounted with an SFS Volume</a> and <a href="https://docs.otc.t-systems.com/en-us/usermanual2/cce/cce_01_0262.html" target="_blank" rel="noopener noreferrer">Creating a StatefulSet Mounted with an SFS Volume</a>.</li></ul>
|
|
</li><li id="kubernetesapi__li8207150145715">Network Policies: For details, see <a href="https://docs.otc.t-systems.com/en-us/usermanual2/cce/cce_01_0059.html" target="_blank" rel="noopener noreferrer">Network Policies</a>.</li></ul>
|
|
</div>
|
|
<div class="section" id="kubernetesapi__section41207155509"><h4 class="sectiontitle">Calling Kubernetes APIs Through API Gateway</h4><p id="kubernetesapi__p1777710173595">You can call Kubernetes native APIs through API Gateway using the URL in the format of <strong id="kubernetesapi__b178956281620">https://{<em id="kubernetesapi__i33322331464">clusterid</em>}.Endpoint/<em id="kubernetesapi__i694334415612">uri</em></strong>. In the URL, <em id="kubernetesapi__i111421351869">{clusterid}</em> indicates the cluster ID, and <em id="kubernetesapi__i121431235169">uri</em> indicates the resource path, that is, the path for API access.</p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="kubernetesapi__table7272144324912" frame="border" border="1" rules="all"><caption><b>Table 1 </b>URL parameters</caption><thead align="left"><tr id="kubernetesapi__en-us_topic_0092901339_row12957510145518"><th align="left" class="cellrowborder" valign="top" width="24.529999999999998%" id="mcps1.3.2.3.2.3.1.1"><p id="kubernetesapi__en-us_topic_0092901339_p195751012559">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="75.47%" id="mcps1.3.2.3.2.3.1.2"><p id="kubernetesapi__en-us_topic_0092901339_p5957810135511">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="kubernetesapi__en-us_topic_0092901339_row12957210115515"><td class="cellrowborder" valign="top" width="24.529999999999998%" headers="mcps1.3.2.3.2.3.1.1 "><p id="kubernetesapi__en-us_topic_0092901339_p20957181010553">{clusterid}</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="75.47%" headers="mcps1.3.2.3.2.3.1.2 "><p id="kubernetesapi__en-us_topic_0092901339_p19571410195516">Cluster ID. After a cluster is created, call the <a href="cce_02_0239.html">API for obtaining a cluster in a specified project</a> to obtain the cluster ID.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="kubernetesapi__en-us_topic_0092901339_row195716107550"><td class="cellrowborder" valign="top" width="24.529999999999998%" headers="mcps1.3.2.3.2.3.1.1 "><p id="kubernetesapi__en-us_topic_0092901339_p119571610115515">Endpoint</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="75.47%" headers="mcps1.3.2.3.2.3.1.2 "><p id="kubernetesapi__en-us_topic_0092901339_p4957181017553">Web service entry URL. It can be obtained from <a href="https://docs.otc.t-systems.com/en-us/endpoint/index.html" target="_blank" rel="noopener noreferrer">Regions and Endpoints</a>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="kubernetesapi__en-us_topic_0092901339_row0957191065512"><td class="cellrowborder" valign="top" width="24.529999999999998%" headers="mcps1.3.2.3.2.3.1.1 "><p id="kubernetesapi__en-us_topic_0092901339_p179581410115511">uri</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="75.47%" headers="mcps1.3.2.3.2.3.1.2 "><p id="kubernetesapi__en-us_topic_0092901339_p149587102555">Path in which the resource requested by the API is located. You can obtain the path from the URI of the API.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="kubernetesapi__section14674391312"><h4 class="sectiontitle">Calling Kubernetes APIs Through the API Server</h4><p id="kubernetesapi__p1248519452209">You can use the API server of a Kubernetes cluster to call Kubernetes native APIs.</p>
|
|
<ol id="kubernetesapi__ol1420332061712"><li id="kubernetesapi__li1013775412177"><span>Call the <a href="cce_02_0248.html">API for obtaining the cluster certificate</a> to obtain the cluster certificates.</span><p><p id="kubernetesapi__p10926184211419">There are three certificates:</p>
|
|
<ul id="kubernetesapi__ul934641310465"><li id="kubernetesapi__li834691314620">ca.crt</li><li id="kubernetesapi__li8347413184614">client.crt</li><li id="kubernetesapi__li1434717138467">client.key</li></ul>
|
|
</p></li><li id="kubernetesapi__li14730103613179"><span>Go to the cluster details page and obtain the API server address (private or public network address).</span><p><p id="kubernetesapi__p16832192924218">With the certificates and API server address, you can call Kubernetes native APIs.</p>
|
|
<p id="kubernetesapi__p12832182918428">For example, if you run the <strong id="kubernetesapi__b1746719199136">curl</strong> command to call the API to view the pod information, you only need to carry the certificate in the command as follows:</p>
|
|
<p id="kubernetesapi__p15832182914425"><strong id="kubernetesapi__b16832829154216">curl --cert ./client.crt --key ./client.key https://192.168.0.198:5443</strong><strong id="kubernetesapi__b68321029134215">/api/v1/namespaces/default/pods/</strong></p>
|
|
</p></li></ol>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="cce_02_0340.html">Kubernetes APIs</a></div>
|
|
</div>
|
|
</div>
|
|
|