AI is playing a transformative role across industries. While some fear that AI might lead to a dystopian takeover (I even wrote about this myself when AI was starting to take our industry by storm like Skynet), there's still plenty of room for innovation and efficiency gains before reaching that point. That is why at Firefly we have been investing heavily in building AI-driven cloud solutions, where we are on a mission to help teams gain better control over the cloud (and AI itself). 

This post will bring some real practical examples of how AI can be channeled for greater DevOps efficiencies, particularly through the use of our very open-source, AIaC, and the Kubernetes-focused k8sGPT that is gaining momentum and adoption.

The AI Landscape in DevOps

When AI is mentioned, the first things that come to mind might be image generation or content creation. Tools like Stable Diffusion, DALL-E 2, and MidJourney have indeed made it possible to turn text prompts into stunning visuals, but beyond these creative applications, AI's potential extends far into the technical realm, particularly in DevOps.

Imagine if the tools used every day in DevOps—like Kubernetes, Open Policy Agent, or ArgoCD—could be transformed into human-like assistants. This is exactly the kind of innovation we are constantly exploring at Firefly , where AI has been used to create human-like representations of these tools. But beyond the novelty of generating images or videos, the true power of AI lies in its ability to parse large amounts of text-based data, resulting in its truly novel understanding and capability of generating code (which is essentially text), and then applying this to diagnosing issues, and even automating infrastructure management.

We wanted to test these new frontiers and see how GenAI performs and stacks up in these domains that formerly required many human hours of toil.  We wanted to see how close to human results GenAI could provide for typical and common DevOps use cases.

Use Case 1: Automating Code Generation with AIAC

One of the most significant ways AI is making an impact in DevOps is through code generation––a great example of this is GitHub’s Copilot went from novel to widely adopted even faster than they could have predicted.  This is also why competitors like AWS are investing significant R&D hours in productizing and leveling up competing tools like Amazon Q. 

The entire DevOps discipline has been built upon taking everything infrastructure––and transitioning it to as code (AKA - infrastructure as code, IaC). This includes deployment pipelines, monitoring, repositories––anything that is built upon configurations––can be represented in code. This is where AI tools like ChatGPT and AIaC come into play.

AIaC, as an open-source CLI tool, enables developers to generate IaC templates, shell scripts, and more, directly from the terminal using natural language prompts. This eliminates the need to manually write and review code, making the process faster and less error-prone.

For example, when creating a Dockerfile for a Node.js application with security best practices in mind, simply describing the requirements in natural language allows AIaC to generate a secure Dockerfile: 

```aiac dockerfile for nodejs with comments```

What’s great about this approach is that it extends to generating Kubernetes manifests, Helm charts, and even policy configurations in Rego for Open Policy Agent (OPA)––with the growing number of config languages and domain-expertise required, this significantly reduces the learning curve and barrier to entry. The ability to re-prompt and refine the output ensures precisely the configuration needed, tailored to a specific environment.

However, working directly with a model like GPT via a browser isn't always efficient, especially in a production environment. That’s why AIaC was developed as a CLI, making it easy to integrate AI-driven code generation into existing workflows.

Use Case 2: Diagnosing and Resolving Kubernetes Issues with k8sGPT

While generating code is a powerful use of AI, diagnosing and resolving issues in complex systems like Kubernetes can, at times, be even more valuable. This is where k8sGPT comes in. Developed by Alex Jones, a long-standing contributor and advocate in the CNCF community, k8sGPT is an open-source tool that leverages AI to analyze and diagnose issues within Kubernetes clusters.

Running k8sGPT is as simple as issuing a command from the terminal, similar to AIaC. The tool connects to the Kubernetes cluster, identifies problems, and uses AI to provide human-readable explanations and potential fixes. For example, if a pod is stuck in a pending state, k8sGPT can analyze the situation and suggest corrective actions, such as modifying an affinity selector or adjusting resource limits.

This AI-driven approach significantly reduces the time and expertise required to troubleshoot Kubernetes issues, building upon known and common issues. It empowers even those without deep Kubernetes knowledge to manage and maintain clusters effectively, all while learning from the AI's explanations and suggestions now that K8s has been around for a decade, and many challenges have been written about and resolved.

The Future of AI in DevOps

The use of AI in DevOps is still in its early stages––but quickly gaining momentum with new open source and commercial services being introduced constantly.  The rapid pace of innovation suggests that AI will soon be embedded in pretty much every tool used in some way or another. From automated code generation with AIaC to advanced diagnostics with k8sGPT, the possibilities are endless.

Firefly is not just observing this revolution—it's actively contributing to it. By integrating AI into DevOps workflows, teams can work smarter, not harder. Whether through open-source projects like AIaC, or adopting AI-driven diagnostics in Kubernetes, a future is being paved where AI is an indispensable part of the DevOps toolkit.

As these tools continue to evolve, we can’t forget security and privacy concerns. We sometimes forget that our GenAI tools are third-party tools, and ensuring that sensitive (internal or customer) data isn't leaked during interactions with AI models is crucial, particularly when using free or experimental versions of AI tools. Always opt for paid versions or API-based integrations that offer more control over data privacy.

Bringing it All Together

AI is no longer just a buzzword; it's a practical, powerful tool that can drive significant efficiencies in DevOps. By embracing AI-powered tools like AIaC and k8sGPT, friction in workflows can be reduced, team productivity can be boosted, and organizations can stay ahead of the curve in an increasingly competitive landscape.

The era of AI-driven DevOps is here. Let AI be the assistant that powers the next wave of innovation. I predict that three years from now AI will have taken over the world like Skynet. 

What do you think?

‍