mirror of
https://github.com/k8sgpt-ai/k8sgpt.git
synced 2025-05-12 10:04:22 +00:00
1.4 KiB
1.4 KiB
K8sGPT MCP Client Example
This directory contains an example of how to use the K8sGPT MCP client in a real-world scenario.
Prerequisites
- Go 1.16 or later
- Access to a Kubernetes cluster
kubectl
configured to access your cluster
Building the Example
To build the example, run:
go build -o mcp-client-example
Running the Example
To run the example, use the following command:
./mcp-client-example --kubeconfig=/path/to/kubeconfig --namespace=default
Command-line Flags
--kubeconfig
: Path to the kubeconfig file (optional, defaults to the standard location)--namespace
: Kubernetes namespace to analyze (optional)
Example Output
When you run the example, you should see output similar to the following:
Starting MCP client...
The client will continue running until you press Ctrl+C to stop it.
Integration with Mission Control
To integrate this example with Mission Control, you need to:
- Start the MCP client using the example
- Configure Mission Control to connect to the MCP client
- Use Mission Control to analyze your Kubernetes cluster
Troubleshooting
If you encounter any issues, check the following:
- Ensure that your Kubernetes cluster is accessible
- Verify that your kubeconfig file is valid
- Check that the namespace you specified exists
License
This code is licensed under the Apache License 2.0.