tencent cloud

Tencent Kubernetes Engine

Release Notes and Announcements
Release Notes
Announcements
Release Notes
Product Introduction
Overview
Strengths
Architecture
Scenarios
Features
Concepts
Native Kubernetes Terms
Common High-Risk Operations
Regions and Availability Zones
Service Regions and Service Providers
Open Source Components
Purchase Guide
Purchase Instructions
Purchase a TKE General Cluster
Purchasing Native Nodes
Purchasing a Super Node
Getting Started
Beginner’s Guide
Quickly Creating a Standard Cluster
Examples
Container Application Deployment Check List
Cluster Configuration
General Cluster Overview
Cluster Management
Network Management
Storage Management
Node Management
GPU Resource Management
Remote Terminals
Application Configuration
Workload Management
Service and Configuration Management
Component and Application Management
Auto Scaling
Container Login Methods
Observability Configuration
Ops Observability
Cost Insights and Optimization
Scheduler Configuration
Scheduling Component Overview
Resource Utilization Optimization Scheduling
Business Priority Assurance Scheduling
QoS Awareness Scheduling
Security and Stability
TKE Security Group Settings
Identity Authentication and Authorization
Application Security
Multi-cluster Management
Planned Upgrade
Backup Center
Cloud Native Service Guide
Cloud Service for etcd
TMP
TKE Serverless Cluster Guide
TKE Registered Cluster Guide
Use Cases
Cluster
Serverless Cluster
Scheduling
Security
Service Deployment
Network
Release
Logs
Monitoring
OPS
Terraform
DevOps
Auto Scaling
Containerization
Microservice
Cost Management
Hybrid Cloud
AI
Troubleshooting
Disk Full
High Workload
Memory Fragmentation
Cluster DNS Troubleshooting
Cluster kube-proxy Troubleshooting
Cluster API Server Inaccessibility Troubleshooting
Service and Ingress Inaccessibility Troubleshooting
Common Service & Ingress Errors and Solutions
Engel Ingres appears in Connechtin Reverside
CLB Ingress Creation Error
Troubleshooting for Pod Network Inaccessibility
Pod Status Exception and Handling
Authorizing Tencent Cloud OPS Team for Troubleshooting
CLB Loopback
API Documentation
History
Introduction
API Category
Making API Requests
Elastic Cluster APIs
Resource Reserved Coupon APIs
Cluster APIs
Third-party Node APIs
Relevant APIs for Addon
Network APIs
Node APIs
Node Pool APIs
TKE Edge Cluster APIs
Cloud Native Monitoring APIs
Scaling group APIs
Super Node APIs
Other APIs
Data Types
Error Codes
TKE API 2022-05-01
FAQs
TKE General Cluster
TKE Serverless Cluster
About OPS
Hidden Danger Handling
About Services
Image Repositories
About Remote Terminals
Event FAQs
Resource Management
Service Agreement
TKE Service Level Agreement
TKE Serverless Service Level Agreement
Contact Us
Glossary

Connecting to a Registered Cluster

PDF
Mode fokus
Ukuran font
Terakhir diperbarui: 2024-05-09 15:47:11

Operation Scenarios

This document describes how to connect a local client to a registered cluster using kubectl, the Kubernetes command-line tool.

Prerequisites

The cURL software has been installed.
Select an appropriate way to obtain kubectl based on the type of the operating system:
Note:
Replace the version v1.8.13 in the command line with the kubectl version required for your business, according to the version you are actually using.
macOS
Linux
Windows
Execute the following command to obtain kubectl:
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.8.13/bin/darwin/amd64/kubectl

Execute the following command to obtain kubectl:
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.8.13/bin/linux/amd64/kubectl

Execute the following command to obtain kubectl:
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.8.13/bin/windows/amd64/kubectl.exe


Directions

Installing kubectl

1. Refer to Install and Set Up kubectl to install kubectl.
Note:
If you have already installed kubectl, skip this step.
This step uses the Linux operating system as an example.
2. Execute the following commands in sequence to grant execution permissions.
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
3. Execute the following command to check the installation result.
kubectl version
If the output is similar to the following version information, the installation was successful.
Client Version: version.Info{Major:"1", Minor:"5", GitVersion:"v1.5.2", GitCommit:"08e099554f3c31f6e6f07b448ab3ed78d0520507", GitTreeState:"clean", BuildDate:"2017-01-12T04:57:25Z", GoVersion:"go1.7.4", Compiler:"gc", Platform:"linux/amd64"}

Configuring kubeconfig

1. Log in to the TKE console, and choose Cluster from the left navigation bar.
2. On the cluster list page, click the ID of the registered cluster you want to connect to, to enter the management page of the cluster.
3. Choose Basic Information from the left navigation bar to enter the basic information page of the cluster.
4. In the Cluster APIServer Information, obtain the kubeconfig for either public network access or private network access, which you can copy or download.
5. Configure the cluster credential as needed. For details, see Connecting to the Kubernetes Cluster Through kubectl in the console.

Accessing the Kubernetes Cluster

1. After completing the kubeconfig configuration, execute the following commands in sequence to view contexts and switch the contexts to access the cluster.
kubectl config get-contexts
kubectl config use-context cls-3jju4zdc-context-default
2. Execute the following command to check whether the cluster can be accessed.
kubectl get pod
If you cannot connect to the cluster, check whether public network access or private network access is enabled, and ensure that the access client is in the specified network environment.

Relevant Descriptions

Introduction to the kubectl CLI

kubectl is a command-line tool for operating Kubernetes clusters. This document covers syntax and common command operations of kubectl, and provides common examples. For detailed information about each command (including all main commands and subcommands), refer to the kubectl Reference Documentation or use the kubectl help command for more detailed assistance. For kubectl installation instructions, refer to the earlier section Installing kubectl.


Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan