GithubHelp home page GithubHelp logo

sysdiglabs / kubectl-dig Goto Github PK

View Code? Open in Web Editor NEW
385.0 11.0 15.0 13.93 MB

Deep kubernetes visibility from the kubectl

Makefile 2.45% Go 97.55%
kubectl-plugins kubernetes containers monitoring observability o11y syscalls

kubectl-dig's Introduction

kubectl dig

Deep kubernetes visibility from the kubectl.

kubectl dig logo kubectl dig
A simple, intuitive, and fully customizable UI to dig into your kubernetes clusters
kubectl dig <node>

asciicast

Install

go get -u github.com/sysdiglabs/kubectl-dig/cmd/kubectl-dig

Usage

Just dig

There's only one thing to do, provide the node name!

kubectl dig <node>

You just identify the node you want to dig in with kubectl get nodes and then provide it to the dig command!

kubectl dig ip-180-12-0-152.ec2.internal

dig + cluster metadata

By default, kubectl dig shows only information about the local node, if you want to dig from that node to the whole cluster you have to provide a service account that can read resources.

You can create a dig-viewer service account with:

kubectl apply -f https://github.com/sysdiglabs/kubectl-dig/raw/develop/docs/setup/read-serviceaccount.yml

Then you just use it with kubectl dig.

kubectl dig --serviceaccount dig-viewer 127.0.0.1

At this point you have access to the fancy cluster metadata, press F2 and look for the K8s views!

Project status

High-level todo

  • Basic functionalities;
  • Finish all the planned commands;
  • Merge here the functionalities of kubectl-capture;
  • Integration tests;
  • Errors detection on the kernel module;

Planned commands

  • run command, to execute digs;
  • list command, to list all the executed digs;
  • attach command, to attach to an existing dig that was previously detached;
  • delete command, to delete an existing dig;
  • where command, to execute digs where the chosen workloads are, instead of having to specify the node directly;

Analytics

kubectl-dig's People

Contributors

faraazkhan avatar fntlnz avatar leodido avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kubectl-dig's Issues

Installation fails on Go 1.12.5

$ go version
go version go1.12.5 darwin/amd64
$ go get -u github.com/sysdiglabs/kubectl-dig/cmd/kubectl-di
...
# k8s.io/client-go/rest
../../.asdf/installs/golang/1.12.5/packages/pkg/mod/k8s.io/[email protected]+incompatible/rest/request.go:598:31: not enough arguments in call to watch.NewStreamWatcher
        have (*versioned.Decoder)
        want (watch.Decoder, watch.Reporter)

Allow setting of tolerations

Currently this cannot run on any nodes with taints. A CLI option to heredoc in yaml/json or to load that info from a file would be really nice.

Please clarify documentation with the permissions required

I tried to used it using readonly access to the cluster, but it failed:

kubectl dig ip-172-30-224-124.us-west-2.compute.internal
jobs.batch is forbidden: User "XXX" cannot create resource "jobs" in API group "batch" in the namespace "default"

Why does it need access to create new jobs?

Broken

This tool seems to be useful to cluster admins but it is broken. It's not available in krew to install/update easily or unable to install as it giving errors in go 1.6 version. Please maintain or discontinue this useful plug-in rather unmounting for quite some time. I tired to use it multiple times but always don't work for some reason due to installation issues

go get -u github.com/sysdiglabs/kubectl-dig/cmd/kubectl-dig
go: downloading k8s.io/apimachinery v0.22.2
go: downloading k8s.io/cli-runtime v0.22.2
go: downloading k8s.io/api v0.22.2
go: downloading k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b
go: downloading k8s.io/kubernetes v1.22.2
go: downloading golang.org/x/net v0.0.0-20210929193557-e81a3d93ecf6
go: downloading cloud.google.com/go v0.97.0
go: downloading sigs.k8s.io/yaml v1.3.0
go: downloading golang.org/x/crypto v0.0.0-20210921155107-089bfa567519
go: downloading k8s.io/kube-openapi v0.0.0-20210929172449-94abcedd1aa4
go: downloading golang.org/x/sys v0.0.0-20211003122950-b1ebd4e1001c
go: downloading github.com/json-iterator/go v1.1.12
go: downloading github.com/modern-go/reflect2 v1.0.2
go get: github.com/docker/[email protected] updating to
github.com/docker/[email protected]: parsing go.mod:
module declares its path as: github.com/moby/spdystream
but was required as: github.com/docker/spdystream

go version
go version go1.16.6 linux/amd64

Waiting indefinitely

Hey!

When I try to run kubectl dig <my-node> it is waiting without suceeding (I've left it almost 1h waiting).

Any ideas on how to debug?

Cheers!

can't open BPF probe '/root/.sysdig/sysdig-probe-bpf.o'

I downloaded dig using go get command following the doc and the node OS is ubuntu 18.04, but the dig job always failed as can't open BPF probe:

# kubectl logs kubectl-dig1f3fae90-1597-11ea-8ed1-06438b7d96ee-gt7pv
can't open BPF probe '/root/.sysdig/sysdig-probe-bpf.o': No such file or directory

Maybe something package missing in my enironment? By the way, I have installed sysdig on my node.

Plugin hangs on ErrImagePull

When the plugin cannot pull the image (in my case egress policy was at fault), and maybe in other cases where the pod is not starting, the kubectl just hangs without information that it's waiting or something, no timeout and does not even respond to Ctrl+C for some reason.

Expected behaviour:

  • print a message that is waiting for the pod to start (after e.g. 10 sec)
  • timeout and abort after e.g. 5 minutes at most
  • maybe recreate the pod like 3 times before giving up
  • respond to Ctrl+C

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.