Coding

huawei-cloud-kubectl-cce-installer

Try it

Install, upgrade, verify, or troubleshoot local kubectl and the Huawei Cloud kubectl-cce plugin. Trigger when a user asks to install kubectl, install kubectl-cce, configure the CCE kubectl plugin, verify kubectl-cce availability, or repair local command prerequisites for CCE Kubernetes resource access.

What it does

Install, upgrade, verify, or troubleshoot local kubectl and the Huawei Cloud kubectl-cce plugin. Trigger when a user asks to install kubectl, install kubectl-cce, configure the CCE kubectl plugin, verify kubectl-cce availability, or repair local command prerequisites for CCE Kubernetes resource access.

The skill document

Huawei Cloud CCE kubectl Installer

Overview

Install and verify the local kubectl and kubectl-cce prerequisites used for Huawei Cloud CCE Kubernetes resource access. This skill changes only the local machine; it never creates, updates, or deletes cloud or Kubernetes resources.

Architecture: scripts/install_kubectl_cce.sh -> local OS package paths and official download/source repositories -> kubectl and kubectl-cce binaries -> kubectl plugin list verification.

Execution Method: Run the bundled shell script only. Do not replace its download URLs, build tags, installation paths, or verification steps with ad hoc commands unless the user explicitly asks for a different method.

Capabilities:

  • Detect the local OS, architecture, executable availability, and plugin discovery state
  • Show a no-change installation plan before execution
  • Select the latest missing Linux kubectl package from Huawei Cloud OBS for the local architecture
  • Fall back to the official Kubernetes stable release, then build the same stable tag when download fails
  • Install kubectl-cce v0.1.0 from its Gitee Release on Linux when available
  • Build the fixed kubectl-cce v0.1.0 source tag when a Release asset is unavailable or download fails
  • Verify kubectl and kubectl-cce plugin discovery after installation

Typical Use Cases:

  • "Install kubectl and kubectl-cce on this machine"
  • "Check whether kubectl-cce is available"
  • "Show the installation plan for CCE kubectl access"
  • "Repair a missing kubectl-cce plugin"

Prerequisites

1. Runtime Dependencies

  • Bash, curl, tar, cp, and chmod for Linux/macOS installation
  • git and Go only when source-build fallback is needed
  • Write access to the selected --bin-dir; /usr/local/bin normally requires elevation
  • Internet access to Kubernetes and Gitee release/source endpoints
  • Network steps use timeouts by default: 10 seconds to connect, 300 seconds to download, 600 seconds to clone sources, and 900 seconds to build sources

2. Credential Configuration

Installation itself needs no Huawei Cloud credentials. Do not request, print, or save AK/SK, security tokens, IAM tokens, or kubeconfig content during installation.

After installation, kubectl cce requires credentials only when it accesses a CCE cluster. Read plugin-usage.md before configuring that access.

3. Local Permission Requirements

PermissionPurpose
Read/execute accessDetect existing kubectl and kubectl-cce executables
Write access to --bin-dirInstall a missing executable
Elevated local permission when requiredWrite to protected directories such as /usr/local/bin

Permission Failure Handling:

  1. Report the target installation directory and the local permission error.
  2. Ask the user to select a writable directory or explicitly authorize an elevated command.
  3. Do not retry with sudo automatically.

Core Commands

All commands use the bundled installer script:

bash scripts/install_kubectl_cce.sh [--check] [--execute] [--bin-dir ]

1. Local State Check

bash scripts/install_kubectl_cce.sh --check

This is read-only. It reports the OS, architecture, installed binaries, kubectl client version, and kubectl plugin list output.

2. Installation Plan

bash scripts/install_kubectl_cce.sh --bin-dir /usr/local/bin

This is read-only. It shows which executables are missing and the exact download or source-build fallback without changing the machine.

3. Confirmed Installation

sudo bash scripts/install_kubectl_cce.sh --execute --bin-dir /usr/local/bin

Run only after the user confirms the previewed installation path and actions. The script does not overwrite existing kubectl or kubectl-cce executables.

4. Source-Build Fallback

  • For Linux, list the public OBS package repository and select the latest package for the local amd64 or arm64 architecture. Package names determine release ordering.
  • If OBS lookup, download, or extraction fails, download the official Kubernetes stable release; build the same stable tag only if that download fails.
  • When the Linux kubectl-cce v0.1.0 asset is unavailable or download fails, build the fixed v0.1.0 source tag.
  • On macOS, build kubectl-cce v0.1.0 from source because the Release has no macOS asset.

The fallback requires git and Go. If either is absent, return the missing dependency rather than installing it automatically.

5. Windows Manual Installation

The bundled script does not run on Windows. Download the matching Windows kubectl binary from the official Kubernetes release site and the matching kubectl-cce ZIP from the Gitee v0.1.0 Release. Extract the files, place them in a user-selected directory on PATH, and verify with kubectl version --client and kubectl plugin list. See plugin-usage.md for the plugin-specific steps.

