Home / Platform management / Clusters / Clusters / Managing clusters

Managing clusters

You can refer to the contents of this article to update cluster tokens, oversell ratios, set up territories, manage clusters using the CLI tool, or delete clusters that are no longer used in the platform.

Update the access cluster token

The cluster that you access the platform may affect your normal use of the cluster if any of the following conditions occur, and you are advised to update the token for the cluster:

Note: Updating the token of a Self-built cluster is not supported.

Prerequisites

You have generated new tokens for the clusters to be updated. For assistance, please contact our operations engineers for support.

Procedure of operation

  1. In the left navigation bar, click Clusters > Cluster of clusters. 3.

  2. Click the Cluster name of the access cluster for which you want to update the token. 3.

  3. Click > Update Token in the upper right corner of the Basic Information area.

  4. Enter the new token.

  5. Click Update.

Update the overbooking ratio

The administrator sets the cluster oversale ratio with reference to the current resource requirements of CPU and memory in the cluster, which helps the administrator to limit the limit values (limit) and request values (request) of CPU and memory of containers set by the user to within a reasonable range and to improve the utilization rate of computing resources.

Note:

Prerequisites

Procedure of operation

  1. In the left navigation bar, click Clusters > Cluster of clusters

  2. Click Pending Update Oversale Ratio Cluster Name. 3.

  3. Click Update Oversale Ratio in the upper right corner of the Basic Information area. 4.

  4. Set the cluster oversell ratio for CPU and memory resources, only positive integers greater than 1 can be entered.

    By default, the cluster has no oversell ratio, and the switch status is as ; click to turn on the oversale ratio switch and the status is ,Then it means that the overselling ratio can be set.

  5. Click Update.

Setting the region

Setting the locale on the cluster and the nodes it belongs to allows you to configure policies for cross-domain loads for business traffic. Users can plan and manage the locale based on the planning of their own data centers.

Prerequisites

You have added a locale, please refer to Add Locale for details.

Cautions.

Procedure of operation

  1. In the left navigation bar, click Clusters > Cluster of clusters.

  2. Click Cluster Name in the upper right corner of the Basic Information area.

  3. Click Set Locale.

  4. Select the Geographic region.

  5. Click Setup.

    Hint: After you set the region for a cluster, the nodes under it will be synchronized with the topology.kubernetes.io/region: <region> tag, and the tagged values already stored on the node will be overwritten.

Opening the Kubectl tool

kubectl is a command-line tool for managing Kubernetes clusters. kubectl is a client of the Kubernetes API, which is an HTTP REST API that is the real Kubernetes user interface, and Kubernetes is completely controlled by this API, which means that This means that every Kubernetes operation is exposed as an API endpoint and can be executed by HTTP requests to this endpoint. Therefore, the main job of kubectl is to execute HTTP requests to the Kubernetes API, to manage the cluster, or to install and deploy containerized custom applications on the cluster.

Procedure of operation

  1. Click Clusters > Cluster of clusters in the left navigation bar.

  2. Click ! > CLI Tools.

  3. In the CLI tool interface, enter a command line that matches the Kubectl syntax to perform the relevant administrative operations.

Download kubeconfig file

A kubeconfig file is a configuration file that stores information about the connection between a client and a Kubernetes cluster, including the cluster address, authentication information, context information, and so on. See the official Kubernetes documentation Configuring Access to Multiple Clusters . ) for quick access to the Kubeconfig file.

Using kubeconfig files, you can easily manage different Kubernetes clusters and user identities, and interact with clusters on the local client. The platform supports self-built clusters and access to clusters to download kubeconfig files to meet different application scenarios of users.

Procedure of operation

  1. In the left navigation bar, click Clusters > Cluster of clusters.

  2. Click Cluster name. 4.

  3. Click Options > Download kubeconfig file and wait a few moments for the file to download locally from your browser.

Instructions:

  1. The kubeconfig file downloaded by the Platform has a default statute of limitations of 10 years.

  2. Each time you download a kubeconfig file it will be different, so to invalidate any kubeconfig files you have downloaded before that time, you can run the following command:

    Hint: After updating, all kubeconfig files downloaded before this will be invalidated.

    `` kubectl delete sa -n cpaas-system kubeconfig

  3. If you need to use the kubeconfig file for stricter permissions management, for example, if a user’s role only supports viewing Kubernetes resources, and you want kubeconfig to contain the same permissions as the user, you can configure it as follows:

    1. Click Personal Information after clicking Account Information on the right side of the top navigation bar.

    2. Click Add API Token, enter a description and adjust the expiration date, click Add and copy the API token.

    3. Using the kubeconfig file that you downloaded from the cluster page or a manually generated kubeconfig file as a template, replace the token value in the users field with the saved API token and modify other parameters, such as the cluster server address, as shown in the following kubeconfig file example:

    • kubeconfig file example:

      apiVersion: v1
      clusters:
        - cluster:
            server: https://{platform-access-address}/kubernetes/{cluster-name} # Need to modify {platform-access-address} {cluster-name}
            insecure-skip-tls-verify: true
          name: direct-cluster
      contexts:
        - context:
            cluster: direct-cluster
            user: kubeconfig-user
          name: direct-connect
      current-context: direct-connect
      kind: Config
      preferences: {}
      users:
        - name: kubeconfig-user
          user:
            token: {token}
      Parameter Description
      clusters Contains configuration information for one or more clusters, each including name, service address, authentication details, etc.
      users Contains configuration information for one or more users, each including name, authentication details, etc.
      contexts Contains configuration information for one or more contexts, each including name, associated cluster and user, etc.
      current-context Contains information about the currently used context.

Managing Container Groups

At the cluster level, Platform Management personnel need to regularly manage and maintain Pods across the entire cluster, monitoring the health and status of cluster Pods in real-time:

Procedure of Operation

  1. In the left navigation bar, click Clusters > Cluster of clusters.

  2. Click on the cluster name.

  3. Switch to the Pods tab to filter and view Pods.

  4. Click to export a CSV file containing a list of all Pods in the current cluster.

Deleting a Cluster

Remove a Kubernetes cluster that is no longer planned to be used through this Platform Management.

Note: If the cluster is being used by projects, after deleting the cluster, the projects will no longer be able to use it. Project resources under the cluster will be retained.

Procedure of Operation

  1. In the left navigation bar, click Clusters > Cluster of clusters.

  2. Click on the cluster to be deleted cluster name.

  3. Click on the right side of the cluster to be deleted > Delete.

  4. Enter the cluster name and click Delete.