Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ Ubiquitous Cloud Native Service/ Getting Started/ Quickly Connecting an Attached Cluster

Quickly Connecting an Attached Cluster

Updated on 2023-04-12 GMT+08:00

UCS supports registration of Huawei Cloud clusters, local clusters, and attached clusters. This section uses attached clusters as an example to describe how to quickly connect a Kubernetes cluster to UCS through public network access.

NOTICE:
  • If you are connecting a cluster located outside China to UCS, ensure that this connection and the subsequent actions you will take comply with the local laws and regulations.
  • Ensure that the registered cluster is a Kubernetes cluster that has passed the CNCF Certified Kubernetes Conformance Program and its version is 1.19 or later.

Obtaining kubeconfig

  1. Log in to the master node in the cluster to be connected.
  2. Obtain the cluster kubeconfig file.

    cat $HOME/.kube/config

    By default, the kubeconfig file of a self-built cluster is stored in the $HOME/.kube/config directory of the master node. If another kubeconfig file is specified for your cluster, change the directory. For details about the kubeconfig file, see Organizing Cluster Access Using kubeconfig Files.

  3. Copy the credential content.
  4. Create a YAML file on the local PC, paste the credential content copied in the previous step to the file, and save the file.

Creating a Fleet

  1. Log in to the UCS console. In the navigation pane, choose Fleets. On the Fleets tab page, click Create Fleet.
  2. Enter the fleet information, as shown in Figure 1.

    Figure 1 Creating a fleet
    • Fleet Name: Enter a name, starting with a lowercase letter and not ending with a hyphen (-). Only lowercase letters, digits, and hyphens (-) are allowed.
    • Add Cluster: If you do not select a cluster, an empty fleet will be created. After the fleet is created, add the cluster to the fleet by referring to Registering a Cluster.
    • Description: description of the fleet to which the cluster is added

  3. Click OK.

Registering a Cluster

  1. Log in to the UCS console. In the navigation pane, choose Fleets.
  2. Click the Register Cluster button in the card view of the target attached cluster.
  3. Select a cluster service provider and set cluster parameters as prompted. In this example, only key parameters listed in Table 1 are set.

    Table 1 Parameters for connecting a cluster

    Parameter

    Description

    * Cluster Name

    Enter a name for the cluster. Start with a lowercase letter and do not end with a hyphen (-). Use only digits, lowercase letters, and hyphens (-).

    * Service Provider

    Select a cluster service provider.

    * Region

    Select a region where the cluster is deployed.

    * kubeconfig

    Upload the kubectl configuration file to complete cluster authentication. The file can be in JSON or YAML format.

    * Context

    Select the corresponding context. The option list is available after the kubeconfig file is uploaded. By default, the option list is the context specified by the current-context field in the kubeconfig file. If the file does not contain this field, you need to manually select an option from the list.

    Fleets

    Select the fleet created in Creating a Fleet.

    Figure 2 Registering a cluster

  4. Click OK.

Enabling Network Access

After a cluster is connected, you need to configure a proxy for the cluster to access the network so that the cluster can be taken over by UCS. The following section uses public network access as an example.

Connecting a cluster through a public network is easy, flexible, and cost-effective. If you require high speed, stability, and security while low latency, you can access the cloud through a private network. For details, see Registering an Attached Cluster (Private Access).

  1. On the UCS console, click Public access in the card view of the cluster to be accessed to view the detailed public network access process.
  2. Download the configuration file of the cluster agent.

    NOTE:

    The agent configuration file contains keys and can be downloaded only once. Keep the file secure.

  3. Use kubectl to connect to the cluster, create a YAML file named agent.yaml (customizable) in the cluster, and copy the agent configuration in 2 and paste it to the YAML file.

    vim agent.yaml

  4. Run the following command in the cluster to deploy the agent:

    kubectl apply -f agent.yaml

  5. Check the deployment of the cluster agent.

    kubectl -n kube-system get pod | grep proxy-agent

    Expected output for successful deployment:

    proxy-agent-5f7d568f6-6fc4k 1/1 Running 0 9s

  6. Check the running status of the cluster agent.

    kubectl -n kube-system logs <Agent Pod Name> | grep "Start serving"

    Expected log output for normal running:

    Start serving

  7. Go to the UCS console and refresh the cluster status. The cluster is in the Running status.

    Figure 3 Cluster in running status

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback