### Install RubixKube Observer Source: https://docs.rubixkube.ai/environments/aws Run this command on the machine where you want to install the Observer. It downloads and executes the installation script. ```bash curl -fsSL https://api.rubixkube.ai/install/observer.sh | bash -s -- --api-key=rk_YOUR_API_KEY ``` -------------------------------- ### Initial Cluster Cost Overview Queries Source: https://docs.rubixkube.ai/tutorials/chat-cost-analysis Start by asking for a general cost estimate and infrastructure summary to get a high-level view of your cluster's expenses. ```text "What's my cluster cost estimate?" "Show me infrastructure summary" ``` -------------------------------- ### Install RubixKube Observer on KIND Source: https://docs.rubixkube.ai/environments/kubernetes Create a KIND cluster and then apply the Observer installation manifest. This is useful for local development and evaluation. ```bash kind create cluster --name rubixkube-test kubectl apply -f "https://api.rubixkube.ai/install/observer.yaml?apiKey=rk_YOUR_API_KEY" ``` -------------------------------- ### Example Troubleshooting Conversation Source: https://docs.rubixkube.ai/tutorials/chat-troubleshooting This example demonstrates a multi-turn conversation for diagnosing a pod failure, from initial query to applying a fix. ```text You: "Why did memory-hog-demo fail?" Agent: [Provides RCA: OOMKilled due to 50Mi limit] You: "Why was the limit set to 50Mi?" Agent: [Checks pod spec: "That's what was configured in the YAML"] You: "What's a good limit for stress containers?" Agent: [Suggests 150Mi with 50% buffer] You: "Show me how to apply that" Agent: [Provides kubectl command or YAML patch] ``` -------------------------------- ### Ask for Comparisons Source: https://docs.rubixkube.ai/tutorials/chat-advanced Provides examples of queries to compare resource usage or versions between different services or deployments. ```text "Compare memory usage: dev vs. prod" "Which uses more CPU: api-gateway or checkout?" "Show me the diff between v1.2 and v1.3" ``` -------------------------------- ### Install RubixKube Observer Source: https://docs.rubixkube.ai/environments/kubernetes Apply the Observer installation manifest to your Kubernetes cluster. Ensure you use the API key from your RubixKube workspace. ```bash kubectl apply -f "https://api.rubixkube.ai/install/observer.yaml?apiKey=rk_YOUR_API_KEY" ``` -------------------------------- ### Summarize Production Health Source: https://docs.rubixkube.ai/cli/examples Start your day with a single prompt against production to get a summary of its health. This can be aliased in your shell startup file for convenience. ```bash rubix chat --prompt "Summarise production health: open incidents, pending actions, deployments in the last 12 hours." ``` ```bash # In ~/.zshrc or ~/.bashrc alias morning-health='rubix chat --prompt "Summarise production health: open incidents, pending actions, deployments in the last 12 hours."' ``` -------------------------------- ### SKILL.md File Format Example Source: https://docs.rubixkube.ai/using/skills This is an example of the SKILL.md file format, which includes YAML frontmatter for metadata and a markdown body for instructions. Ensure your skill files adhere to this structure for proper validation. ```markdown --- name: my-custom-skill description: A clear description of what this skill does and when to use it. allowed-tools: tool_one tool_two tool_three --- ## Instructions Step 1: Do the first thing Action: Describe what to do Tool: tool_one Step 2: Do the next thing Action: Describe the follow-up action Tool: tool_two ``` -------------------------------- ### Afternoon Pre-Deployment Workflow Source: https://docs.rubixkube.ai/tutorials/chat-advanced A streamlined workflow for validating and initiating deployments. Includes risk assessment and monitoring setup. ```text "Status of payment-service?" → Current state, recent issues [Upload new-deployment.yaml] "Validate this" → Security, resource, config checks "What's the risk?" → Blast radius analysis "Deploying now - monitor it" → Agent watches for issues ``` -------------------------------- ### Install Rubix CLI Globally with Yarn or pnpm Source: https://docs.rubixkube.ai/cli/installation Alternative methods for global installation using Yarn or pnpm package managers. ```bash yarn global add @rubixkube/rubix # or pnpm add -g @rubixkube/rubix ``` -------------------------------- ### Right-Sizing Guidance Queries Source: https://docs.rubixkube.ai/tutorials/chat-cost-analysis Get specific recommendations for optimal CPU and memory limits for common applications like Nginx or Redis, or based on a pod's image. ```text "What's a good memory limit for nginx?" "How much CPU does Redis typically need?" "Recommend optimal limits based on my pod's image" ``` -------------------------------- ### Install Rubix CLI Globally with npm Source: https://docs.rubixkube.ai/cli/installation Recommended method for installing the Rubix CLI globally. Requires Node.js 18 or later. ```bash npm install -g @rubixkube/rubix ``` -------------------------------- ### Install Observer Agent Source: https://docs.rubixkube.ai/support/troubleshooting Apply the Observer agent configuration to register a new cluster. Ensure you replace YOUR_KEY with your actual API key. ```bash kubectl apply -f "https://api.rubixkube.ai/install/observer.yaml?apiKey=YOUR_KEY" ``` -------------------------------- ### Structured Skill Instructions Source: https://docs.rubixkube.ai/using/skills Example of how to structure skill instructions using clear, step-by-step formatting. Each step includes an action and the specific tool to be used. ```text Step 1: Obtain High-Level Cluster Overview Action: Begin by getting a broad snapshot of the entire cluster's state. Tool: fetch_infrastructure_snapshot Step 2: Analyze Resource Health Action: Identify any resources in error, warning, or degraded states. Tool: analyze_kubernetes_resources ``` -------------------------------- ### Describe Newly Created EC2 Instances Source: https://docs.rubixkube.ai/environments/aws List EC2 instances tagged as 'observer' that were provisioned by the installer. This helps verify the creation and status of a fresh EC2 instance. ```bash aws ec2 describe-instances \ --filters "Name=tag:rubixkube,Values=observer" \ --query 'Reservations[].Instances[].{ID:InstanceId,Status:State.Name,Name:Tags[?Key==`Name`]|[0].Value}' ``` -------------------------------- ### Kubernetes Concept Learning Query Source: https://docs.rubixkube.ai/tutorials/chat-advanced Use this query to deepen your understanding of Kubernetes concepts by requesting explanations with real-world examples from your cluster. ```bash "Explain [concept] with examples from my cluster" ``` -------------------------------- ### Install and use Node.js LTS with nvm Source: https://docs.rubixkube.ai/cli/troubleshooting If you use nvm (Node Version Manager), this command installs and switches to the latest LTS Node.js version, which is recommended for the Rubix CLI. ```bash # With nvm nvm install --lts nvm use --lts ``` -------------------------------- ### Multi-line Query Example Source: https://docs.rubixkube.ai/tutorials/chat-advanced Use Shift+Enter to create multi-line queries for complex questions, allowing for more detailed or structured input. ```bash Shift+Enter ``` -------------------------------- ### Typical Questions for ImagePullBackOff Source: https://docs.rubixkube.ai/tutorials/chat-troubleshooting Example questions to ask Chat when a pod is in ImagePullBackOff state, helping to diagnose image pulling issues. ```text "What's wrong with broken-image-demo?" "Why can't it pull the image?" "Show me the events for broken-image-demo" ``` -------------------------------- ### Ask RubixKube a question in Teams Source: https://docs.rubixkube.ai/integrations/microsoft-teams Mention the bot with a question to get information about your infrastructure. Replies will be posted in the same thread. ```text @RubixKube what is the current health of the payments service? ``` -------------------------------- ### Example Agent Response for Pod Logs Source: https://docs.rubixkube.ai/tutorials/chat-troubleshooting Illustrates the agent's output after retrieving and analyzing pod logs, highlighting key messages and explaining the root cause of the issue. ```text Recent logs from memory-hog-demo: dispatching hogs: 0 cpu, 0 io, 1 vm, 0 hdd stress: info: [1] dispatching hogs: 0 cpu, 0 io, 1 vm, 0 hdd stress: dbug: [1] using backoff sleep of 3000us stress: dbug: [1] setting mem-stress worker 1 forked This shows the container is intentionally consuming memory ("1 vm"), which is causing it to exceed the 50Mi limit and get OOMKilled. ``` -------------------------------- ### Complete Conversation Summary - Initial Queries Source: https://docs.rubixkube.ai/tutorials/chat-cost-analysis This section summarizes the initial queries used in a complete cost analysis conversation, starting with cluster-wide estimates. ```text 1. "What's my cluster cost estimate?" 2. "Show me infrastructure summary and cost reduction" 3. "Which pods are most expensive?" 4. "How can I reduce costs for heavy-app-1 and heavy-app-2?" ``` -------------------------------- ### Get Help for Commands Source: https://docs.rubixkube.ai/cli/commands The --help flag can be used to print help information for any command. This is useful for understanding command usage and available options. ```bash rubix --help rubix chat --help rubix model --help ``` -------------------------------- ### Example Chat Queries Source: https://docs.rubixkube.ai/tutorials/chat-basics These are examples of natural language questions you can ask the SRI Agent to get infrastructure intelligence. ```natural-language "What pods are failing?" "Why is memory-hog-demo crashing?" "Show me resource usage" ``` -------------------------------- ### Example Questions for Chat Integration Source: https://docs.rubixkube.ai/using/insights Examples of questions you can ask the AI Chat based on incident context provided from Insights. ```text "Explain this incident in simple terms" "How do I implement recommendation #1?" "Has this pod failed before?" "What are similar incidents in the past?" ``` -------------------------------- ### Start Rubix CLI Chat Source: https://docs.rubixkube.ai/cli/commands Starts an interactive chat session. Can be used to resume an existing session or pre-send a prompt. ```bash rubix chat [options] ``` -------------------------------- ### Monthly Cost Optimization Routine - Week 1 Query Source: https://docs.rubixkube.ai/tutorials/chat-cost-analysis Begin the monthly routine by identifying all over-provisioned pods to pinpoint areas for potential cost savings. ```text "Show me all over-provisioned pods" ``` -------------------------------- ### Junior Developer Learning Queries Source: https://docs.rubixkube.ai/tutorials/chat-advanced Ask these questions to learn about Kubernetes concepts and your cluster's applications. The agent explains concepts using your cluster's context. ```text "What is a pod?" "Explain CrashLoopBackOff in simple terms" "Why does Kubernetes kill OOM pods?" "What's the difference between Deployment and Pod?" "How do resource limits work?" ``` ```text "What applications are deployed here?" "How does payment-service connect to the database?" "What technologies are we using?" "Show me an example of a healthy pod" ``` ```text "If I delete this pod, what happens?" "What would breaking this service impact?" "Is it safe to restart api-gateway?" ``` -------------------------------- ### Verify Rubix CLI Installation Source: https://docs.rubixkube.ai/cli/installation Command to check the installed version of the Rubix CLI. Ensure your global npm bin directory is in your PATH if the command is not found. ```bash rubix --version ``` -------------------------------- ### Start Rubix CLI Chat with Prompt Source: https://docs.rubixkube.ai/cli/commands Starts an interactive chat session and immediately sends a predefined prompt. This mode is non-interactive when a session ID is also provided. ```bash rubix chat --prompt "What is the health of production?" ``` -------------------------------- ### Example Monitoring Questions for Chat Source: https://docs.rubixkube.ai/tutorials/monitor-infrastructure-health Use these prompts to quickly query monitoring data via the Chat interface. They help in understanding recent changes, identifying high-error resources, checking resource utilization, and tracking deployment issues. ```text What changed in the payments service in the last hour? Which resources have the highest error rate today? Any hosts above 80% memory right now? Show me deployments that rolled back in the last 24 hours. ``` -------------------------------- ### Evening Post-Deploy Check Workflow Source: https://docs.rubixkube.ai/tutorials/chat-advanced Verify the stability and performance of a new deployment in the evening. This check takes about 1 minute. ```text "How's the new payment-service?" → Pod status, errors, metrics "Resource usage vs. old version?" → Before/after comparison "Any regressions?" → Error rate, latency check ``` -------------------------------- ### Install Node.js LTS with Homebrew Source: https://docs.rubixkube.ai/cli/troubleshooting If your Node.js version is older than 18, you may need to upgrade. This command shows how to install the latest LTS version using Homebrew on macOS. ```bash # macOS with Homebrew brew install node@20 ``` -------------------------------- ### Update Rubix CLI Globally Source: https://docs.rubixkube.ai/cli/installation Command to update the globally installed Rubix CLI to the latest version. ```bash npm update -g @rubixkube/rubix ``` -------------------------------- ### Ask Your First Question in RubixKube Source: https://docs.rubixkube.ai/getting-started/quickstart Once your environment is healthy, use the Chat feature to ask operational questions about your services and resources. Examples include checking service health, identifying restarted resources, or monitoring host resource utilization. ```text What is the health of the payments service? Which resources restarted most in the last 24 hours? Any hosts running above 80% memory right now? ``` -------------------------------- ### Launch Rubix CLI Source: https://docs.rubixkube.ai/cli/usage Launch the Rubix CLI. The first run prompts for sign-in via device-code flow. ```bash rubix ``` -------------------------------- ### Enable Required GCP APIs Source: https://docs.rubixkube.ai/environments/gcp Manually enable essential Google Cloud APIs if they were not enabled during the initial installer run. ```bash gcloud services enable compute.googleapis.com container.googleapis.com \ sqladmin.googleapis.com monitoring.googleapis.com logging.googleapis.com \ run.googleapis.com cloudfunctions.googleapis.com ``` -------------------------------- ### Uninstall Rubix CLI Globally Source: https://docs.rubixkube.ai/cli/installation Command to remove the globally installed Rubix CLI. Local authentication credentials are not affected. ```bash npm uninstall -g @rubixkube/rubix ``` -------------------------------- ### Example Conversation Flow for Pod Troubleshooting Source: https://docs.rubixkube.ai/tutorials/chat-troubleshooting Demonstrates a natural language conversation to identify and analyze failing pods. The agent maintains context, allowing follow-up questions without repeating pod names. ```text You: "Show me all failing pods in rubixkube-tutorials" Agent: [Lists 3 failing pods] You: "Tell me about the memory one" ↑ Agent knows you mean memory-hog-demo Agent: [Provides OOMKilled analysis] You: "What about the crash-loop one?" ↑ Still in same namespace context Agent: [Analyzes crash-loop-demo] You: "And the image pull issue?" ↑ Agent infers broken-image-demo Agent: [Explains ImagePullBackOff] ``` -------------------------------- ### Pod Optimization Planning Queries Source: https://docs.rubixkube.ai/tutorials/chat-cost-analysis Ask for specific recommendations on how to reduce costs for identified pods, including optimal CPU and memory limits based on application type. ```text "How can I reduce costs for [pod-name]?" "What's a good CPU/memory limit for [application-type]?" "Compare my allocation to best practices" ``` -------------------------------- ### Pod Failure Troubleshooting Queries Source: https://docs.rubixkube.ai/tutorials/chat-troubleshooting Diagnose why a specific pod is failing, get error messages, and root cause analysis. ```shell "Why is [pod-name] failing?" "What's wrong with [pod-name]?" "Diagnose [pod-name]" "Show me errors for [pod-name]" ``` -------------------------------- ### Investigate a Specific Resource Source: https://docs.rubixkube.ai/cli/examples Ask a specific question about a resource to get a single-turn, cited answer directly back to your shell. ```bash rubix chat --prompt "Why is pod api-gateway-7d4b9c8f6d-abc12 in prod-eks restarting?" ``` -------------------------------- ### Traditional Kubernetes Commands Source: https://docs.rubixkube.ai/tutorials/talk-to-infra This demonstrates the series of kubectl commands typically required to gather information about a specific service, contrasting with a single natural language query. ```bash kubectl get pods -n production kubectl describe pod api-gateway-xyz kubectl logs api-gateway-xyz kubectl top pod api-gateway-xyz # five more commands, then stitch it together in your head ``` -------------------------------- ### Pre-Deploy Validation Query Source: https://docs.rubixkube.ai/tutorials/chat-advanced Upload your deployment YAML and use these prompts to validate changes and assess deployment risks before applying them. ```bash [Upload deployment.yaml] "Validate this" "What's the risk?" ``` -------------------------------- ### Create Query Templates for Daily Use Source: https://docs.rubixkube.ai/tutorials/chat-advanced Save frequently used queries as templates for quick access. Paste and run these templates daily for routine checks. ```text Daily health: "Cluster status + incidents?" Pre-deploy: "Validate [service] for deploy" Post-deploy: "How's [service] after deploy?" Triage: "Show HIGH severity issues" ``` -------------------------------- ### Post-Optimization Verification Queries Source: https://docs.rubixkube.ai/tutorials/chat-cost-analysis After applying changes, use these queries to verify resource usage, confirm cost reductions, and check for any performance issues. ```text "Show me current resource usage for [pod-name]" "Did we reduce costs successfully?" "What's our new monthly estimate?" ``` -------------------------------- ### Troubleshooting OOMKilled Pod Logs Source: https://docs.rubixkube.ai/tutorials/chat-troubleshooting Example log output from a pod experiencing memory issues, indicating high memory consumption. ```text dispatching hogs: 0 cpu, 0 io, 1 vm, 0 hdd ```