Try Devtron Enterprise!
Start Free Trial
LogoLogo
WebsiteDevtron demoGithub RepoJoin Discord
main
  • Introduction
  • Getting Started
  • Install Devtron
    • Install Devtron with CI/CD
    • Install Devtron with CI/CD and GitOps (Argo CD)
    • Install Devtron without Integrations
    • Install Devtron on Minikube, Microk8s, K3s, Kind, Cloud VMs
    • Install Devtron on Airgapped Environment
    • Demo on Popular Cloud Providers
    • Backup for Disaster Recovery
    • Uninstall Devtron
    • FAQs
  • Install Devtron Enterprise Trial
  • Devtron Kubernetes Client
  • Production Infra Recommendations
  • Configurations
    • Installation Configurations
    • Override Configurations
    • Ingress Setup
  • Global Configurations
    • Host URL
    • GitOps
    • Projects
    • Clusters & Environments
    • Git Accounts
    • Container/OCI Registry
    • Chart Repositories
    • Deployment Charts
    • Authorization
      • SSO Login Services
        • Google
        • GitHub
        • GitLab
        • Microsoft
        • LDAP
        • OIDC
          • Keycloak
          • Okta
        • OpenShift
      • User Permissions
      • Permission Groups
      • API Tokens
    • Notifications
    • Deployment Window
    • Approval Policy
    • External Links
    • Catalog Framework
    • Scoped Variables
    • Plugin Policy
    • Pull Image Digest
    • Tags Policy
    • Filter Condition
    • Lock Deployment Configuration
    • Image Promotion Policy
    • Build Infra
  • Devtron Upgrade
    • Update Devtron from Devtron UI
    • Upgrade to 1.5.0
    • 0.6.x-0.7.x
    • 0.5.x-0.6.x
    • 0.4.x-0.5.x
    • 0.4.x-0.4.x
    • 0.3.x-0.4.x
    • 0.3.x-0.3.x
    • 0.2.x-0.3.x
  • Usage
    • Applications
      • Create a New Application
      • Clone an Existing Application
      • Deploy a Sample Application
      • App Configuration
        • Git Repository
        • Build Configuration
        • Base Deployment Template
          • Deployment
          • Rollout Deployment
          • Job and Cronjob
          • StatefulSets
        • GitOps Configuration
        • Workflow Editor
          • CI Pipeline
            • Pre-Build/Post-Build Stages
            • Override Build Configuration
          • CD Pipeline
        • ConfigMaps
        • Secrets
          • External Secret Operator (ESO)
            • AWS Secrets Manager
            • Google Secrets Manager
            • HashiCorp Vault
        • Environment Overrides
        • Deleting Application
      • Build and Deploy
        • Triggering CI
        • Triggering CD
        • Rollback Deployment
        • Applying Labels to Images
      • App Details
        • Debugging Deployment And Monitoring
        • Using Ephemeral Containers
        • Application Metrics
        • Deployment Visibility & Actions
      • Application Overview
    • Jobs
      • Create a new job
      • Configurations
      • Workflow Editor
      • Trigger Job
      • Overview
    • Application Groups
    • Software Distribution Hub
      • Tenants
      • Release Hub
    • Resource Browser
      • Overview Page
      • Discover and Manage Resources
      • Nodes and Operations
      • Pod Management and Debugging
      • Using Devtron Intelligence
      • Cluster Terminal
      • Add Monitoring Dashboards/Graphs
      • Run Kubectl Commands Locally
    • Resource Watcher
    • Charts
      • Charts Overview
      • Deploy & Observe
      • Examples
        • Deploying Mysql Helm Chart
        • Deploying MongoDB Helm Chart
      • Chart Group
    • Security
      • Security Scans
      • Security Policies
    • Bulk Edit
    • Integrations
      • Build and Deploy (CI/CD)
      • GitOps (Argo CD)
      • Vulnerability Scanning
        • Clair
        • Trivy
      • Notifications
      • Monitoring (Grafana)
    • Pipeline Plugins
      • Create Your Plugin
      • Our Plugins
        • Ansible Runner
        • Bitbucket Runner Trigger
        • Codacy
        • Code-Scan
        • Copacetic
        • Container Image Exporter
        • Copy Container Image
        • Cosign
        • CraneCopy
        • Dependency track - Maven & Gradle
        • Dependency track - NodeJS
        • Dependency track - Python
        • Devtron CD Trigger
        • Devtron CI Trigger
        • Devtron Job Trigger
        • DockerSlim
        • EKS Create Cluster
        • GCS Create Bucket
        • GitHub Pull Request Updater
        • GKE Provisioner
        • GoLang-migrate
        • Jenkins
        • Jira Issue Validator
        • Jira Issue Updater
        • K6 Load Testing
        • Pull images from container repository
        • Semgrep
        • SonarQube
        • SonarQube v1.1.0
        • Terraform CLI
        • Vulnerability Scanning
  • Resources
    • Glossary
    • Troubleshooting
    • Use Cases
      • Devtron Generic Helm Chart To Run CronJob Or One Time Job
      • Connect SpringBoot with Mysql Database
      • Connect Expressjs With Mongodb Database
      • Connect Django With Mysql Database
      • Pull Helm Charts from OCI Registry
    • Telemetry Overview
    • Devtron on Graviton
    • Release Notes