Risk Levels

This skill modifies only local binaries and does not operate on cloud resources. It must still use a plan-and-confirm flow for system changes.

LevelMeaningExecution Guidance
R3Read-only local inspectionMay run automatically
R1Local executable installation, replacement, or PATH-adjacent system changeShow the plan first and require explicit user confirmation before --execute
OperationRisk LevelDescription
--checkR3Inspect local tools and plugin discovery
Default script modeR3Show installation plan without making changes
--executeR1Install missing binaries into the selected directory
Source-build fallbackR1Clone fixed source tags and compile missing binaries

Parameter Reference

ParameterRequired/OptionalDescriptionDefault
--checkOptionalRun only local inspection and verificationDisabled
--executeRequired for mutationInstall missing binaries after explicit confirmationDisabled
--bin-dir OptionalTarget directory for newly installed executables/usr/local/bin
--helpOptionalDisplay script usageN/A

Set KUBECTL_CCE_CONNECT_TIMEOUT, KUBECTL_CCE_DOWNLOAD_TIMEOUT, KUBECTL_CCE_SOURCE_CLONE_TIMEOUT, or KUBECTL_CCE_SOURCE_BUILD_TIMEOUT to positive integer seconds only when the default timeout is unsuitable.

参数确认

The installer may inspect the local machine without confirmation, but installation is an R1 local-system change. Confirm the following values with the user before running --execute.

ParameterResolutionConfirmation Requirement
Installation mode--check and the default plan are read-only; --execute installs missing binariesExplicit confirmation required for --execute
--bin-dirDefaults to /usr/local/bin; may be changed to a writable user-selected directoryConfirm the target directory before installation
Existing executablesDetected from PATH; the script does not overwrite themReport the detected state; do not replace an executable without a separately approved workflow
Network timeoutsUse defaults unless the user provides positive integer overridesConfirm non-default values when they materially extend the wait time

Never infer a writable installation directory, use sudo automatically, or install a missing build dependency without the user's explicit approval.

Output Format

The script writes human-readable output to standard output and exits nonzero when it cannot complete the requested operation.

Key output fields:

  • platform: detected operating system
  • arch: normalized CPU architecture
  • kubectl_present: whether kubectl is in PATH
  • kubectl_cce_present: whether kubectl-cce is in PATH
  • bin_dir: selected installation directory
  • PLAN: planned changes in no-change mode
  • Error text: missing dependency, unsupported platform, download/build failure, or plugin discovery failure

Workflow

  1. Run --check and record the current local state.
  2. Run the default plan command with the intended --bin-dir.
  3. Present the planned downloads, source-build fallback, target directory, and R1 local-system impact to the user.
  4. Wait for explicit confirmation.
  5. Run the same command with --execute.
  6. Verify kubectl version --client and kubectl plugin list.
  7. For CCE access configuration, read plugin-usage.md and perform only a read-only cluster request if the user asks to test connectivity.

Verification

Run the read-only check first:

bash scripts/install_kubectl_cce.sh --check

After a confirmed installation, verify:

kubectl version --client
kubectl plugin list

The plugin is ready when kubectl plugin list contains kubectl-cce. Do not rely on kubectl cce --version: the source tag does not expose a stable version flag.

Best Practices

  1. Inspect before installing - always run --check and the no-change plan first.
  2. Use an explicit target directory - show --bin-dir before asking for confirmation.
  3. Preserve existing binaries - do not request --execute as an upgrade mechanism unless the user explicitly asks for replacement support.
  4. Use the local architecture - select the latest amd64 or arm64 OBS package matching the host CPU.
  5. Separate installation from cluster access - do not validate the plugin by mutating a cluster; use a read-only request only when requested.

Notes

  • Installation and source compilation are R1 local-system actions and require explicit confirmation.
  • The script never writes Huawei Cloud credentials, tokens, or kubeconfig files.
  • kubectl-cce must be named exactly kubectl-cce for Kubernetes plugin discovery.
  • On Windows, do not run the bundled script; use the official Kubernetes download and matching Gitee Release ZIP as described in plugin-usage.md.

Troubleshooting

SymptomLikely CauseAction
curl, tar, cp, or chmod is missingLocal prerequisite is absentInstall the missing local prerequisite through the user-approved system method, then retry
Download failsNetwork restriction or unavailable Release assetAllow the script to use its fixed-tag source-build fallback after confirmation
Network step times outEndpoint, proxy, or connection is slow or unavailableCheck connectivity, then increase the relevant KUBECTL_CCE_*_TIMEOUT value if the user approves
Source build failsgit/Go missing or source build dependency failureInstall the reported build prerequisite, then rerun the plan and confirmed installation
Permission denied in --bin-dirProtected target directorySelect a writable directory or run an explicitly approved elevated command
Plugin not listedTarget directory is not in PATHAdd the selected --bin-dir to PATH, then rerun kubectl plugin list
macOS plugin missingv0.1.0 has no macOS Release assetUse the fixed v0.1.0 source-build fallback

