Use the Enterprise Distributed Application Service (EDAS) SDK for Java to import Kubernetes clusters into EDAS and cancel cluster imports programmatically. After import, EDAS provides application-level management, release strategies, microservice governance, and CI/CD integration on top of your existing Kubernetes infrastructure.
Prerequisites
Before you begin, make sure you have:
EDAS SDK for Java installed. See Use EDAS SDK for Java to call EDAS API
The region ID where your Kubernetes cluster is deployed (for example,
cn-hangzhou)A Kubernetes cluster created in the Container Service for Kubernetes (ACK) console:
ACK managed or ACK dedicated clusters. See Create a managed Kubernetes cluster or Create an ACK dedicated cluster
ACK Serverless clusters. See Create an ACK Serverless cluster
A microservice namespace. See Create a microservice namespace
If a cluster or namespace already exists, retrieve its ID by calling the corresponding API operation:
Cluster ID: Call GetK8sCluster and use the
ClusterIdvalue from the response.Namespace ID: Call ListUserDefineRegion and use the
RegionIdvalue from the response.
Supported cluster types
EDAS supports importing the following ACK cluster types:
ACK cluster type | EDAS cluster type after import |
ACK dedicated cluster | ACK cluster |
ACK managed cluster | ACK cluster |
ACK Serverless cluster | ACK Serverless cluster |
Hybrid cloud cluster (third-party or self-managed) | ACK cluster |
For a comparison of ACK cluster types, see What is ACK?
Register hybrid cloud clusters (Kubernetes clusters deployed on third-party clouds or self-managed clusters in data centers) in the ACK console before importing them to EDAS. See Create a cluster registration proxy and register a Kubernetes cluster.
What EDAS adds to Kubernetes
Importing a Kubernetes cluster into EDAS provides the following capabilities beyond standalone Kubernetes:
Capability | Description |
Application-level management | Manage Kubernetes workloads (deployments, pods) at the application level with cross-zone high-availability deployment |
Release strategies | Perform phased and canary releases based on traffic ratio or request parameters, with full change tracking |
CI/CD integration | Integrate with mainstream DevOps systems for continuous integration and delivery |
Microservice governance | Run Spring Cloud and Dubbo applications commercially available in the past five years without code changes. Includes graceful shutdown, stress testing during release, service authentication, throttling, degradation, outlier ejection, and service query and testing |
Production safety | Monitor releases end-to-end with release reports, configure canary release policies, and roll back with one click |
Import a Kubernetes cluster
Call the ImportK8sCluster operation to import a cluster into a specified microservice namespace.
Parameters
Parameter | Type | Required | Description |
| String | Yes | The ID of the Kubernetes cluster to import |
| String | Yes | The target microservice namespace (for example, |
| Boolean | No | Whether to install a service mesh. |
Sample code
Replace the following placeholders with your actual values:
Placeholder | Description | Example |
| Region ID where the cluster is deployed |
|
| Kubernetes cluster ID |
|
| Microservice namespace ID |
|
Sample response
Cancel a cluster import
Call the DeleteCluster operation to cancel a cluster import.
Parameters
Parameter | Type | Required | Description |
| String | Yes | The ID of the Kubernetes cluster to remove from EDAS |
Sample code
Sample response
A Data value of true confirms the import was canceled.
Verify the result
After importing or canceling a cluster import, call the GetK8sCluster operation and check the ClusterImportStatus field in the response.
Sample response
ClusterImportStatus values
Value | Status |
0 | Not imported |
1 | Imported |
2 | Import failed |
3 | Importing |
4 | Deleted |
To confirm a successful import, verify that ClusterImportStatus is 1. To confirm a canceled import, verify that ClusterImportStatus is 0.