Updated on 2025-08-28 GMT+08:00

kagent Add-on

kagent is an open-source programming framework designed for DevOps and platform engineers. It introduces powerful AI agent functions to Kubernetes clusters, automates O&M tasks, troubleshoots faults, and optimizes workflows in cloud native environments, helping teams solve complex technical challenges more efficiently. It provides:

  • Automated O&M: AI agents automatically handle common faults (such as pod breakdown and network policy conflicts), reducing manual intervention.
  • Knowledge accumulation: Team experience is converted into reusable diagnosis processes and policies to avoid repeated work.
  • Collaboration platform: A custom agent development framework is provided to support sharable O&M solutions for scenarios such as ingresses and CRDs, accelerating problem handling.

Deep integration with kagent capabilities enables CCE standard and Turbo clusters to provide the out-of-the-box kagent add-on and one-click deployment of the production-grade AI O&M agent framework, achieving intelligent cluster management.

Basic Concepts

Table 1 Basic concepts of the add-on

Concept

Description

Functions

Agent

An AI agent is an AI-based application that can interact with users in natural language and execute tasks on behalf of users.

  • Natural language interaction: Users can interact with complex systems using natural language, without the need to memorize commands or view documentation, which significantly improves the operational efficiency of non-expert users.
  • Automatic execution: Repeated tasks (such as log analysis, configuration checks, and scaling) are converted into automatic processes to reduce manual operation errors.
  • Knowledge solidification and collaboration: Expert experience is encoded into shareable tools and agent instructions to form a team knowledge base, preserving expertise or preventing repeated work.

Tool

Tools are executable functions or APIs used by AI agents to interact with environments. They enable agents to perform specific operations, not just generate text.

  • Environment interaction: Agents are allowed to execute actual tasks, such as querying data, modifying configurations, and triggering operations, rather than just "conversations."
  • Extended agent capabilities: Agents can break through the pure text limit of the LLM and directly operate the real system through tool integration.
  • Secure, controllable execution: Tools usually provide permission verification and input filtering to prevent risky operations.

For more concepts, see kagent.

Prerequisites

  • You have created a CCE standard or Turbo cluster of v1.28 or later.
  • You have deployed an inference service using the AI Inference Framework add-on by referring to AI Inference Framework Add-on.

Constraints

  • kagent needs to be installed immediately after it is started. Ensure that the pods in the cluster can access the public network. You can configure an SNAT rule for the cluster to ensure that pods can access the public network. You will be billed for the SNAT rule. For details, see NAT Gateway Price Calculator.
  • This add-on is being deployed. To view the regions where this add-on is available, see the console.
  • This add-on is in the OBT phase. You can experience the latest add-on features. However, the stability of this add-on version has not been fully verified, and the CCE SLA is not valid for this version.

Installing the Add-on

  1. Log in to the CCE console and click the cluster name to access the cluster console.
  2. In the navigation pane, choose Add-ons. On the displayed page, locate kagent and click Install.
  3. On the Install Add-on page, configure the specifications.

    Table 2 Add-on specifications

    Parameter

    Description

    Version

    Select a version as needed.

    Add-on Specifications

    Currently, only the default specifications are supported.

    openaiApiUrl

    URL of the inference service. For details, see Prerequisites.

    openaiApiKey

    Authentication key for accessing the inference service. For details, see Prerequisites.

    openaiModel

    Model name used in the inference service. For details, see Prerequisites.

  4. Click Install in the lower right corner. If the status is Running, the add-on has been installed.

Components

Table 3 kagent components

Component

Description

Resource Type

kagent

kagent consists of the following:

  • Controller: a Kubernetes controller that is used to monitor kagent custom resources and create resources required for running agents.
  • UI: provides a web UI for managing and using AI agents.
  • Engine: a Python application that runs agents and tools. It is built using AutoGen.

Deployment

Use Case

This example shows how to create a custom agent using the kagent add-on.

  1. Install kubectl on an existing ECS and access a cluster using kubectl. For details, see Accessing a Cluster Using kubectl.
  2. Run the following command to create a YAML file for the NodePort Service. You can use this Service to access the cceaddon-kagent workload in the kube-system namespace. Set both the access port and container port to 80.

    vim kagent-svc.yaml

    The file content is as follows:

    apiVersion: v1
    kind: Service
    metadata:
      name: kagent-svc
      namespace: kube-system
      labels:
        app.kubernetes.io/instance: cceaddon-kagent
        app.kubernetes.io/name: kagent
    spec:
      ports:
        - name: ui
          protocol: TCP
          port: 80
          targetPort: 80
          nodePort: 30371  # Node port number
        - name: app
          protocol: TCP
          port: 8081
          targetPort: 8081
          nodePort: 30372  # Node port number
      selector:
        app.kubernetes.io/instance: cceaddon-kagent
        app.kubernetes.io/name: kagent
      type: NodePort
      sessionAffinity: None
      externalTrafficPolicy: Cluster
      ipFamilies:
        - IPv4
      ipFamilyPolicy: SingleStack
      internalTrafficPolicy: Cluster

  3. Create the Service.

    kubectl apply -f kagent-svc.yaml

    Information similar to the following is displayed:

    service/kagent-svc created

  4. Obtain the IP address of the Service.

    kubectl get node -owide

    Information similar to the following is displayed:

    NAME            STATUS                     ROLES    AGE        INTERNAL-IP     EXTERNAL-IP     
    192.168.0.211   Ready                      <none>   12d        192.168.0.211   xx.xx.xx.xx  
    192.168.0.32    Ready,SchedulingDisabled   <none>   7d16h      192.168.0.32    <none>          
    192.168.1.173   Ready,SchedulingDisabled   <none>   12d        192.168.1.173   xx.xx.xx.xx   

  5. Enter http://<EIP-of-any-node>:<node-port>/ in the address bar of a browser to access the kagent UI.

    Figure 1 UI

  6. Click New Agent to create an agent. By default, the inference service entered during add-on installation is used. For details about the parameters, see Figure 2.

    Figure 2 Creating an agent

  7. Click Create Agent. After the agent is created, you can use it.

Release History

Table 4 kagent add-on release history

Add-on Version

Supported Cluster Version

New Feature

Community Version

0.1.15

v1.28

v1.29

v1.30

v1.31

CCE standard and Turbo clusters support the kagent add-on.

v0.1.15