Limitations

  • The bundled script executes only on Linux and macOS. Windows uses manual downloads from the official Kubernetes release site and Gitee; the script must not be used.
  • The script installs missing binaries only; it does not upgrade or replace existing binaries.
  • The skill does not configure Huawei Cloud credentials or retrieve kubeconfig files.
  • The skill does not test cluster connectivity unless the user explicitly requests a separate read-only CCE command.
  • Source build depends on the availability of the pinned Git tags and a compatible local Go toolchain.

References

DocumentUse
Plugin Usagekubectl-cce credentials, read-only CCE connectivity test, and Windows installation
Acceptance CriteriaInstallation, verification, safety, and documentation acceptance gates

Related skills

Huawei Cloud CCE/UCS workload lifecycle management skill using hcloud CLI for kubeconfig acquisition and kubectl for Kubernetes resource operations. Use this...

3 installs1 stars

Use when planning CCE Kubernetes cluster version upgrades, evaluating upgrade path compatibility, addon compatibility, pre-upgrade difference checks, and est...

4 installs1 stars

Provides guidance for Huawei Cloud KooCLI command-line tool operations. Covers KooCLI installation, IAM authentication configuration, access credential confi...

by huaweicloud-skills-team1 installs

Configure, deploy, and verify Huawei Cloud CCE to CCI 2.0 bursting for fast elastic capacity. Use when users ask to enable CCE elasticity to CCI, install or...

4 installs1 stars

Manage Huawei Cloud CCE cluster lifecycle, node pools, nodes, and addons with built-in safety confirmations.

by shijingcheng4 installs1 stars

Query Huawei Cloud CCE (Cloud Container Engine) clusters and report their names, IDs, statuses, versions, and node information across a project. Use when listing CCE clusters, looking up a cluster name, showing cluster detail, or inspecting cluster status and nodes. Provides read-only inspection for daily operations, inventory reporting, and troubleshooting. Triggers include: CCE query, list CCE clusters, query CCE cluster names, CCE cluster inventory, show CCE cluster, list CCE nodes, check cluster status, CCE集群查询, 查询CCE集群, CCE集群名称, CCE集群列表, 查看CCE集群.

More from huaweiclouddev-dev

Browse all skills

Huawei Cloud ModelArts training job fault diagnosis skill. Uses hcloud CLI to call ModelArts training job log/event APIs, analyzes training job failures/timeouts/stuck jobs, locates customer training code issues, and provides diagnosis conclusions with fix suggestions and confidence levels. Scenarios: training job failure (status.phase=Failed), timeout (Timeout), abnormal (Abnormal), stuck jobs. Triggers: training job failure, training job timeout, training job stuck, ModelArts training diagnosis, 训练任务失败排查, 训练作业异常分析.

by huaweiclouddev-dev

Queries Huawei Cloud billing and fee details only when Terraform needs a billing or pricing inquiry. Covers balances, bills, coupons, cash coupons, stored-value cards, orders, refunds, costs, free resources, resource usage, enterprise accounts, and on-demand/period/ELB/NAT/DCS pricing. No write operations. Use this skill only when Terraform requires billing details, invoice/bill summaries, coupon or balance status, refund/order billing status, or pricing inquiry. Triggers: Terraform 账单查询, Terraform 费用查询, Terraform 价格询价, Terraform 询价, Terraform billing query, Terraform pricing inquiry, Terraform price quote, Terraform bill summary.

by huaweiclouddev-dev

Huawei Cloud RDS (Relational Database Service) full-scenario intelligent service covering all database engines (MySQL, PostgreSQL, SQL Server, MariaDB, GaussDB for MySQL, TaurusDB). Provides six capability domains: (1) Basic intelligent Q&A for RDS product features, best practices, and specifications; (2) SQL statement performance optimization with slow log analysis, top SQL, execution plan guidance, and index recommendations; (3) Database instance daily O&M including health inspection, restart, flavor resize, disk expansion, primary-standby switchover, and read replica management; (4) Online fault localization and troubleshooting via error logs, replication status, connection diagnostics, and recovery time window; (5) Parameter tuning with parameter group management, modification suggestions, and performance parameter adjustment guidance; (6) Backup and recovery guidance including backup policy management, manual backup creation, restore to new/existing instance, and point-in-time rec

by huaweiclouddev-dev

Huawei Cloud MRS Hive SQL specification checking skill. Checks SQL statements against defined syntax and specification rules using the automated checker engine. No extra manual analysis beyond defined rules. Trigger:"Hive SQL优化"、"检查Hive SQL"、"Hive SQL检查"、"Hive SQL规范"、"Hive SQL语法"、"Hive SQL review"

by huaweiclouddev-dev