New: K8sGPT works with Claude Desktop!

Back to Documentation

Configuration

Learn how to configure K8sGPT for your specific needs

Configuration File

K8sGPT uses a YAML configuration file to manage its settings. By default, it looks for a file named k8sgpt.yaml in your home directory, but you can specify a different location using the --config flag.

Basic Configuration

  • Backend

    Specify the AI backend to use (e.g., OpenAI, Anthropic, etc.)

  • Model

    The specific model to use with the selected backend

  • API Key

    Your API key for the selected backend

Advanced Configuration

  • Filters

    Configure which resources to analyze and which to ignore

  • Output Format

    Customize the output format (JSON, YAML, etc.)

  • Cache Settings

    Configure caching behavior for analysis results

Example Configuration

backend: openai
model: gpt-4
apiKey: your-api-key-here
filters:
  - Pod
  - Deployment
  - Service
output:
  format: json
cache:
  enabled: true
  ttl: 3600

Environment Variables

You can also configure K8sGPT using environment variables. These will override any settings in the configuration file.

  • K8SGPT_BACKEND

    Specify the AI backend

  • K8SGPT_MODEL

    Specify the model to use

  • K8SGPT_API_KEY

    Your API key

For more detailed information about configuration options, please refer to the Advanced Configuration guide.