{"id":31897,"date":"2026-08-04T12:58:44","date_gmt":"2026-08-04T07:28:44","guid":{"rendered":"https:\/\/opstree.com\/blog\/?p=31897"},"modified":"2026-08-04T12:58:44","modified_gmt":"2026-08-04T07:28:44","slug":"k8sgpt-kubernetes-operator-ai-diagnostics","status":"publish","type":"post","link":"https:\/\/opstree.com\/blog\/k8sgpt-kubernetes-operator-ai-diagnostics\/","title":{"rendered":"K8sGPT as a Kubernetes Operator: Automated AI-Powered K8s Cluster Diagnostics"},"content":{"rendered":"<p><span data-contrast=\"auto\">In the previous part<\/span><span data-contrast=\"auto\">\u00a0of this series, we explored\u00a0<\/span><a href=\"https:\/\/opstree.com\/blog\/running-k8sgpt-with-local-llm\/\" target=\"_blank\" rel=\"noopener\"><b><span data-contrast=\"auto\">K8sGPT as a CLI tool<\/span><\/b><\/a><span data-contrast=\"auto\">, where we manually executed diagnostics to identify Kubernetes issues and receive AI-generated explanations and remediation suggestions.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">While the CLI approach is lightweight and excellent for learning and on-demand troubleshooting, it has one major limitation: <\/span><b><span data-contrast=\"auto\">it requires a human to trigger the analysis every time<\/span><\/b><span data-contrast=\"auto\">.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Production Kubernetes environments are highly dynamic. New Pods are created constantly, Deployments are updated frequently, and configuration changes can introduce unexpected failures at any time. In such environments, we need a system that continuously watches the cluster, automatically detects issues, and integrates with existing monitoring platforms.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><span class=\"TextRun SCXW68844432 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW68844432 BCX0\">This is where the\u00a0<\/span><\/span><span class=\"TextRun SCXW68844432 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW68844432 BCX0\">K8sGPT Operator<\/span><\/span><span class=\"TextRun SCXW68844432 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW68844432 BCX0\">\u00a0comes into the picture.<\/span><\/span><span class=\"EOP Selected SCXW68844432 BCX0\" data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<h2 aria-level=\"1\"><span data-contrast=\"none\">What is the K8sGPT Operator?<\/span><span data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;335559738&quot;:360,&quot;335559739&quot;:80}\">\u00a0<\/span><\/h2>\n<p><span data-contrast=\"auto\">The K8sGPT Operator brings AI-powered Kubernetes diagnostics directly into the cluster using the Kubernetes Operator pattern.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Instead of running k8sgpt analyze manually, the operator continuously manages K8sGPT workloads through Kubernetes Custom Resources (CRDs). Administrators define what should be analyzed using YAML manifests, and the operator ensures that K8sGPT runs according to this desired configuration.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><strong>This enables:\u00a0<\/strong><\/p>\n<ul>\n<li><span data-contrast=\"auto\">Automated cluster-wide diagnostics\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335559738&quot;:0,&quot;335559739&quot;:0}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">Continuous health analysis\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335559738&quot;:0,&quot;335559739&quot;:0}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\"><a href=\"https:\/\/opstree.com\/blog\/the-future-of-generative-ai-emerging-trends-and-whats-next\/\" target=\"_blank\" rel=\"noopener\">AI-generated<\/a> explanations and remediation recommendations\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335559738&quot;:0,&quot;335559739&quot;:0}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">Integration with monitoring systems such as Prometheus and Grafana\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335559738&quot;:0,&quot;335559739&quot;:0}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">Easier adoption in production environments\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335559738&quot;:0,&quot;335559739&quot;:0}\">\u00a0<\/span><\/li>\n<\/ul>\n<h2 aria-level=\"1\"><span data-contrast=\"none\">K8sGPT Operator Architecture<\/span><span data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;335559738&quot;:360,&quot;335559739&quot;:80}\">\u00a0<\/span><\/h2>\n<p><span data-contrast=\"auto\">The K8sGPT Operator acts as the bridge between Kubernetes resources, the AI diagnostic engine, and observability tools.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">The architecture consists of the following components:<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<h3><span data-contrast=\"none\">1. Custom Resource Definition (CRD)<\/span><\/h3>\n<p><span data-contrast=\"auto\">The K8sGPT CRD extends Kubernetes with a new resource type called K8sGPT.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Using this resource, users can declaratively specify:<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<ul>\n<li><span data-contrast=\"auto\">Which AI backend should be used\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335559738&quot;:0,&quot;335559739&quot;:0}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">Which Kubernetes resources should be analyzed\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335559738&quot;:0,&quot;335559739&quot;:0}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">Model configuration\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335559738&quot;:0,&quot;335559739&quot;:0}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">Analysis behavior and filtering options\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335559738&quot;:0,&quot;335559739&quot;:0}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><span data-contrast=\"auto\">The desired configuration is stored as Kubernetes YAML, following the standard Kubernetes declarative model.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<h3><span data-contrast=\"none\">2. K8sGPT Operator<\/span><\/h3>\n<p><span data-contrast=\"auto\">The operator continuously watches the <a href=\"https:\/\/opstree.com\/blog\/what-is-kubernetes-api\/\" target=\"_blank\" rel=\"noopener\">Kubernetes API<\/a> for changes to K8sGPT Custom Resources.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Its responsibilities include:<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<ul>\n<li><span data-contrast=\"auto\">Creating and managing K8sGPT diagnostic workloads\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335559738&quot;:0,&quot;335559739&quot;:0}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">Ensuring the actual cluster state matches the desired state\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335559738&quot;:0,&quot;335559739&quot;:0}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">Collecting analysis results\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335559738&quot;:0,&quot;335559739&quot;:0}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">Exposing Prometheus-compatible metrics\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335559738&quot;:0,&quot;335559739&quot;:0}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">Managing integrations with external <a href=\"https:\/\/opstree.com\/blog\/clickhouse-for-devops-monitoring\/\" target=\"_blank\" rel=\"noopener\">observability<\/a> systems\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335559738&quot;:0,&quot;335559739&quot;:0}\">\u00a0<\/span><\/li>\n<\/ul>\n<h3><span data-contrast=\"none\">3. K8sGPT Diagnostic Deployment<\/span><\/h3>\n<p><span data-contrast=\"auto\">The K8sGPT deployment is the AI-powered diagnostic engine.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">It communicates with the Kubernetes API Server to gather information about cluster resources such as:<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<ul>\n<li><span data-contrast=\"auto\">Pods\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335559738&quot;:0,&quot;335559739&quot;:0}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">Deployments\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335559738&quot;:0,&quot;335559739&quot;:0}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">Services\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335559738&quot;:0,&quot;335559739&quot;:0}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">StatefulSets\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335559738&quot;:0,&quot;335559739&quot;:0}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">Events\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335559738&quot;:0,&quot;335559739&quot;:0}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><span data-contrast=\"auto\">It then analyzes this information using the configured AI model to\u00a0identify\u00a0problems and suggest\u00a0possible solutions.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<h3><span data-contrast=\"none\">4. Kubernetes API Server<\/span><\/h3>\n<p><span data-contrast=\"auto\">The Kubernetes API Server provides the real-time state of the cluster.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">K8sGPT queries the API server to collect resource information, detect anomalies and understand the current health of Kubernetes objects.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<h3><span data-contrast=\"none\">5. Prometheus and Grafana Integration<\/span><\/h3>\n<p><span data-contrast=\"auto\">The operator exposes metrics that can be scraped by <a href=\"https:\/\/opstree.com\/blog\/prometheus-the-prom-king-part-2\/\" target=\"_blank\" rel=\"noopener\">Prometheus<\/a>.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">These metrics can be:<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<ul>\n<li><span data-contrast=\"auto\">Visualized using Grafana dashboards\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335559738&quot;:0,&quot;335559739&quot;:0}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">Used for alerting rules\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335559738&quot;:0,&quot;335559739&quot;:0}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">Integrated into existing observability workflows\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335559738&quot;:0,&quot;335559739&quot;:0}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><span data-contrast=\"auto\">This allows AI-generated cluster insights to become part of the standard monitoring pipeline.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<h2 aria-level=\"3\"><span data-contrast=\"none\">K8sGPT Operator &#8211; Step-by-Step Workflow<\/span><span data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;335559738&quot;:160,&quot;335559739&quot;:80}\">\u00a0<\/span><\/h2>\n<p><span data-contrast=\"auto\">Here&#8217;s\u00a0how the\u00a0K8sGPT\u00a0Operator works from the moment you define your intent to the time you get Al-powered insights and automated actions.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-31900\" src=\"https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page4_img1-1024x604.png\" alt=\"\" width=\"1024\" height=\"604\" srcset=\"https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page4_img1-1024x604.png 1024w, https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page4_img1-300x177.png 300w, https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page4_img1-768x453.png 768w, https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page4_img1.png 1299w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<h3 aria-level=\"3\"><span data-contrast=\"none\">Deploy Ollama in Kubernetes<\/span><span data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;335559738&quot;:160,&quot;335559739&quot;:80}\">\u00a0<\/span><\/h3>\n<p><span data-contrast=\"auto\">Since we will be using a\u00a0<\/span><b><span data-contrast=\"auto\">local LLM<\/span><\/b><span data-contrast=\"auto\">\u00a0for K8sGPT analysis, we need to deploy\u00a0<\/span><b><span data-contrast=\"auto\">Ollama<\/span><\/b><span data-contrast=\"auto\">\u00a0inside the Kubernetes cluster. In the\u00a0previous\u00a0part of this series, we already deployed Ollama while configuring K8sGPT CLI. However, if you are directly starting with the K8sGPT Operator setup, you must deploy Ollama before configuring K8sGPT.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><b><span data-contrast=\"auto\">Ollama<\/span><\/b><span data-contrast=\"auto\">\u00a0is a lightweight tool that allows you to\u00a0<\/span><b><span data-contrast=\"auto\">download, manage, and run Large Language Models (LLMs) locally<\/span><\/b><span data-contrast=\"auto\">.<\/span><\/p>\n<p><span data-contrast=\"auto\">Create a file called:\u00a0<strong>ollama.yaml<\/strong><\/span><strong>\u00a0<\/strong><\/p>\n<p><span data-contrast=\"auto\">And add the below manifest to the file:<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<div style=\"margin: 25px 0;\">\n<pre style=\"background: #1e1e1e !important; color: #d4d4d4 !important; padding: 20px; border-radius: 8px; overflow-x: auto; font-family: Consolas,'Courier New',monospace; font-size: 14px; line-height: 1.7; border: 1px solid #2d2d2d; white-space: pre;\"><code style=\"background: transparent !important; color: inherit !important; padding: 0 !important; margin: 0 !important; border: none !important; box-shadow: none !important;\">apiVersion: v1\r\nkind: Namespace\r\nmetadata:\r\n  name: ollama\r\n\r\n---\r\napiVersion: v1\r\nkind: PersistentVolumeClaim\r\nmetadata:\r\n  name: ollama-storage\r\n  namespace: ollama\r\n\r\nspec:\r\n  accessModes:\r\n    - ReadWriteOnce\r\n  resources:\r\n    requests:\r\n      storage: 8Gi\r\n\r\n---\r\napiVersion: apps\/v1\r\nkind: Deployment\r\nmetadata:\r\n  name: ollama\r\n  namespace: ollama\r\n\r\nspec:\r\n  replicas: 1\r\n\r\n  selector:\r\n    matchLabels:\r\n      app: ollama\r\n\r\n  template:\r\n    metadata:\r\n      labels:\r\n        app: ollama\r\n\r\n    spec:\r\n      containers:\r\n        - name: ollama\r\n          image: ollama\/ollama:latest\r\n\r\n          imagePullPolicy: IfNotPresent\r\n\r\n          ports:\r\n            - containerPort: 11434\r\n\r\n          env:\r\n            - name: OLLAMA_KEEP_ALIVE\r\n              value: \"30m\"\r\n\r\n          resources:\r\n            requests:\r\n              memory: \"1Gi\"\r\n              cpu: \"500m\"\r\n\r\n            limits:\r\n              memory: \"2Gi\"\r\n              cpu: \"1\"\r\n\r\n          volumeMounts:\r\n            - name: ollama-storage\r\n              mountPath: \/root\/.ollama\r\n\r\n          startupProbe:\r\n            tcpSocket:\r\n              port: 11434\r\n            failureThreshold: 30\r\n            periodSeconds: 10\r\n\r\n          readinessProbe:\r\n            tcpSocket:\r\n              port: 11434\r\n            initialDelaySeconds: 5\r\n            periodSeconds: 10\r\n\r\n          livenessProbe:\r\n            tcpSocket:\r\n              port: 11434\r\n            initialDelaySeconds: 30\r\n            periodSeconds: 20\r\n\r\n      volumes:\r\n        - name: ollama-storage\r\n          persistentVolumeClaim:\r\n            claimName: ollama-storage\r\n\r\n---\r\napiVersion: v1\r\nkind: Service\r\nmetadata:\r\n  name: ollama\r\n  namespace: ollama\r\n\r\nspec:\r\n  type: ClusterIP\r\n\r\n  selector:\r\n    app: ollama\r\n\r\n  ports:\r\n    - port: 11434\r\n      targetPort: 11434<\/code><\/pre>\n<\/div>\n<h4 aria-level=\"3\"><strong>Deploy the Resources\u00a0<\/strong><\/h4>\n<div style=\"margin: 20px 0;\">\n<pre style=\"background: #1e1e1e; color: #d4d4d4; padding: 18px; border-radius: 8px; overflow-x: auto; font-family: Consolas,'Courier New',monospace; font-size: 14px; line-height: 1.6;\">kubectl apply -f ollama.yaml<\/pre>\n<\/div>\n<p><b><span data-contrast=\"auto\">Verify Deployment:<\/span><\/b><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<div style=\"margin: 20px 0;\">\n<pre style=\"background: #1e1e1e; color: #d4d4d4; padding: 18px; border-radius: 8px; overflow-x: auto; font-family: Consolas,'Courier New',monospace; font-size: 14px; line-height: 1.6;\">kubectl\u00a0get all -n ollama<\/pre>\n<\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-31901\" src=\"https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page7_img1.png\" alt=\"\" width=\"837\" height=\"198\" srcset=\"https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page7_img1.png 837w, https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page7_img1-300x71.png 300w, https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page7_img1-768x182.png 768w\" sizes=\"auto, (max-width: 837px) 100vw, 837px\" \/><\/p>\n<h4 aria-level=\"3\"><span data-contrast=\"none\">Download the\u00a0TinyLlama\u00a0Model<\/span><span data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;335559738&quot;:160,&quot;335559739&quot;:80}\">\u00a0<\/span><\/h4>\n<blockquote><p><b><span data-contrast=\"auto\">NOTE:\u00a0<\/span><\/b><em>We are using\u00a0TinyLlama\u00a0for demonstration purposes. For production environments and improved diagnostic accuracy, consider using the latest\u00a0Llama\u00a0models or other more powerful LLMs.\u00a0<\/em><\/p><\/blockquote>\n<p><b><span data-contrast=\"auto\">Access the\u00a0Ollama\u00a0container:<\/span><\/b><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<div style=\"margin: 20px 0;\">\n<pre style=\"background: #1e1e1e; color: #d4d4d4; padding: 18px; border-radius: 8px; overflow-x: auto; font-family: Consolas,'Courier New',monospace; font-size: 14px; line-height: 1.6;\">kubectl exec -it -n ollama deploy\/ollama -- sh<\/pre>\n<\/div>\n<p><b><span data-contrast=\"auto\">Pull the\u00a0TinyLlama\u00a0model:<\/span><\/b><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"none\">ollama\u00a0pull tinyllama<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-31902\" src=\"https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page8_img1-1024x225.png\" alt=\"\" width=\"1024\" height=\"225\" srcset=\"https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page8_img1-1024x225.png 1024w, https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page8_img1-300x66.png 300w, https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page8_img1-768x169.png 768w, https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page8_img1.png 1054w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p><b><span data-contrast=\"auto\">Exit the container:<\/span><\/b><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><em>exit<\/em><\/p>\n<h4 aria-level=\"1\"><span data-contrast=\"none\">Deploy Prometheus and Grafana<\/span><span data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;335559738&quot;:360,&quot;335559739&quot;:80}\">\u00a0<\/span><\/h4>\n<p><span data-contrast=\"auto\">To monitor K8sGPT metrics, install the Prometheus Kubernetes monitoring stack.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<h4 aria-level=\"2\"><span data-contrast=\"none\">Add the Prometheus Repository<\/span><span data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;335559738&quot;:160,&quot;335559739&quot;:80}\">\u00a0<\/span><\/h4>\n<p><span data-contrast=\"auto\">helm\u00a0repo\u00a0add\u00a0prometheus-community \\<\/span><br \/>\n<a href=\"https:\/\/prometheus-community.github.io\/helm-charts\" target=\"_blank\" rel=\"noopener\"><span data-contrast=\"none\">https:\/\/prometheus-community.github.io\/helm-charts<\/span><\/a><\/p>\n<p><span data-contrast=\"auto\">helm repo update<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<h4 aria-level=\"2\"><span data-contrast=\"none\">Create a Monitoring Namespace<\/span><span data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;335559738&quot;:160,&quot;335559739&quot;:80}\">\u00a0<\/span><\/h4>\n<p><span data-contrast=\"auto\">kubectl\u00a0create namespace monitoring<\/span><\/p>\n<h4 aria-level=\"2\"><span data-contrast=\"none\">Install\u00a0kube-prometheus-stack<\/span><span data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;335559738&quot;:160,&quot;335559739&quot;:80}\">\u00a0<\/span><\/h4>\n<div style=\"margin: 20px 0;\">\n<pre style=\"background: #1e1e1e; color: #d4d4d4; padding: 18px; border-radius: 8px; overflow-x: auto; font-family: Consolas,'Courier New',monospace; font-size: 14px; line-height: 1.6;\"><span data-contrast=\"auto\">helm upgrade --install\u00a0prometheus\u00a0\\<\/span>\r\n<span data-contrast=\"auto\">prometheus-community\/kube-prometheus-stack \\<\/span>\r\n<span data-contrast=\"auto\">--namespace monitoring \\<\/span>\r\n<span data-contrast=\"auto\">--set\u00a0prometheus.prometheusSpec.serviceMonitorSelectorNilUsesHelmValues=false<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/pre>\n<\/div>\n<p><span data-contrast=\"auto\">Verify the installation:<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<div style=\"margin: 20px 0;\">\n<pre style=\"background: #1e1e1e; color: #d4d4d4; padding: 18px; border-radius: 8px; overflow-x: auto; font-family: Consolas,'Courier New',monospace; font-size: 14px; line-height: 1.6;\"><span data-contrast=\"auto\">kubectl\u00a0get pods -n monitoring<\/span><\/pre>\n<\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-31903\" src=\"https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page9_img1.png\" alt=\"\" width=\"988\" height=\"138\" srcset=\"https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page9_img1.png 988w, https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page9_img1-300x42.png 300w, https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page9_img1-768x107.png 768w\" sizes=\"auto, (max-width: 988px) 100vw, 988px\" \/><\/p>\n<p><span data-contrast=\"auto\">Check the available services:<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<div style=\"margin: 20px 0;\">\n<pre style=\"background: #1e1e1e; color: #d4d4d4; padding: 18px; border-radius: 8px; overflow-x: auto; font-family: Consolas,'Courier New',monospace; font-size: 14px; line-height: 1.6;\"><span data-contrast=\"auto\">kubectl\u00a0get svc -n monitoring<\/span><\/pre>\n<\/div>\n<h4 aria-level=\"1\"><span data-contrast=\"none\">Installing the K8sGPT Operator<\/span><span data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;335559738&quot;:360,&quot;335559739&quot;:80}\">\u00a0<\/span><\/h4>\n<p><span data-contrast=\"auto\">The easiest way to install the operator is through Helm.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<h4 aria-level=\"2\"><span data-contrast=\"none\">Install Helm<\/span><span data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;335559738&quot;:160,&quot;335559739&quot;:80}\">\u00a0<\/span><\/h4>\n<div style=\"margin: 20px 0;\">\n<pre style=\"background: #1e1e1e; color: #d4d4d4; padding: 18px; border-radius: 8px; overflow-x: auto; font-family: Consolas,'Courier New',monospace; font-size: 14px; line-height: 1.6;\"><span class=\"TextRun SCXW5415535 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW5415535 BCX0\">curl -<\/span><span class=\"NormalTextRun SpellingErrorV2Themed SCXW5415535 BCX0\">fsSL<\/span><span class=\"NormalTextRun SCXW5415535 BCX0\">\u00a0-o get_helm.sh \\<\/span><\/span><span class=\"LineBreakBlob BlobObject DragDrop SCXW5415535 BCX0\"><span class=\"SCXW5415535 BCX0\">\u00a0<\/span><br class=\"SCXW5415535 BCX0\" \/><\/span><a class=\"Hyperlink SCXW5415535 BCX0\" href=\"https:\/\/raw.githubusercontent.com\/helm\/helm\/main\/scripts\/get-helm-3\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"TextRun Underlined SCXW5415535 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW5415535 BCX0\" data-ccp-charstyle=\"Hyperlink\">https:\/\/raw.githubusercontent.com\/helm\/helm\/main\/scripts\/get-helm-3<\/span><\/span><\/a><span class=\"LineBreakBlob BlobObject DragDrop SCXW5415535 BCX0\"><span class=\"SCXW5415535 BCX0\">\u00a0<\/span><br class=\"SCXW5415535 BCX0\" \/><\/span><span class=\"LineBreakBlob BlobObject DragDrop SCXW5415535 BCX0\"><span class=\"SCXW5415535 BCX0\">\u00a0<\/span><br class=\"SCXW5415535 BCX0\" \/><\/span><span class=\"TextRun SCXW5415535 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW5415535 BCX0\">chmod 700 get_helm.sh<\/span><\/span><span class=\"LineBreakBlob BlobObject DragDrop SCXW5415535 BCX0\"><span class=\"SCXW5415535 BCX0\">\u00a0<\/span><br class=\"SCXW5415535 BCX0\" \/><\/span><span class=\"LineBreakBlob BlobObject DragDrop SCXW5415535 BCX0\"><span class=\"SCXW5415535 BCX0\">\u00a0<\/span><br class=\"SCXW5415535 BCX0\" \/><\/span><span class=\"TextRun SCXW5415535 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW5415535 BCX0\">.\/get_helm.sh<\/span><\/span><\/pre>\n<\/div>\n<p><span data-contrast=\"auto\">Verify installation:<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<div style=\"margin: 20px 0;\">\n<pre style=\"background: #1e1e1e; color: #d4d4d4; padding: 18px; border-radius: 8px; overflow-x: auto; font-family: Consolas,'Courier New',monospace; font-size: 14px; line-height: 1.6;\"><span data-contrast=\"auto\">helm version<\/span><\/pre>\n<\/div>\n<h4 aria-level=\"2\"><span data-contrast=\"none\">Add the K8sGPT Helm Repository<\/span><span data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;335559738&quot;:160,&quot;335559739&quot;:80}\">\u00a0<\/span><\/h4>\n<p><span data-contrast=\"auto\">helm\u00a0repo\u00a0add k8sgpt\u00a0<\/span><a href=\"https:\/\/charts.k8sgpt.ai\/\" target=\"_blank\" rel=\"noopener\"><span data-contrast=\"none\">https:\/\/charts.k8sgpt.ai\/<\/span><\/a><\/p>\n<p><span data-contrast=\"auto\">helm repo update<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<h4 aria-level=\"2\"><span data-contrast=\"none\">Install the Operator<\/span><span data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;335559738&quot;:160,&quot;335559739&quot;:80}\">\u00a0<\/span><\/h4>\n<p><span data-contrast=\"auto\">For production environments, it is recommended to enable\u00a0additional\u00a0observability components:<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<div style=\"margin: 20px 0;\">\n<pre style=\"background: #1e1e1e; color: #d4d4d4; padding: 18px; border-radius: 8px; overflow-x: auto; font-family: Consolas,'Courier New',monospace; font-size: 14px; line-height: 1.6;\"><span data-contrast=\"auto\">helm upgrade --install release \\<\/span>\r\n<span data-contrast=\"auto\">k8sgpt\/k8sgpt-operator \\<\/span>\r\n<span data-contrast=\"auto\">-n k8sgpt-operator-system \\<\/span>\r\n<span data-contrast=\"auto\">--create-namespace \\<\/span>\r\n<span data-contrast=\"auto\">--set\u00a0interplex.enabled=true \\<\/span>\r\n<span data-contrast=\"auto\">--set\u00a0grafanaDashboard.enabled=true \\<\/span>\r\n<span data-contrast=\"auto\">--set\u00a0serviceMonitor.enabled=true<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/pre>\n<\/div>\n<p><span data-contrast=\"auto\">This enables:<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<ul>\n<li><b><span data-contrast=\"auto\">Interplex\u00a0integration<\/span><\/b><span data-contrast=\"auto\">\u00a0\u2013 Allows K8sGPT analysis results to be integrated with external monitoring and observability systems.\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335559738&quot;:0,&quot;335559739&quot;:0}\">\u00a0<\/span><\/li>\n<li><b><span data-contrast=\"auto\">Grafana dashboards<\/span><\/b><span data-contrast=\"auto\">\u00a0\u2013 Provides ready-to-use dashboards to visualize K8sGPT metrics and AI-generated cluster insights.\u00a0<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/li>\n<li><b><span data-contrast=\"auto\">Prometheus\u00a0ServiceMonitor\u00a0resources<\/span><\/b><span data-contrast=\"auto\">\u00a0\u2013 Automatically enables Prometheus to discover and scrape K8sGPT metrics for monitoring and alerting.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/li>\n<\/ul>\n<p><b><span data-contrast=\"auto\">After successfully deploying the K8sGPT Operator, verify that the k8sgpt-operator pod is running in the k8sgpt-operator-system namespace.<\/span><\/b><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">You can verify it using:<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<div style=\"margin: 20px 0;\">\n<pre style=\"background: #1e1e1e; color: #d4d4d4; padding: 18px; border-radius: 8px; overflow-x: auto; font-family: Consolas,'Courier New',monospace; font-size: 14px; line-height: 1.6;\"><span class=\"TextRun SCXW219083421 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SpellingErrorV2Themed SCXW219083421 BCX0\">kubectl<\/span><span class=\"NormalTextRun SCXW219083421 BCX0\">\u00a0get pods -n k8sgpt-operator-system<\/span><\/span><span class=\"EOP Selected SCXW219083421 BCX0\" data-ccp-props=\"{}\">\u00a0<\/span><\/pre>\n<\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-31904\" src=\"https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page10_img1-1024x151.png\" alt=\"\" width=\"1024\" height=\"151\" srcset=\"https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page10_img1-1024x151.png 1024w, https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page10_img1-300x44.png 300w, https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page10_img1-768x113.png 768w, https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page10_img1.png 1304w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<h4 aria-level=\"1\"><span data-contrast=\"none\">Configuring K8sGPT with\u00a0Ollama\u00a0as the AI Backend<\/span><span data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;335559738&quot;:360,&quot;335559739&quot;:80}\">\u00a0<\/span><\/h4>\n<p><span data-contrast=\"auto\">One of the major advantages of K8sGPT Operator is the ability to use local AI models through tools like\u00a0Ollama.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">By running the model locally, organizations can keep Kubernetes diagnostics private without sending cluster information to external AI services.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Create a K8sGPT custom resource:<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">$ vi k8sgpt-ollama.yaml\u00a0 # Create file and add below\u00a0yamls<\/span><\/p>\n<div style=\"margin: 20px 0;\">\n<pre style=\"background: #1e1e1e; color: #d4d4d4; padding: 18px; border-radius: 8px; overflow-x: auto; font-family: Consolas,'Courier New',monospace; font-size: 14px; line-height: 1.6;\"><span class=\"TextRun SCXW173303287 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SpellingErrorV2Themed SCXW173303287 BCX0\">apiVersion<\/span><span class=\"NormalTextRun SCXW173303287 BCX0\">: core.k8sgpt.ai\/v1alpha1<\/span><\/span><span class=\"LineBreakBlob BlobObject DragDrop SCXW173303287 BCX0\"><span class=\"SCXW173303287 BCX0\">\u00a0<\/span><br class=\"SCXW173303287 BCX0\" \/><\/span><span class=\"TextRun SCXW173303287 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW173303287 BCX0\">kind: K8sGPT<\/span><\/span><span class=\"LineBreakBlob BlobObject DragDrop SCXW173303287 BCX0\"><span class=\"SCXW173303287 BCX0\">\u00a0<\/span><br class=\"SCXW173303287 BCX0\" \/><\/span><span class=\"TextRun SCXW173303287 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW173303287 BCX0\">metadata:<\/span><\/span><span class=\"LineBreakBlob BlobObject DragDrop SCXW173303287 BCX0\"><span class=\"SCXW173303287 BCX0\">\u00a0<\/span><br class=\"SCXW173303287 BCX0\" \/><\/span><span class=\"TextRun SCXW173303287 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW173303287 BCX0\">\u00a0<\/span><span class=\"NormalTextRun SCXW173303287 BCX0\">\u00a0<\/span><span class=\"NormalTextRun SCXW173303287 BCX0\">name: k8sgpt-ollama<\/span><\/span><span class=\"LineBreakBlob BlobObject DragDrop SCXW173303287 BCX0\"><span class=\"SCXW173303287 BCX0\">\u00a0<\/span><br class=\"SCXW173303287 BCX0\" \/><\/span><span class=\"TextRun SCXW173303287 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW173303287 BCX0\">\u00a0<\/span><span class=\"NormalTextRun SCXW173303287 BCX0\">\u00a0<\/span><span class=\"NormalTextRun SCXW173303287 BCX0\">namespace: k8sgpt-operator-system<\/span><\/span><span class=\"LineBreakBlob BlobObject DragDrop SCXW173303287 BCX0\"><span class=\"SCXW173303287 BCX0\">\u00a0<\/span><br class=\"SCXW173303287 BCX0\" \/><\/span><span class=\"TextRun SCXW173303287 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW173303287 BCX0\">spec:<\/span><\/span><span class=\"LineBreakBlob BlobObject DragDrop SCXW173303287 BCX0\"><span class=\"SCXW173303287 BCX0\">\u00a0<\/span><br class=\"SCXW173303287 BCX0\" \/><\/span><span class=\"TextRun SCXW173303287 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW173303287 BCX0\">\u00a0<\/span><span class=\"NormalTextRun SCXW173303287 BCX0\">\u00a0<\/span><span class=\"NormalTextRun SCXW173303287 BCX0\">ai:<\/span><\/span><span class=\"LineBreakBlob BlobObject DragDrop SCXW173303287 BCX0\"><span class=\"SCXW173303287 BCX0\">\u00a0<\/span><br class=\"SCXW173303287 BCX0\" \/><\/span><span class=\"TextRun SCXW173303287 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW173303287 BCX0\">\u00a0<\/span><span class=\"NormalTextRun SCXW173303287 BCX0\">\u00a0<\/span><span class=\"NormalTextRun SCXW173303287 BCX0\">\u00a0<\/span><span class=\"NormalTextRun SCXW173303287 BCX0\">\u00a0<\/span><span class=\"NormalTextRun SCXW173303287 BCX0\">enabled: true<\/span><\/span><span class=\"LineBreakBlob BlobObject DragDrop SCXW173303287 BCX0\"><span class=\"SCXW173303287 BCX0\">\u00a0<\/span><br class=\"SCXW173303287 BCX0\" \/><\/span><span class=\"TextRun SCXW173303287 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW173303287 BCX0\">\u00a0<\/span><span class=\"NormalTextRun SCXW173303287 BCX0\">\u00a0<\/span><span class=\"NormalTextRun SCXW173303287 BCX0\">\u00a0<\/span><span class=\"NormalTextRun SCXW173303287 BCX0\">\u00a0<\/span><span class=\"NormalTextRun SCXW173303287 BCX0\">model:\u00a0<\/span><span class=\"NormalTextRun SCXW173303287 BCX0\">llama<\/span><span class=\"NormalTextRun SCXW173303287 BCX0\">3<\/span><span class=\"NormalTextRun SCXW173303287 BCX0\">\u00a0#\u00a0<\/span><span class=\"NormalTextRun SCXW173303287 BCX0\">Change this with<\/span><span class=\"NormalTextRun SCXW173303287 BCX0\">\u00a0your LLM name<\/span><\/span><span class=\"LineBreakBlob BlobObject DragDrop SCXW173303287 BCX0\"><span class=\"SCXW173303287 BCX0\">\u00a0<\/span><br class=\"SCXW173303287 BCX0\" \/><\/span><span class=\"TextRun SCXW173303287 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW173303287 BCX0\">\u00a0<\/span><span class=\"NormalTextRun SCXW173303287 BCX0\">\u00a0<\/span><span class=\"NormalTextRun SCXW173303287 BCX0\">\u00a0<\/span><span class=\"NormalTextRun SCXW173303287 BCX0\">\u00a0<\/span><span class=\"NormalTextRun SCXW173303287 BCX0\">backend: localai<\/span><\/span><span class=\"LineBreakBlob BlobObject DragDrop SCXW173303287 BCX0\"><span class=\"SCXW173303287 BCX0\">\u00a0<\/span><br class=\"SCXW173303287 BCX0\" \/><\/span><span class=\"TextRun SCXW173303287 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW173303287 BCX0\">\u00a0<\/span><span class=\"NormalTextRun SCXW173303287 BCX0\">\u00a0<\/span><span class=\"NormalTextRun SCXW173303287 BCX0\">\u00a0<\/span><span class=\"NormalTextRun SCXW173303287 BCX0\">\u00a0<\/span><span class=\"NormalTextRun SpellingErrorV2Themed SCXW173303287 BCX0\">baseUrl<\/span><span class=\"NormalTextRun SCXW173303287 BCX0\">:\u00a0<\/span><\/span><a class=\"Hyperlink SCXW173303287 BCX0\" href=\"http:\/\/ollama.ollama.svc.cluster.local:11434\/v1\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"TextRun Underlined SCXW173303287 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW173303287 BCX0\" data-ccp-charstyle=\"Hyperlink\">http:\/\/ollama.ollama.svc.cluster.local:11434\/v1<\/span><\/span><\/a><span class=\"TextRun SCXW173303287 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW173303287 BCX0\">\u00a0#\u00a0<\/span><span class=\"NormalTextRun SCXW173303287 BCX0\">Change with\u00a0<\/span><span class=\"NormalTextRun SpellingErrorV2Themed SCXW173303287 BCX0\">Ollama<\/span><span class=\"NormalTextRun SCXW173303287 BCX0\">\u00a0service endpint<\/span><\/span><span class=\"LineBreakBlob BlobObject DragDrop SCXW173303287 BCX0\"><span class=\"SCXW173303287 BCX0\">\u00a0<\/span><br class=\"SCXW173303287 BCX0\" \/><\/span><span class=\"TextRun SCXW173303287 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW173303287 BCX0\">\u00a0<\/span><span class=\"NormalTextRun SCXW173303287 BCX0\">\u00a0<\/span><span class=\"NormalTextRun SpellingErrorV2Themed SCXW173303287 BCX0\">noCache<\/span><span class=\"NormalTextRun SCXW173303287 BCX0\">: false<\/span><\/span><span class=\"LineBreakBlob BlobObject DragDrop SCXW173303287 BCX0\"><span class=\"SCXW173303287 BCX0\">\u00a0<\/span><br class=\"SCXW173303287 BCX0\" \/><\/span><span class=\"TextRun SCXW173303287 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW173303287 BCX0\">\u00a0<\/span><span class=\"NormalTextRun SCXW173303287 BCX0\">\u00a0<\/span><span class=\"NormalTextRun SCXW173303287 BCX0\">repository: ghcr.io\/k8sgpt-ai\/k8sgpt<\/span><\/span><span class=\"LineBreakBlob BlobObject DragDrop SCXW173303287 BCX0\"><span class=\"SCXW173303287 BCX0\">\u00a0<\/span><br class=\"SCXW173303287 BCX0\" \/><\/span><span class=\"TextRun SCXW173303287 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW173303287 BCX0\">\u00a0<\/span><span class=\"NormalTextRun SCXW173303287 BCX0\">\u00a0<\/span><span class=\"NormalTextRun SCXW173303287 BCX0\">version: v0.3.41<\/span><\/span><span class=\"EOP SCXW173303287 BCX0\" data-ccp-props=\"{&quot;335557856&quot;:15987699}\">\u00a0<\/span><\/pre>\n<\/div>\n<p><span data-contrast=\"auto\">Apply the configuration:<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<div style=\"margin: 20px 0;\">\n<pre style=\"background: #1e1e1e; color: #d4d4d4; padding: 18px; border-radius: 8px; overflow-x: auto; font-family: Consolas,'Courier New',monospace; font-size: 14px; line-height: 1.6;\"><span data-contrast=\"auto\">kubectl\u00a0apply -f k8sgpt-ollama.yaml<\/span><\/pre>\n<\/div>\n<p><span data-contrast=\"auto\">Verify the K8sGPT resource:<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<div style=\"margin: 20px 0;\">\n<pre style=\"background: #1e1e1e; color: #d4d4d4; padding: 18px; border-radius: 8px; overflow-x: auto; font-family: Consolas,'Courier New',monospace; font-size: 14px; line-height: 1.6;\"><span data-contrast=\"auto\">kubectl\u00a0describe k8sgpt k8sgpt-ollama \\<\/span>\r\n<span data-contrast=\"auto\">-n k8sgpt-operator-system<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/pre>\n<\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-31905\" src=\"https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page11_img1-1024x427.png\" alt=\"\" width=\"1024\" height=\"427\" srcset=\"https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page11_img1-1024x427.png 1024w, https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page11_img1-300x125.png 300w, https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page11_img1-768x321.png 768w, https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page11_img1.png 1375w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<h4 aria-level=\"1\"><span data-contrast=\"none\">Verify the K8sGPT Diagnostic Pod<\/span><span data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;335559738&quot;:360,&quot;335559739&quot;:80}\">\u00a0<\/span><\/h4>\n<p><span data-contrast=\"auto\">Once the operator processes the Custom Resource, it automatically creates a K8sGPT diagnostic pod.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Check the pod:<\/span><\/p>\n<div style=\"margin: 20px 0;\">\n<pre style=\"background: #1e1e1e; color: #d4d4d4; padding: 18px; border-radius: 8px; overflow-x: auto; font-family: Consolas,'Courier New',monospace; font-size: 14px; line-height: 1.6;\"><span class=\"TextRun SCXW108471541 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SpellingErrorV2Themed SCXW108471541 BCX0\">kubectl<\/span><span class=\"NormalTextRun SCXW108471541 BCX0\">\u00a0get pods -n k8sgpt-operator-system<\/span><\/span><\/pre>\n<\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-31906\" src=\"https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page11_img2.png\" alt=\"\" width=\"954\" height=\"86\" srcset=\"https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page11_img2.png 954w, https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page11_img2-300x27.png 300w, https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page11_img2-768x69.png 768w\" sizes=\"auto, (max-width: 954px) 100vw, 954px\" \/><\/p>\n<p><strong><span class=\"TextRun SCXW157083983 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW157083983 BCX0\">Example output:<\/span><\/span><\/strong><\/p>\n<div style=\"margin: 20px 0;\">\n<pre style=\"background: #1e1e1e; color: #d4d4d4; padding: 18px; border-radius: 8px; overflow-x: auto; font-family: Consolas,'Courier New',monospace; font-size: 14px; line-height: 1.6;\"><span class=\"TextRun SCXW191874503 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW191874503 BCX0\">NAME\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 READY\u00a0\u00a0 STATUS\u00a0\u00a0\u00a0 RESTARTS\u00a0\u00a0 AGE<\/span><\/span><span class=\"LineBreakBlob BlobObject DragDrop SCXW191874503 BCX0\"><span class=\"SCXW191874503 BCX0\">\u00a0<\/span><br class=\"SCXW191874503 BCX0\" \/><\/span><span class=\"TextRun SCXW191874503 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW191874503 BCX0\">k8sgpt-ollama-66d48ccb5d-vdtwk\u00a0\u00a0\u00a0\u00a0\u00a0 1\/1\u00a0\u00a0\u00a0\u00a0 Running\u00a0\u00a0 0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2m<\/span><\/span><span class=\"EOP Selected SCXW191874503 BCX0\" data-ccp-props=\"{}\">\u00a0<\/span><\/pre>\n<\/div>\n<p><span class=\"TextRun SCXW81332500 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW81332500 BCX0\">The running pod continuously communicates with the Kubernetes API Server and performs AI-driven diagnostics.<\/span><\/span><span class=\"EOP Selected SCXW81332500 BCX0\" data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-31907\" src=\"https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page12_img1-1024x345.png\" alt=\"\" width=\"1024\" height=\"345\" srcset=\"https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page12_img1-1024x345.png 1024w, https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page12_img1-300x101.png 300w, https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page12_img1-768x258.png 768w, https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page12_img1-1536x517.png 1536w, https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page12_img1.png 1655w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<h4 aria-level=\"1\"><span data-contrast=\"none\">Viewing AI Analysis Results<\/span><span data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;335559738&quot;:360,&quot;335559739&quot;:80}\">\u00a0<\/span><\/h4>\n<p><span data-contrast=\"auto\">After K8sGPT completes its analysis, the results are stored as Kubernetes\u00a0Result\u00a0custom resources.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">You can list all generated results:<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<div style=\"margin: 20px 0;\">\n<pre style=\"background: #1e1e1e; color: #d4d4d4; padding: 18px; border-radius: 8px; overflow-x: auto; font-family: Consolas,'Courier New',monospace; font-size: 14px; line-height: 1.6;\"><span class=\"TextRun SCXW93934268 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SpellingErrorV2Themed SCXW93934268 BCX0\">kubectl<\/span><span class=\"NormalTextRun SCXW93934268 BCX0\">\u00a0get results<\/span><span class=\"NormalTextRun SCXW93934268 BCX0\">\u00a0\u2013<\/span><span class=\"NormalTextRun SCXW93934268 BCX0\">A<\/span><\/span><span class=\"EOP Selected SCXW93934268 BCX0\" data-ccp-props=\"{}\">\u00a0<\/span><\/pre>\n<\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-31908 size-full\" src=\"https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page12_img2.png\" alt=\"\" width=\"624\" height=\"104\" srcset=\"https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page12_img2.png 624w, https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page12_img2-300x50.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/p>\n<p><span class=\"TextRun SCXW239675360 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW239675360 BCX0\">To view results within the K8sGPT namespace:<\/span><\/span><span class=\"EOP Selected SCXW239675360 BCX0\" data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<div style=\"margin: 20px 0;\">\n<pre style=\"background: #1e1e1e; color: #d4d4d4; padding: 18px; border-radius: 8px; overflow-x: auto; font-family: Consolas,'Courier New',monospace; font-size: 14px; line-height: 1.6;\"><span class=\"TextRun SCXW231109926 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SpellingErrorV2Themed SCXW231109926 BCX0\">kubectl<\/span><span class=\"NormalTextRun SCXW231109926 BCX0\">\u00a0get results \\<\/span><\/span><span class=\"LineBreakBlob BlobObject DragDrop SCXW231109926 BCX0\"><span class=\"SCXW231109926 BCX0\">\u00a0<\/span><br class=\"SCXW231109926 BCX0\" \/><\/span><span class=\"TextRun SCXW231109926 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW231109926 BCX0\">-n k8sgpt-operator-system<\/span><\/span><span class=\"EOP Selected SCXW231109926 BCX0\" data-ccp-props=\"{}\">\u00a0<\/span><\/pre>\n<\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-31909\" src=\"https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page13_img1-1024x552.png\" alt=\"\" width=\"1024\" height=\"552\" srcset=\"https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page13_img1-1024x552.png 1024w, https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page13_img1-300x162.png 300w, https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page13_img1-768x414.png 768w, https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page13_img1-1536x828.png 1536w, https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page13_img1.png 1539w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-31910\" src=\"https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page13_img2-1024x344.png\" alt=\"\" width=\"1024\" height=\"344\" srcset=\"https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page13_img2-1024x344.png 1024w, https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page13_img2-300x101.png 300w, https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page13_img2-768x258.png 768w, https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page13_img2-1536x515.png 1536w, https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page13_img2.png 1657w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p><span class=\"TextRun SCXW31377786 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW31377786 BCX0\">For detailed JSON output:<\/span><\/span><\/p>\n<div style=\"margin: 20px 0;\">\n<pre style=\"background: #1e1e1e; color: #d4d4d4; padding: 18px; border-radius: 8px; overflow-x: auto; font-family: Consolas,'Courier New',monospace; font-size: 14px; line-height: 1.6;\"><span class=\"TextRun SCXW233408801 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SpellingErrorV2Themed SCXW233408801 BCX0\">kubectl<\/span><span class=\"NormalTextRun SCXW233408801 BCX0\">\u00a0get results \\<\/span><\/span><span class=\"LineBreakBlob BlobObject DragDrop SCXW233408801 BCX0\"><span class=\"SCXW233408801 BCX0\">\u00a0<\/span><br class=\"SCXW233408801 BCX0\" \/><\/span><span class=\"TextRun SCXW233408801 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW233408801 BCX0\">-n k8sgpt-operator-system \\<\/span><\/span><span class=\"LineBreakBlob BlobObject DragDrop SCXW233408801 BCX0\"><span class=\"SCXW233408801 BCX0\">\u00a0<\/span><br class=\"SCXW233408801 BCX0\" \/><\/span><span class=\"TextRun SCXW233408801 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW233408801 BCX0\">-o\u00a0<\/span><span class=\"NormalTextRun SpellingErrorV2Themed SCXW233408801 BCX0\">json<\/span><span class=\"NormalTextRun SCXW233408801 BCX0\">\u00a0|\u00a0<\/span><span class=\"NormalTextRun SpellingErrorV2Themed SCXW233408801 BCX0\">jq<\/span><span class=\"NormalTextRun SCXW233408801 BCX0\">\u00a0.<\/span><\/span><span class=\"EOP Selected SCXW233408801 BCX0\" data-ccp-props=\"{}\">\u00a0<\/span><\/pre>\n<\/div>\n<p><span data-contrast=\"auto\">The output includes:<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<ul>\n<li><span data-contrast=\"auto\">Affected Kubernetes resource\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335559738&quot;:0,&quot;335559739&quot;:0}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">Detected issue\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335559738&quot;:0,&quot;335559739&quot;:0}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">Root cause analysis\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335559738&quot;:0,&quot;335559739&quot;:0}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">AI-generated remediation recommendations\u00a0<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;335559738&quot;:0,&quot;335559739&quot;:0}\">\u00a0<\/span><\/li>\n<\/ul>\n<h4 aria-level=\"2\"><span data-contrast=\"none\">Access the Prometheus Dashboard<\/span><span data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;335559738&quot;:160,&quot;335559739&quot;:80}\">\u00a0<\/span><\/h4>\n<p><span data-contrast=\"auto\">Forward\u00a0the Prometheus service locally:<\/span><\/p>\n<div style=\"margin: 20px 0;\">\n<pre style=\"background: #1e1e1e; color: #d4d4d4; padding: 18px; border-radius: 8px; overflow-x: auto; font-family: Consolas,'Courier New',monospace; font-size: 14px; line-height: 1.6;\"><span class=\"TextRun SCXW17488160 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SpellingErrorV2Themed SCXW17488160 BCX0\">kubectl<\/span><span class=\"NormalTextRun SCXW17488160 BCX0\">\u00a0port-forward \\<\/span><\/span><span class=\"LineBreakBlob BlobObject DragDrop SCXW17488160 BCX0\"><span class=\"SCXW17488160 BCX0\">\u00a0<\/span><br class=\"SCXW17488160 BCX0\" \/><\/span><span class=\"TextRun SCXW17488160 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW17488160 BCX0\">-n monitoring \\<\/span><\/span><span class=\"LineBreakBlob BlobObject DragDrop SCXW17488160 BCX0\"><span class=\"SCXW17488160 BCX0\">\u00a0<\/span><br class=\"SCXW17488160 BCX0\" \/><\/span><span class=\"TextRun SCXW17488160 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW17488160 BCX0\">svc\/<\/span><span class=\"NormalTextRun SpellingErrorV2Themed SCXW17488160 BCX0\">prometheus-kube-prometheus-prometheus<\/span><span class=\"NormalTextRun SCXW17488160 BCX0\">\u00a0\\<\/span><\/span><span class=\"LineBreakBlob BlobObject DragDrop SCXW17488160 BCX0\"><span class=\"SCXW17488160 BCX0\">\u00a0<\/span><br class=\"SCXW17488160 BCX0\" \/><\/span><span class=\"TextRun SCXW17488160 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW17488160 BCX0\">9090:9090 \\<\/span><\/span><span class=\"LineBreakBlob BlobObject DragDrop SCXW17488160 BCX0\"><span class=\"SCXW17488160 BCX0\">\u00a0<\/span><br class=\"SCXW17488160 BCX0\" \/><\/span><span class=\"TextRun SCXW17488160 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW17488160 BCX0\">--address 0.0.0.0<\/span><\/span><span class=\"EOP Selected SCXW17488160 BCX0\" data-ccp-props=\"{}\">\u00a0<\/span><\/pre>\n<\/div>\n<p><span data-contrast=\"auto\">Now access Prometheus using:<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><a href=\"http:\/\/%3Cyour_node_ip%3E:9090\/\"><span data-contrast=\"none\">http:\/\/&lt;YOUR_NODE_IP&gt;:9090<\/span><\/a><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Prometheus can now scrape K8sGPT metrics, enabling dashboards, alerts, and deeper visibility into AI-generated cluster diagnostics.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-31911\" src=\"https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page14_img1-1024x211.png\" alt=\"\" width=\"1024\" height=\"211\" srcset=\"https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page14_img1-1024x211.png 1024w, https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page14_img1-300x62.png 300w, https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page14_img1-768x159.png 768w, https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page14_img1-1536x317.png 1536w, https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/page14_img1.png 1782w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<h2><span class=\"TextRun SCXW209058847 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW209058847 BCX0\" data-ccp-parastyle=\"heading 1\">K8sGPT CLI vs K8sGPT Operator<\/span><\/span><span class=\"EOP Selected SCXW209058847 BCX0\" data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;335559738&quot;:360,&quot;335559739&quot;:80}\">\u00a0<\/span><\/h2>\n<div style=\"overflow-x: auto; margin: 25px 0;\">\n<table style=\"width: 100%; border-collapse: collapse; min-width: 850px; font-family: Arial,Helvetica,sans-serif; font-size: 14px;\">\n<thead>\n<tr style=\"background: #f5f7fa;\">\n<th style=\"border: 1px solid #ddd; padding: 12px; text-align: left;\">Feature<\/th>\n<th style=\"border: 1px solid #ddd; padding: 12px; text-align: left;\">K8sGPT CLI<\/th>\n<th style=\"border: 1px solid #ddd; padding: 12px; text-align: left;\">K8sGPT Operator<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"border: 1px solid #ddd; padding: 12px;\">Execution Model<\/td>\n<td style=\"border: 1px solid #ddd; padding: 12px;\">Manual<\/td>\n<td style=\"border: 1px solid #ddd; padding: 12px;\">Continuous<\/td>\n<\/tr>\n<tr style=\"background: #fafafa;\">\n<td style=\"border: 1px solid #ddd; padding: 12px;\">Installation<\/td>\n<td style=\"border: 1px solid #ddd; padding: 12px;\">Local machine<\/td>\n<td style=\"border: 1px solid #ddd; padding: 12px;\">Kubernetes cluster<\/td>\n<\/tr>\n<tr>\n<td style=\"border: 1px solid #ddd; padding: 12px;\">Analysis<\/td>\n<td style=\"border: 1px solid #ddd; padding: 12px;\">On-demand<\/td>\n<td style=\"border: 1px solid #ddd; padding: 12px;\">Automated<\/td>\n<\/tr>\n<tr style=\"background: #fafafa;\">\n<td style=\"border: 1px solid #ddd; padding: 12px;\">Production Ready<\/td>\n<td style=\"border: 1px solid #ddd; padding: 12px;\">Limited<\/td>\n<td style=\"border: 1px solid #ddd; padding: 12px;\">Yes<\/td>\n<\/tr>\n<tr>\n<td style=\"border: 1px solid #ddd; padding: 12px;\">Monitoring Integration<\/td>\n<td style=\"border: 1px solid #ddd; padding: 12px;\">Manual<\/td>\n<td style=\"border: 1px solid #ddd; padding: 12px;\">Prometheus\/Grafana<\/td>\n<\/tr>\n<tr style=\"background: #fafafa;\">\n<td style=\"border: 1px solid #ddd; padding: 12px;\">Best Use Case<\/td>\n<td style=\"border: 1px solid #ddd; padding: 12px;\">Learning, debugging<\/td>\n<td style=\"border: 1px solid #ddd; padding: 12px;\">Production environments<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h2 aria-level=\"1\"><span data-contrast=\"none\">Conclusion<\/span><span data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;335559738&quot;:360,&quot;335559739&quot;:80}\">\u00a0<\/span><\/h2>\n<p><span data-contrast=\"auto\">K8sGPT significantly simplifies\u00a0Kubernetes\u00a0troubleshooting by converting complex Kubernetes failures into understandable explanations and actionable solutions.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">The CLI version is an excellent tool for developers who need quick, on-demand diagnostics. However, for production environments where failures can happen at any moment, the\u00a0<\/span><b><span data-contrast=\"auto\">K8sGPT Operator provides a far more powerful approach<\/span><\/b><span data-contrast=\"auto\">\u00a0by continuously analyzing the cluster, exposing metrics, and integrating with existing observability platforms.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">By combining\u00a0<\/span><b><span data-contrast=\"auto\">K8sGPT Operator,\u00a0Ollama, and Prometheus<\/span><\/b><span data-contrast=\"auto\">, organizations can build a completely self-hosted AI-powered Kubernetes troubleshooting platform that provides intelligent diagnostics while keeping cluster data inside their own infrastructure.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<h3>Related Searces<\/h3>\n<ul>\n<li><a href=\"https:\/\/opstree.com\/blog\/kubernetes-production-guide-architectur\/\" target=\"_blank\" rel=\"noopener\">Flagd on Kubernetes: Complete Production Guide to Architecture, Implementation and Troubleshooting<\/a><\/li>\n<li><a href=\"https:\/\/opstree.com\/blog\/kubernetes-events-monitoring-using-open-telemetry-and-loki\/\" target=\"_blank\" rel=\"noopener\">Kubernetes Events Monitoring using Open Telemetry And Loki<\/a><\/li>\n<li><a href=\"https:\/\/opstree.com\/blog\/kong-gateway-in-kubernetes\/\" target=\"_blank\" rel=\"noopener\">A Complete Traffic Flow Guide to Using Kong Gateway in Kubernetes<\/a><\/li>\n<\/ul>\n<h3>Related Solutions<\/h3>\n<ul>\n<li><a href=\"https:\/\/opstree.com\/services\/devops-and-devsecops-services\/\" target=\"_blank\" rel=\"noopener\">DevSecOps Automation Services<\/a><\/li>\n<li><a href=\"https:\/\/opstree.com\/services\/cloud-migration-and-modernization-services\/\" target=\"_blank\" rel=\"noopener\">Cloud Engineering Services<\/a><\/li>\n<li><a href=\"https:\/\/opstree.com\/services\/database-and-data-engineering\/\" target=\"_blank\" rel=\"noopener\">Data Engineering Services<\/a><\/li>\n<li><a href=\"https:\/\/opstree.com\/services\/generative-ai-solutions\/\" target=\"_blank\" rel=\"noopener\">Generative AI Solutions Provider<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>In the previous part\u00a0of this series, we explored\u00a0K8sGPT as a CLI tool, where we manually executed diagnostics to identify Kubernetes issues and receive AI-generated explanations and remediation suggestions.\u00a0 While the CLI approach is lightweight and excellent for learning and on-demand troubleshooting, it has one major limitation: it requires a human to trigger the analysis every [&hellip;]<\/p>\n","protected":false},"author":244582729,"featured_media":31913,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[768739351],"tags":[768739682,768739636,768739681,768739287],"class_list":["post-31897","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-kubernetes-2","tag-cluster-diagnostics","tag-k8sgpt","tag-kubernetes-operator","tag-prometheus"],"blocksy_meta":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/opstree.com\/blog\/wp-content\/uploads\/2026\/08\/k8sgpt.png","jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pfDBOm-8it","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/31897","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/users\/244582729"}],"replies":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/comments?post=31897"}],"version-history":[{"count":5,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/31897\/revisions"}],"predecessor-version":[{"id":31916,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/31897\/revisions\/31916"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/media\/31913"}],"wp:attachment":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/media?parent=31897"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/categories?post=31897"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/tags?post=31897"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}