Kubernetes cluster management

Updated at:

AppStack supports Kubernetes clusters from Alibaba Cloud Container Service for Kubernetes (ACK), other cloud providers, and self-managed environments. For ACK clusters, you can connect by authorizing Alibaba Cloud DevOps through a service connection. For other third-party or self-managed clusters, the cluster's API server must be publicly accessible. You can then connect to AppStack with the cluster's kubeconfig credentials.

Import an Alibaba Cloud ACK cluster

  • On the resource pool page, click Import Kubernetes cluster, and select Alibaba Cloud Container Service for Kubernetes (ACK).

  • When you import a cluster for the first time, you must authorize the service. Click Create service connection, then click Authorize on the service connection creation page. On the Cloud Resource Access Authorization page, click Agree to Authorization. Note: Wait for the authorization page to close automatically.

  • After authorization, the Alibaba Cloud DevOps access control role gains permission to access your resources in Alibaba Cloud Container Service. You can then view and select an available ACK cluster to import.

  • Enter a Resource Name. The resource name is the unique identifier for the cluster and cannot be changed after creation.

  • Enter a Resource Display Name. The resource display name is a user-friendly name for the cluster and can be changed after creation.

  • Click OK to import the ACK cluster into AppStack.

Import a generic Kubernetes cluster

  • On the resource pool page, click Import Cluster and select Import Kubernetes Cluster. AppStack accesses the cluster using its kubeconfig credentials.

  • Click Create kubeconfig and paste the content of your kubeconfig file into the input box. For instructions on how to generate a cluster kubeconfig file, see here.

  • Enter a Resource Name. The resource name is the unique identifier for the cluster and cannot be changed after creation.

  • Enter a Resource Display Name. The resource display name is a user-friendly name for the cluster and can be changed after creation.

  • Click OK to import the Kubernetes cluster into AppStack.

Note: Generic clusters currently support only Kubernetes version 1.16 or later. You must also ensure the cluster is accessible from the public internet. If you have an IP address whitelist, add the following Alibaba Cloud DevOps AppStack public IP addresses: 47.98.XXX.XX, 47.93.89.246, and 47.94.150.17. For more information, see Usage limits.

Connect to a private Kubernetes cluster

Note

Only an Alibaba Cloud DevOps region site can connect to a private Kubernetes cluster. The central Alibaba Cloud DevOps site can only access public Kubernetes clusters. Both ACK and generic Kubernetes clusters can be configured for private network access.

If your ACK cluster only allows access within a VPC, or your self-managed Kubernetes cluster provides only a private-network kubeconfig, you must use an Alibaba Cloud DevOps region site. Follow these steps to configure the connection:

  1. First, activate the VPC domain in the Alibaba Cloud DevOps console and add the reverse access IP address, which is the IP address of the Kubernetes cluster. For more information, see Network Settings.

  2. When importing an ACK or generic Kubernetes cluster, select the This cluster needs to be accessed through a VPC private network checkbox. Then, select the cluster's VPC and corresponding private IP address.

  3. Click Test Connection to verify connectivity to the Kubernetes cluster. If the test fails, you cannot use the cluster. Troubleshoot the issue based on the test results.

Kubernetes cluster agent installation

After importing a cluster, you can optionally install an agent. The agent provides fine-grained deployment controls, such as phased release.

  • Click Install Now to start the agent installation task in the cluster. The process typically takes 1 to 2 minutes.

    • If the agent installation fails, click View to check the logs and diagnose the issue. You can also click Reinstall to retry the installation.

    • After a successful installation, you can select the phased release strategy when deploying to an application environment. This strategy allows you to pause and resume deployments between batches.

  • If you click Handle Later, the agent will not be installed. You can then only use the native Kubernetes rolling update strategy for deployments. You can also manually trigger the installation later from the cluster details page.

Kubernetes cluster details

After you import a Kubernetes cluster, you are automatically redirected to the Kubernetes cluster details page. You can also navigate to this page from the Application Delivery AppStack

resource pool > Kubernetes cluster list. Find the target cluster and click it to open its details page. The page displays the cluster's basic information, pods, nodes, and deployment information. From here, you can install the agent, manage members, and perform other tasks.

  • Basic information

    • Resource Name

    • kubeconfig: The cluster's kubeconfig credentials. AppStack uses these credentials to connect to your cluster. Click View to see the credential details.

    • Agent: The installation status of the agent. Possible statuses are:

      • Not installed: Click Install to start the agent installation task.

      • Abnormal: Click View to check the agent installation logs and diagnose the problem. Click Reinstall to retry the installation.

      • Successful: Click View to see the agent installation logs or Reinstall to start a new installation. The agent status must be Successful to use the phased release strategy for deployments in associated application environments.

  • Deployment information

    • Deployed Applications: The total number of applications deployed on the current cluster.

    • Deployment Environments: The total number of environments deployed on the current cluster.

  • Pods

    • View information about the pods on the cluster, including Pod name, Status, Namespace, Pod IP, Node, and Creation time.

  • Nodes

    • View information about the cluster nodes, including Node name, Status, Pods (used/total), CPU (used/total) cores, and MEM (used/total) Mi.

  • Member management

    • Kubernetes clusters support member role and permission management. A cluster has two roles:

      • Administrator: Administrators have use, edit, and delete permissions. Administrators can modify basic cluster information, install the agent, associate the cluster with application environments, and delete the cluster.

      • User: Users have use permissions. When associating resources in an application environment, users can only select clusters for which they have User permissions or higher.

Kubernetes cluster monitoring

For Alibaba Cloud Container Service (ACK) clusters, AppStack integrates with ARMS Prometheus monitoring to track resource usage and health status. It also integrates with ARMS Kubernetes monitoring to observe network requests and build a cluster topology to help you visualize service dependencies.

Enable Prometheus monitoring

  • Method 1: Enable Prometheus monitoring from the AppStack resource pool page

    • On the resource pool page, navigate to your target cluster and click the Monitoring tab.

    • Click Install Now. After the installation is complete, click the different tabs to view the corresponding monitoring data.

  • Method 2: Enable Prometheus monitoring from the ACK console

Prometheus monitoring

  • On the resource pool page, navigate to your target cluster and click the Monitoring tab to view cluster monitoring data.

Enable Kubernetes monitoring

  • Method 1: Enable Kubernetes monitoring from the AppStack resource pool page

    • On the resource pool page, navigate to your target cluster and click the Cluster topology tab.

    • Click Install Now. After the installation is complete, click the different tabs to view the corresponding cluster topology data.

  • Method 2: Enable Kubernetes monitoring from the ACK or ARMS console

Kubernetes monitoring

  • On the resource pool page, navigate to your target cluster and click the Cluster topology tab to view service dependency information for applications deployed in the cluster.

Modifying a Kubernetes cluster

  • You can modify the display name of a Kubernetes cluster. Navigate to the Kubernetes cluster details page > More Operations > Modify K8s Cluster.

Removing a Kubernetes cluster

  • You can remove a Kubernetes cluster when it is no longer needed. Navigate to the Kubernetes cluster details page > More Operations > Delete K8s Cluster. Note: This action only unbinds the cluster from AppStack resource pool-Kubernetes cluster. It does not affect any resources on the cluster or delete the cluster itself.

Using a cluster for environment deployment

For more information, see Create an environment.