Code Monkey home page Code Monkey logo

kubespy's Introduction

kubespy: tools for observing Kubernetes resources in real time

What happens when you boot up a Pod? What happens to a Service before it is allocated a public IP address? How often is a Deployment's status changing?

kubespy is a small tool that makes it easy to observe how Kubernetes resources change in real time, derived from the work we did to make Kubernetes deployments predictable in Pulumi's CLI. Run kubespy at any point in time, and it will watch and report information about a Kubernetes resource continuously until you kill it.

Examples

kubespy trace deployment nginx will "trace" the complex changes a complex Kubernetes resource makes in the cluster (in this case, a Deployment called nginx), and aggregate them into a high-level summary, which is updated in real time.

Changes

kubespy status v1 Pod nginx will wait for a Pod called nginx to be created, and then continuously emit changes made to its .status field, as syntax-highlighted JSON diffs:

Changes

Installation

You can install kubespy in the following ways:

Homebrew (Mac)

Prerequisite: homebrew

brew install kubespy

Binary

Get the latest release, rename it to kubespy, run chmod +x kubespy to make it executable and move it in your path (can be /usr/local/bin).

Kubectl Plugin

Prerequisite: kubectl v1.12.0 or later

With kubectl v1.12.0 introducing easy pluggability of external functions, kubespy can be invoked as kubectl spy just by renaming it to kubectl-spy and having it available in your path.

via Golang

Prerequisite: Go version 1.19 or later

go install github.com/pulumi/kubespy@latest

Usage

kubespy has four commands:

  • status <apiVersion> <kind> [<namespace>/]<name>, which in real time emits all changes made to the .status field of an arbitrary Kubernetes resource, as a JSON diff.
  • changes <apiVersion> <kind> [<namespace>/]<name>, which in real time emits all changes to any field in a Kubernetes resource, as a JSON diff.
  • trace <kind> [<namespace>/]<name>, which "traces" the changes a complex Kubernetes resource makes throughout a cluster, and aggregates them into a high-level summary, which is updated in real time.
  • record <apiVersion> <kind> [<namespace>/]<name>, which in real time emits all changes to any field in a Kubernetes resource, as a JSON array.

Several more commands are planned as well.

Examples

For a concrete example you can run using either Pulumi CLI or kubectl, check out examples/trivial-pulumi-example.

Features

  • Supports any resources the API server knows about, including CRDs (i.e., uses the discovery client to discover the available API resources, and allows users to query any of them).
  • Displays changes to API objects in real time.
  • Supports case-insensitive aliases (e.g. kubespy status v1 pod <name> instead of kubespy status v1 Pod <name>).
  • Supports status updates from regex and/or fuzzy matching (i.e., make it easy to watch the status of Pods generated by Deployments and ReplicaSets).

kubespy's People

Contributors

hausdorff avatar stack72 avatar dependabot[bot] avatar liftedkilt avatar lblackstone avatar nikopen avatar mikhailshilkov avatar hlihhovac avatar hatappi avatar suda avatar guettli avatar svend avatar muffl0n avatar chughpiyush avatar nicks avatar mjeffryes avatar kimtore avatar johscheuer avatar joseph-norman avatar joeduffy avatar iwahbe avatar gliptak avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.