Powered by GitBook
On this page
  • What is Devtron Intelligence (AI Agent)
  • Tutorial
  • Steps to Configure Devtron Intelligence
  • 1. Get API Key from LLM
  • 2. Encode your API Key
  • 3. Create Secret in Devtron
  • 4. Deploy AI Agent Chart
  • 5. Check Service Endpoint
  • 6. Update ConfigMaps
  • 7. Restart Pods
  • 8. Perform Hard Refresh
  • Results
  • Pod Errors
  • Pod Last Restart Snapshot
  • Event Errors
  • App Details - Application Status
  • App Details - K8s Resources

Was this helpful?

Export as PDF
  1. Usage
  2. Resource Browser

Using Devtron Intelligence

PreviousPod Management and DebuggingNextCluster Terminal

Last updated 6 hours ago

Was this helpful?

What is Devtron Intelligence (AI Agent)

Devtron Intelligence is an AI assistant that helps you troubleshoot issues faster by analyzing your Kubernetes workloads. It offers smart and easy-to-understand suggestions using large language models (LLM) of your choice.

Check out the Results section to see where Devtron gives you AI-powered explanation for troubleshooting.

Figure 1: Devtron Intelligence for AI-assisted Debugging

Tutorial


Steps to Configure Devtron Intelligence

Who Can Perform This Action?

User must have permissions to:

  • Deploy Helm Apps (with environment access)

  • Edit the ConfigMaps of 'default-cluster'

  • Restart the pods

1. Get API Key from LLM

Devtron Intelligence supports all major large language models (LLM) e.g., OpenAI, Gemini, AWS Bedrock, Anthropic and many more.

You can generate an API key for an LLM of your choice. Here, we will generate an API key from OpenAI.

2. Encode your API Key

Go to strings.is and encode your API key in base64. This base64 encoded key will be used while creating a secret in the next step.

3. Create Secret in Devtron

  1. Go to Devtron's Resource Browser → (Select Cluster) → Create Resource

  2. Paste the following YAML and replace the key with your base64-encoded OpenAI key. Also, enter the namespace where the AI Agent chart will be installed:

apiVersion: v1
kind: Secret
metadata:
  name: ai-secret
  namespace: <your-env-namespace>  # Namespace where the AI Agent chart will be installed
type: Opaque
data: 
  ## OpenAiKey: <base64-encoded-openai-key>           # For OpenAI
  ## GoogleKey: <base64-encoded-google-key>           # For Gemini
  ## azureOpenAiKey: <base64-encoded-azure-key>       # For Azure OpenAI
  ## awsAccessKeyId: <base64-encoded-aws-access-key>  # For AWS Bedrock
  ## awsSecretAccessKey: <base64-encoded-aws-secret>  # For AWS Bedrock
  ## AnthropicKey: <base64-encoded-anthropic-key>     # For Anthropic

4. Deploy AI Agent Chart

Where should I install the Chart?

Deploy the chart in the cluster whose workloads you wish to troubleshoot. You may install the chart in multiple clusters (1 agent for 1 cluster).

  1. Go to Devtron's Chart Store.

  2. Search the ai-agent chart and click on it.

  3. Click the Configure & Deploy button.

  4. In the left-hand pane:

    • App Name: Give your app a name, e.g. ai-agent-app

    • Project: Select your project

    • Deploy to environment: Choose the target environment (should be associated with the same namespace used while creating secret key in Step 3)

    • Chart Version: Select the latest chart version.

    • Chart Values: Choose the default one for the latest version.

  5. In the values.yaml file editor, add the appropriate additionalEnvVars block based on your LLM provider. Use the tabs below to find the configuration snippet of some well-known LLM providers.

additionalEnvVars:
  - name: MODEL
    value: gpt-4o-mini       ## Examples: gpt-4o, gpt-4, gpt-3.5-turbo
  - name: OPENAI_API_KEY
    valueFrom: 
      secretKeyRef:
        key: OpenAiKey       ## Key of the secret created in Step 3
        name: ai-secret      ## Name of the secret created in Step 3
  - name: CLUSTER_NAME
    value: document-nonprod  ## Name of the target cluster (optional)
additionalEnvVars:
  - name: MODEL
    value: gemini-1.5-pro    ## Examples: gemini-2.0-flash, gemini-2.0-flash-lite
  - name: GOOGLE_API_KEY
    valueFrom: 
      secretKeyRef:
        key: GoogleKey       ## Key of the secret created in Step 3
        name: ai-secret      ## Name of the secret created in Step 3
  - name: CLUSTER_NAME
    value: document-nonprod  ## Name of the target cluster (optional)
