Explore the new Era of AIOps: Read the article

Troubleshoot K8s with ChatGPT + Botkube's Doctor Plugin

Jul 31, 2023
7min.
read
Maria Ashby
Developer Advocate
Botkube

This Tutorial is about the new ChatGPT-powered Doctor plugin which allows for easy diagnosis and solution recommendations for Kubernetes troubleshooting.

Share on Twitter
Share on LinkedIn
Share on Reddit
Share on HackerNews
Copy URL

Table of Contents

Manage your Kubernetes Clusters Directly in Slack and Microsoft Teams!

Get started with Botkube Cloud

Discover the future of efficient Kubernetes troubleshooting with Botkube’s new [Doctor plug-in](https://botkube.io/integration/chatgpt-botkube-kubernetes-integration)! By leveraging ChatGPT's powerful capabilities, you can now troubleshoot your Kubernetes cluster with unparalleled ease and save valuable time in the process. Say goodbye to tedious and time-consuming tasks, as ChatGPT helps to automate much of the troubleshooting process, allowing you to concentrate on more critical aspects of your workflow. Moreover, ChatGPT's comprehensive analysis of your cluster configuration and resource utilization offers invaluable insights to optimize performance and cut down on costs. Real-time errors and recommendations enhance your troubleshooting experience, ensuring you're always up-to-date with the health of your cluster. Seamlessly integrated with major communication channels, Botkube empowers you to act swiftly on identified errors, keeping your Kubernetes environment running smoothly at all times.

Learn more about Botkube's ChatGPT-powered Doctor plugin in our [release announcement](https://botkube.io/blog/use-chatgpt-to-troubleshoot-kubernetes-errors-with-botkubes-doctor).

In this tutorial, we will walk you through the step-by-step process of setting up and utilizing Botkube's new [Doctor plug-in](https://docs.botkube.io/usage/executor/doctor), optimizing your team’s performance, and maximizing your Kubernetes productivity.


## Requirements

* A Slack workspace
* A [Botkube Cloud](http://app.botkube.io) account
* [OpenAI credits [(https://openai.com/)


## Method 1: Install the Doctor Plug into a new instance

### Creating a Botkube Cloud Account

1. On the Botkube [homepage](https://botkube.io/), locate the “Get Started” button and click on it. This will take you to the account registration page.
2. Fill in the required information in the registration form. You can sign up with your email address or Github account.

* Click [here](https://botkube.io/blog/step-by-step-tutorial-leveraging-botkubes-cloud-slack-feature-for-kubernetes-collaborative-troubleshooting) for a more indepth Botkube installation tutorial

### Connecting Kubernetes Cluster to Slack

1. Select either the Wizard or the Block builder method to initiate the setup process for Botkube's Cloud Slack integration.

Easy one click Kubernetes deployment for cloud

2. Next, enter your instance display name.

K8s cluster building GUI


3. Select the *Official Botkube Slack* option. (Note this option requires you to sign up for a 30 day free trial)

Official Slack Kubernetes bot

4. Access the app settings within Slack to configure the integration with Botkube. Click the "Add Slack" button to initiate the process.

5. Select the workspace within Slack where you want to utilize Botkube. Botkube will now have access to public and private channels, enabling seamless communication and collaboration for Kubernetes troubleshooting tasks.

Multicluster setup screen for Slack

6. To include Botkube in private channels, utilize the "Add to Channel" feature. This ensures that Botkube is present in relevant channels where Kubernetes-related discussions and incident responses take place.

One click slack sign in


7. Select the Plugins you would like to use. [Helm](https://docs.botkube.io/usage/executor/helm), [kubectl](https://docs.botkube.io/usage/executor/kubectl), and Kubernetes source are the Botkube default plug-ins. Select the [Doctor plug-in](https://docs.botkube.io/usage/executor/doctor).


8. Navigate to the OpenAI website [here ](https://beta.openai.com/account/api-keys) and create your API key
9. Paste your API key into the empty box and press submit.


10. On the next page, you will have the option to also enable [Command Alias](https://botkube.io/blog/command-line-magic-simplify-your-life-with-custom-kubernetes-kubectrl-aliases-on-botkube)and [Botkube Actions](https://docs.botkube.io/usage/automated-actions/). Make your selection and click the Create button.


11. You are now ready to start utilizing the Botkube Doctor plugin!


## Method 2: Install the Doctor plug-in into an already created Botkubeinstance.


### Creating your New Plug-In

1. Select the `Add Plug-in` button


2. Select the option for the Doctor plug-in


3. Navigate to the OpenAI website [here](https://beta.openai.com/account/api-keys) and create your API key
4. Paste your API key into the empty field and press Submit.


5. Select the Save button and refresh your browser.
6. Start interacting with your new Doctor Plug-in!

## Interactive Troubleshooting

When the Doctor AI detects an error or anomaly in the Kubernetes environment, it takes proactive steps to assist users in resolving the issue. Upon detecting an error event, the Doctor AI generates a Slack message with a `Get Help` button. Clicking on this button triggers the Doctor AI to provide users with actionable solutions and next steps to tackle the problem. This interactive troubleshooting approach empowers users with the knowledge and confidence to resolve Kubernetes issues swiftly.
## Support for Generic Questions

Beyond its ability to tackle specific errors, the Doctor AI is also well-versed in answering general questions related to Kubernetes. Users can seek guidance on various Kubernetes concepts, best practices, or configurations directly within the Slack channel. This means no more interruptions to access a separate dashboard or documentation, making it easier to gain quick insights and expand Kubernetes expertise.

## Scalable Plugin Pipelining

The Doctor AI plugin's versatility extends beyond standalone usage. It can be easily combined with other [Botkube plug-ins](https://botkube.io/integrations), allowing users to create custom workflows tailored to their specific use cases. By pipelining the Doctor AI with other plugins, teams can orchestrate complex actions and integrations, further streamlining Kubernetes management processes.
## Conclusion

Botkube's new Doctor plug-in brings the future of efficient Kubernetes troubleshooting to your fingertips. With the power of ChatGPT, you can now effortlessly troubleshoot your Kubernetes cluster, saving precious time and streamlining your workflow. Bid farewell to tedious tasks, as ChatGPT automates much of the troubleshooting process, allowing you to focus on critical aspects of your work.

With seamless integration into [major communication channels](http://botkube.io/integrations), Botkube empowers you to take swift action on identified errors, ensuring your Kubernetes environment runs smoothly wherever you are.  


### Sign up now

Whether you're a seasoned Kubernetes pro or just getting started, Botkube helps make troubleshooting Kubernetes easier and faster. [Sign up now for free](http://app.botkube.io) and [join the community](https://join.botkube.io/) of users who are already benefiting from the power of Botkube.


## We'd Love Your Feedback

We welcome developers and Kubernetes enthusiasts to explore the platform and share their valuable feedback. We want to know what you think of Botkube and how we can make it even better. We're doing quick 15-minute interviews to get your feedback, and as a thank you, we'll give away cool Botkube plushies and t-shirts. Just email [maria@kubeshop.io](mailto:maria@kubeshop.io) or [set up a meeting](https://calendly.com/maria-botkube/30min).

You can also talk to us in the Botkube GitHub [issues](https://github.com/kubeshop/botkube/issues), connect with others and get help in the [Botkube Slack community](http://join.botkube.io), or email our Product Leader at [blair@kubeshop.io](mailto:blair@kubeshop.io).