additionalEnvVars:
  - name: MODEL
    value: azure/<DEPLOYMENT_NAME>   ## Replace with your Azure deployment name (keep "azure/" prefix)
  - name: MODEL_TYPE
    value: gpt-4o                ## Supported: gpt-4o, gpt-35-turbo, etc.
  - name: AZURE_API_VERSION
    value: <API_VERSION>    ## Replace with the version from Azure portal
  - name: AZURE_API_BASE
    value: <AZURE_ENDPOINT>  ## Your Azure endpoint e.g. https://my-org.openai.azure.com/
  - name: AZURE_API_KEY
    valueFrom:
      secretKeyRef:
        key: azureOpenAiKey      ## Key of the secret created in Step 3
        name: ai-secret          ## Name of the secret created in Step 3
  - name: CLUSTER_NAME
    value: document-nonprod  ## Name of the target cluster (optional)
additionalEnvVars:
  - name: MODEL
    value: bedrock/anthropic.claude-3-5-sonnet-20240620-v1:0  ## Replace with your actual Bedrock model name
  - name: AWS_REGION_NAME
    value: us-east-1
  - name: AWS_ACCESS_KEY_ID
    valueFrom:
      secretKeyRef:
        key: awsAccessKeyId      ## Key of the Access Key ID created in Step 3
        name: ai-secret          ## Name of the secret created in Step 3
  - name: AWS_SECRET_ACCESS_KEY
    valueFrom:
      secretKeyRef:
        key: awsSecretAccessKey  ## Key of the secret created in Step 3
        name: ai-secret          ## Name of the secret created in Step 3
  - name: CLUSTER_NAME
    value: document-nonprod  ## Name of the target cluster (optional)
additionalEnvVars:
  - name: MODEL
    value: claude-3-sonnet   ## Examples: claude-3-sonnet, claude-3-haiku
  - name: ANTHROPIC_API_KEY
    valueFrom: 
      secretKeyRef:
        key: AnthropicKey    ## Key of the secret created in Step 3
        name: ai-secret      ## Name of the secret created in Step 3
  - name: CLUSTER_NAME
    value: document-nonprod  ## Name of the target cluster (optional)
  1. Click the Deploy Chart button.

5. Check Service Endpoint

  1. In the App Details page of the deployed chart, expand Networking and click on Service.

  2. Locate the service entry with the URL in the format: <service-name>.<namespace>:<port>. Note the values of serviceName, namespace, and port for the next step.

6. Update ConfigMaps

  1. In a new tab, go to Resource Browser → (Select Cluster) → Config & Storage → ConfigMap

  2. Edit the ConfigMaps:

    • devtron-cm

      Ensure the below entry is present in the ConfigMap (create one if it doesn't exist). Here you can define the target cluster and the endpoint where your Devtron AI service is deployed:

      CLUSTER_CHAT_CONFIG: '{"<targetClusterID>": {"serviceName": "", "namespace": "", "port": ""}}'
    • dashboard-cm

      To enable AI integration via feature flag, check if the below entry is present in the ConfigMap (create one if it doesn't exist).

      FEATURE_AI_INTEGRATION_ENABLE: "true"

7. Restart Pods

  1. Go to Resource Browser → (Select Cluster) → Workloads → Deployment

  2. Click the checkbox next to the following Deployment workloads and restart them using the ⟳ button:

    • devtron

    • dashboard

8. Perform Hard Refresh

Perform a hard refresh of the browser to clear the cache:

  • Mac: Hold down Cmd and Shift and then press R

  • Windows/Linux: Hold down Ctrl and then press F5


Results

Devtron supports Explain option at the following screens (only for specific scenarios where troubleshooting is possible through AI):

Pod Errors

Path: Resource Browser → (Select Cluster) → Workloads → Pod

Pod Last Restart Snapshot

Path: Resource Browser → (Select Cluster) → Workloads → Pod → Pod Last Restart Snapshot

Event Errors

Path: Resource Browser → (Select Cluster) → Events

App Details - Application Status

Path: Application → App Details → Application Status Drawer

App Details - K8s Resources

Path: Application → App Details → K8s Resources (tab) → Workloads

Figure 2: Chart Configuration
Figure 3: Service Endpoint of AI Agent Helm App
Figure 4: Entry in 'orchestrator-cm' or 'devtron-cm' ConfigMap
Figure 5: Entry in 'dashboard-cm' ConfigMap
Figure 6: Restart 'devtron' and 'dashboard' deployment workloads
Figure 7a: AI Explain for Pod Issues
Figure 7b: AI-assisted Troubleshooting
Figure 8: AI Explain for Pod Restart Snapshot
Figure 9: AI Explain for Event Errors
Figure 10a: AI Explain at Application Status
Figure 10b: AI Explain at Application Status Drawer
Figure 11: AI Explain at K8s Resources (tab)