pulumi / kubespy Goto Github PK
View Code? Open in Web Editor NEWTools for observing Kubernetes resources in real time, powered by Pulumi.
Home Page: https://pulumi.com/
License: Apache License 2.0
Tools for observing Kubernetes resources in real time, powered by Pulumi.
Home Page: https://pulumi.com/
License: Apache License 2.0
This will require some changes to the watch
package.
It seems the v0.5.0 release has no assets to download the binaries.
Could you add a checksum file to the releases please?
Disclaimer: This is a bot
It looks like your repo is trending. The github_trending_videos Instgram account automatically shows the demo gifs of trending repos in Github.
Your README doesn't seem to have any demo gifs. Add one and the next time the parser runs it will pick it up and post it on its Instagram feed. If you don't want to just close this issue we won't bother you again.
Adding support for Kind=Statefulset would be much appreciated.
building kubespy on NixOS/nixpkgs#92197 fails
$ pwd
~/ghq/github.com/NixOS/nixpkgs
$ nix-env -f '.' -iA kubespy
[...]
github.com/pulumi/pulumi-kubernetes/pkg/openapi
# github.com/pulumi/pulumi-kubernetes/pkg/openapi
go/src/github.com/pulumi/pulumi-kubernetes/pkg/openapi/openapi.go:64:39: cannot use gvk (type "k8s.io/apimachinery/pkg/runtime/schema".GroupVersionKind) as type "k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/runtime/schema".GroupVersionKind in argument to resources.LookupResource
go/src/github.com/pulumi/pulumi-kubernetes/pkg/openapi/openapi.go:107:42: cannot use gvk (type "k8s.io/apimachinery/pkg/runtime/schema".GroupVersionKind) as type "k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/runtime/schema".GroupVersionKind in argument to resources.LookupResource
go/src/github.com/pulumi/pulumi-kubernetes/pkg/openapi/openapi.go:110:29: cannot use resSchema (type "k8s.io/kubernetes/vendor/k8s.io/kube-openapi/pkg/util/proto".Schema) as type "k8s.io/kube-openapi/pkg/util/proto".Schema in argument to strategicMergePatch:
"k8s.io/kubernetes/vendor/k8s.io/kube-openapi/pkg/util/proto".Schema does not implement "k8s.io/kube-openapi/pkg/util/proto".Schema (wrong type for Accept method)
have Accept("k8s.io/kubernetes/vendor/k8s.io/kube-openapi/pkg/util/proto".SchemaVisitor)
want Accept("k8s.io/kube-openapi/pkg/util/proto".SchemaVisitor)
go/src/github.com/pulumi/pulumi-kubernetes/pkg/openapi/openapi.go:165:44: cannot use gvk (type "k8s.io/apimachinery/pkg/runtime/schema".GroupVersionKind) as type "k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/runtime/schema".GroupVersionKind in argument to scheme.Scheme.New
go/src/github.com/pulumi/pulumi-kubernetes/pkg/openapi/openapi.go:216:31: cannot use schema (type *"github.com/googleapis/gnostic/OpenAPIv2".Document) as type *"k8s.io/kubernetes/vendor/github.com/googleapis/gnostic/OpenAPIv2".Document in argument to openapi.NewOpenAPIData
[...]
builder for '/nix/store/wpyzl74r48as7k5jcdp9r579nadsyc8p-kubespy-0.5.1.drv' failed with exit code 1
error: build of '/nix/store/wpyzl74r48as7k5jcdp9r579nadsyc8p-kubespy-0.5.1.drv' failed
Please note, that github.com/pulumi/pulumi-kubernetes
is tagged according to 438edbf (=https://github.com/pulumi/kubespy/releases/tag/v0.5.1), see:
{
goPackagePath = "github.com/pulumi/pulumi-kubernetes";
fetch = {
type = "git";
url = "https://github.com/pulumi/pulumi-kubernetes";
rev = "v0.17.0";
sha256 = "1qyxjsdxwx5nid0zg63wvbc5i1n7z36hhv9g0s891m65rcwvpmdl";
};
}
Being from Sep 11, 2018, https://github.com/pulumi/pulumi-kubernetes/releases/tag/v0.17.0 might be outdated, however it is tagged here: https://github.com/pulumi/kubespy/blob/master/go.mod#L58
Now that we have people who are filing issues and asking us about contribution, we should add CONTRIBUTING.md
, CODE-OF-CONDUCT.md
, and ROADMAP.md
. We should do this sooner rather than later.
It would be nice to add kubespy releases to homebrew for easier installation on Mac.
Would you be interested in a PR to refactor kubespy into separate distinct commands? IMHO it will make it easier to extend kubespy without stuffing it all into main.go.
Let me know what you think.
It is not directly obvious from docs can kubespy
trace custom k8s resources and please provide example if it can.
I have multiple clusters in my kube config, kubespy should take an option allowing me to select the right one.
Currently, some deployments are not providing ARM64 images, which make using Kubespy not useable on ARM64 nodes. (AWS graviton for example)
Usage is blocked as many containers will not start (image not found for arm64)
It looks like pulumi/pulumi is using Travis for CI, so I assume we'll want to do the same here?
Obviously a full suite of unit tests would be nice, but maybe we should start with just a quick smoke check to make sure things build properly?
I understand that using go get
it is easier to install this tool. But given the dependency this project pulls in the overhead of go get
is too much. Because pulling in almost entire k8s goes over a gigabyte in code size.
It would be helpful for people who want to quickly try out the project to download the binary and use it.
Unless there was a special reason behind, can it align options like:
-n / --namespace
and/or
determine version automatically (v1)
etc.
Hi, what sort of software license do you plan to use for this project?
$ export GOPATH=~/go
$ go get github.com/pulumi/kubespy
can't load package: package github.com/pulumi/kubespy: no Go files in /home/ubuntu/go/src/github.com/pulumi/kubespy
dep ensure
Do you meant debconf
? Never heard of a dep
command in 25 years of running Linux. It does not appear to be a sub-command of go
either.
I am using google Kubernetes engine, how can I install the same there, please advise
If you switch the current context to a specific namespace, either in the kubeconfig, or with tools such as kubectx or kubens; kubespy always assumes the default namespace.
I'm working on this feature now.
Can we get a new release? The namespace bug fix would be super appreciated.
Installed the kubespy using latest krew: kubectl krew install spy
Running :
kubectl spy mypod-10852-599996c776-7rv2d -n test loading spy pod... Error: unknown flag: --generator See 'kubectl run --help' for usage.
Expected: to get spy info for pod.
Thank you.
go version
go version go1.11.1 darwin/amd64
env | grep GO
GOPATH=/Users/leigh.schrandt/go
GO111MODULE=on
go get -u github.com/pulumi/kubespy
go: finding github.com/codahale/hdrhistogram latest
go: finding 9fans.net/go latest
go: finding github.com/alcortesm/tgz latest
go: finding github.com/google/btree latest
go: finding k8s.io/kube-openapi latest
go: finding golang.org/x/arch latest
go: finding github.com/golang/glog latest
go: finding github.com/mdempsky/gocode latest
go: finding github.com/docker/spdystream latest
go: finding github.com/reconquest/loreley latest
go: finding github.com/prometheus/procfs latest
go: finding github.com/jbenet/go-context latest
go: finding k8s.io/utils latest
go: finding github.com/kevinburke/ssh_config latest
go: finding github.com/google/gofuzz latest
go: finding github.com/gosuri/uilive latest
go: finding github.com/beorn7/perks latest
go: finding github.com/mxk/go-flowrate latest
go: finding github.com/coreos/pkg latest
go: finding github.com/emicklei/go-restful-swagger12 latest
go: finding github.com/k0kubun/colorstring latest
go: finding github.com/mitchellh/go-ps latest
go: finding golang.org/x/tools latest
go: finding github.com/flynn/go-shlex latest
go: finding github.com/fatih/gomodifytags latest
go: finding github.com/skratchdot/open-golang latest
go: finding k8s.io/apiextensions-apiserver latest
go: finding k8s.io/apiserver latest
go: finding golang.org/x/sys latest
go: finding github.com/golang/groupcache latest
go: finding github.com/mailru/easyjson latest
go: finding github.com/golang/lint latest
go: finding github.com/xiang90/probing latest
go: finding github.com/cosiner/argv latest
go: finding golang.org/x/oauth2 latest
go: finding golang.org/x/sync latest
go: finding golang.org/x/lint latest
go: finding github.com/anmitsu/go-shlex latest
go: finding google.golang.org/genproto latest
go: finding github.com/stevvooe/resumable latest
go: finding github.com/PuerkitoBio/urlesc latest
go: finding github.com/ugorji/go/codec latest
go: finding k8s.io/api latest
go: finding honnef.co/go/tools latest
go: finding github.com/gregjones/httpcache latest
go: finding golang.org/x/net latest
go: finding github.com/gophercloud/gophercloud latest
go: finding github.com/howeyc/gopass latest
go: finding github.com/pquerna/cachecontrol latest
go: finding github.com/davidrjenni/reftools latest
go: finding github.com/sqs/goreturns latest
go: finding github.com/josharian/impl latest
go: finding github.com/tmc/grpc-websocket-proxy latest
go: finding github.com/yudai/golcs latest
go: finding golang.org/x/time latest
go: finding github.com/prometheus/client_model latest
go: finding github.com/texttheater/golang-levenshtein latest
go: finding github.com/modern-go/concurrent latest
go: finding golang.org/x/crypto latest
go: finding gopkg.in/tomb.v1 latest
go: finding k8s.io/apimachinery latest
go: finding gopkg.in/check.v1 latest
go: finding github.com/ramya-rao-a/go-outline latest
go: finding github.com/acroca/go-symbols latest
go: finding github.com/coreos/go-systemd latest
go: finding github.com/prometheus/common latest
# k8s.io/client-go/plugin/pkg/client/auth/azure
../../../go/pkg/mod/k8s.io/[email protected]+incompatible/plugin/pkg/client/auth/azure/azure.go:246:4: cannot use expiresIn (type string) as type json.Number in field value
../../../go/pkg/mod/k8s.io/[email protected]+incompatible/plugin/pkg/client/auth/azure/azure.go:247:4: cannot use expiresOn (type string) as type json.Number in field value
../../../go/pkg/mod/k8s.io/[email protected]+incompatible/plugin/pkg/client/auth/azure/azure.go:248:4: cannot use expiresOn (type string) as type json.Number in field value
../../../go/pkg/mod/k8s.io/[email protected]+incompatible/plugin/pkg/client/auth/azure/azure.go:265:23: cannot use token.token.ExpiresIn (type json.Number) as type string in assignment
../../../go/pkg/mod/k8s.io/[email protected]+incompatible/plugin/pkg/client/auth/azure/azure.go:266:23: cannot use token.token.ExpiresOn (type json.Number) as type string in assignment
# github.com/pulumi/pulumi-kubernetes/pkg/client
../../../go/pkg/mod/github.com/pulumi/[email protected]/pkg/client/util.go:72:7: undefined: dynamic.ClientPool
../../../go/pkg/mod/github.com/pulumi/[email protected]/pkg/client/util.go:85:7: undefined: dynamic.ClientPool
$ kubespy status v1 Pod container-stg/container-sim
Watching status of v1 Pod container-stg/container-sim
Meanwhile
$ kubectl delete pod/container-847fbf5549-zcmtp -n container-stg
kubectl shows a new container replacing the delete one. kubespy does nothing.
You can see two characters left from the previous "Waiting for service" message. The bug is upstream in uilive
and even has a PR open to fix this but it has been over a year and the maintainer haven't commited anything since 23 Mar 2017. I see two fixes here:
Fprintf
๐
I would gladly do a PR with a fix, just let me know which one you'd prefer :)
This tool is great. Thank you for sharing.
I created https://github.com/jfreeland/asdf-kubespy and asdf-vm/asdf-plugins#352 to add this to asdf as I want to dynamically add this to my toolbox container which relies on asdf.
It's worth noting that the differences in release names and tarball structure made this a bit odd, https://github.com/jfreeland/asdf-kubespy/blob/main/bin/install#L25-L33 and https://github.com/jfreeland/asdf-kubespy/blob/main/bin/install#L41-L45.
If somebody doesn't beat me to it, some day I might borrow some of this code and create an awslbspy that uses the AWS API to monitor what's happening on an (ALB, NLB) when you're rolling a service, as well.
i am trying to use "kubespay" (great tool btw :heart) - to watch multiple deployments.
having the following questions.
kubespy trace deploy krn-dev/api
[ADDED extensions/v1beta1/Deployment] krn-dev/api
Rolling out Deployment revision 4
โ
Deployment is currently available
โ
Rollout successful: new ReplicaSet marked 'available'
ROLLOUT STATUS:
- [Current rollout | Revision 4] [ADDED] krn-dev/api-7578c97964
โ
ReplicaSet is available [1 Pods available of a 1 minimum]
- [Ready] api-7578c97964-8glps
i'd like to start multiple threads and run one kubespy per deployment.
kubespy should exit once deployment status is โ
resulting in the thread to quit, once all threads are gone, i can be sure my deploymentS are done.
is there already a option for that scenario?
if not, can you guide me to the direction where to start, i would love to contribute.
Unable to install the package. Here is the stack trace -
# github.com/pulumi/pulumi-kubernetes/pkg/client
../../go/src/github.com/pulumi/pulumi-kubernetes/pkg/client/client.go:52:5: cannot use memcachedDiscoveryClient literal (type *memcachedDiscoveryClient) as type discovery.CachedDiscoveryInterface in assignment:
*memcachedDiscoveryClient does not implement discovery.CachedDiscoveryInterface (wrong type for OpenAPISchema method)
have OpenAPISchema() (*"github.com/googleapis/gnostic/OpenAPIv2".Document, error)
want OpenAPISchema() (*"k8s.io/client-go/vendor/github.com/googleapis/gnostic/OpenAPIv2".Document, error)
../../go/src/github.com/pulumi/pulumi-kubernetes/pkg/client/client.go:59:2: cannot use c (type *memcachedDiscoveryClient) as type discovery.CachedDiscoveryInterface in return argument:
*memcachedDiscoveryClient does not implement discovery.CachedDiscoveryInterface (wrong type for OpenAPISchema method)
have OpenAPISchema() (*"github.com/googleapis/gnostic/OpenAPIv2".Document, error)
want OpenAPISchema() (*"k8s.io/client-go/vendor/github.com/googleapis/gnostic/OpenAPIv2".Document, error)
../../go/src/github.com/pulumi/pulumi-kubernetes/pkg/client/client.go:143:11: cannot use schema (type *"k8s.io/client-go/vendor/github.com/googleapis/gnostic/OpenAPIv2".Document) as type *"github.com/googleapis/gnostic/OpenAPIv2".Document in assignment
../../go/src/github.com/pulumi/pulumi-kubernetes/pkg/client/client.go:144:2: cannot use schema (type *"k8s.io/client-go/vendor/github.com/googleapis/gnostic/OpenAPIv2".Document) as type *"github.com/googleapis/gnostic/OpenAPIv2".Document in return argument
../../go/src/github.com/pulumi/pulumi-kubernetes/pkg/client/util.go:72:7: undefined: dynamic.ClientPool
../../go/src/github.com/pulumi/pulumi-kubernetes/pkg/client/util.go:85:7: undefined: dynamic.ClientPool
# github.com/pulumi/pulumi-kubernetes/pkg/openapi
../../go/src/github.com/pulumi/pulumi-kubernetes/pkg/openapi/openapi.go:64:39: cannot use gvk (type "k8s.io/apimachinery/pkg/runtime/schema".GroupVersionKind) as type "k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/runtime/schema".GroupVersionKind in argument to resources.LookupResource
../../go/src/github.com/pulumi/pulumi-kubernetes/pkg/openapi/openapi.go:107:42: cannot use gvk (type "k8s.io/apimachinery/pkg/runtime/schema".GroupVersionKind) as type "k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/runtime/schema".GroupVersionKind in argument to resources.LookupResource
../../go/src/github.com/pulumi/pulumi-kubernetes/pkg/openapi/openapi.go:110:29: cannot use resSchema (type "k8s.io/kubernetes/vendor/k8s.io/kube-openapi/pkg/util/proto".Schema) as type "k8s.io/kube-openapi/pkg/util/proto".Schema in argument to strategicMergePatch:
"k8s.io/kubernetes/vendor/k8s.io/kube-openapi/pkg/util/proto".Schema does not implement "k8s.io/kube-openapi/pkg/util/proto".Schema (wrong type for Accept method)
have Accept("k8s.io/kubernetes/vendor/k8s.io/kube-openapi/pkg/util/proto".SchemaVisitor)
want Accept("k8s.io/kube-openapi/pkg/util/proto".SchemaVisitor)
../../go/src/github.com/pulumi/pulumi-kubernetes/pkg/openapi/openapi.go:165:44: cannot use gvk (type "k8s.io/apimachinery/pkg/runtime/schema".GroupVersionKind) as type "k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/runtime/schema".GroupVersionKind in argument to scheme.Scheme.New
../../go/src/github.com/pulumi/pulumi-kubernetes/pkg/openapi/openapi.go:216:31: cannot use schema (type *"k8s.io/client-go/vendor/github.com/googleapis/gnostic/OpenAPIv2".Document) as type *"k8s.io/kubernetes/vendor/github.com/googleapis/gnostic/OpenAPIv2".Document in argument to openapi.NewOpenAPIData
Any ideas ?
Hi!
running kubespy trace deploy internal-tiller/tiller
shows me this output:
[ADDED extensions/v1beta1/Deployment] internal-tiller/tiller
Rolling out Deployment revision 3
โ
Deployment is currently available
โ
Rollout successful: new ReplicaSet marked 'available'
ROLLOUT STATUS:
- [Current rollout | Revision 3] [ADDED] joe-helm-test/tiller-877613549
โ
ReplicaSet is available [0 Pods available of a 0 minimum]
- [Previous ReplicaSet | Revision 2] [ADDED] testproject/tiller-7c58fdf799
โ Waiting for ReplicaSet to scale to 0 Pods (1 currently exist)
I wounder why there are reference to testproject
or joe-helm-test
while I just looking the tiller
inside internal-tiller
.
Running v0.4.0 on a mac running against our kubernetes 1.10 cluster.
Looking at : https://kubernetes.io/docs/tasks/extend-kubectl/kubectl-plugins/, it appears that we could use https://github.com/kubernetes/cli-runtime to implement kubespy as a plugin, and get a lot of the heavy lifting done for us.
Syntax could look something like:
kubectl spy po nginx --status
kubectl spy svc nginx --trace
^ I'm just spitballing here. @hausdorff WDYT?
I installed kubespy on y k8s master server. however when i run kubespy commands all i get is output watching status. nothing else.
#21 works for things like Deployment
or Pod
that only include one capital letter, but not for types like StatefulSet
or DaemonSet
with more than one capital letter.
Here's an example:
$ kubespy status apps/v1 statefulset foo
Server is unable to handle apps/v1, Kind=Statefulset
$ kubespy status apps/v1 StatefulSet foo
Watching status of apps/v1 StatefulSet foo
We seem to be in dependency hell: https://travis-ci.com/pulumi/kubespy/builds/86373938#L1033
This relates to the discussion on #10
It would be nice to have kubespy availabe to install via krew. Currently it is not available:
$ kubectl krew search | grep spy
Because kubespy
was initially a tool to make gifs for the Pulumi blog, we neglected any sort of release engineering. Now that we have real users, the time has come to automate cross-platform builds and release management, so that important tasks, like, cutting a release, are trivially easy.
$ kubectl get all -n container-stg
NAME READY STATUS RESTARTS AGE
pod/container-847fbf5549-p7djz 2/2 Running 1 1h
pod/container-847fbf5549-w2mpc 2/2 Running 1 1h
pod/container-847fbf5549-zcmtp 2/2 Running 1 1h
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/container-service ClusterIP 100.71.215.197 <none> 4000/TCP 1h
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
deployment.apps/container 3 3 3 3 1h
NAME DESIRED CURRENT READY AGE
replicaset.apps/container-847fbf5549 3 3 3 1h
kubespy status v1 pod container
2018/09/24 23:39:38 Server is unable to handle /v1, Kind=pod
kubespy status apps/v1 pod container
2018/09/24 23:39:43 Server is unable to handle apps/v1, Kind=pod
---) kubespy changes v1 pod nginx
Unable to read kubectl config: invalid configuration: no configuration has been provided
Seeing this error messages i have multiple clusters and kubeconfig has multiple cluster config.
$ go get github.com/pulumi/kubespy
can't load package: package github.com/pulumi/kubespy: no Go files in /home/ubuntu/go/src/github.com/pulumi/kubespy
$ go install github.com/pulumi/cmd/kubespy
can't load package: package github.com/pulumi/cmd/kubespy: cannot find package "github.com/pulumi/cmd/kubespy" in any of:
/usr/lib/go-1.10/src/github.com/pulumi/cmd/kubespy (from $GOROOT)
/home/ubuntu/go/src/github.com/pulumi/cmd/kubespy (from $GOPATH)
$ ls -l /home/ubuntu/go/src/github.com/pulumi/kubespy
-rw-rw-r-- 1 ubuntu ubuntu 19518 Sep 18 19:51 Gopkg.lock
-rw-rw-r-- 1 ubuntu ubuntu 803 Sep 18 19:51 Gopkg.toml
-rw-rw-r-- 1 ubuntu ubuntu 2296 Sep 18 19:51 README.md
drwxrwxr-x 3 ubuntu ubuntu 4096 Sep 18 19:51 cmd
drwxrwxr-x 3 ubuntu ubuntu 4096 Sep 18 19:51 examples
drwxrwxr-x 2 ubuntu ubuntu 4096 Sep 18 19:51 images
drwxrwxr-x 2 ubuntu ubuntu 4096 Sep 18 19:51 watch
An artifact of the refactor that I didn't catch last pass.
I'll submit a PR to close this.
I cannot see how to run this tool if the kubernetes is running in AWS. Also, what are the options for kind and type?
It would be nice to have a version command so it's obvious which version
Versions:
kubespy version
v0.5.0
kubectl version
Client Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.0", GitCommit:"70132b0f130acc0bed193d9ba59dd186f0e634cf", GitTreeState:"clean", BuildDate:"2019-12-07T21:20:10Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.3", GitCommit:"b3cbbae08ec52a7fc73d334838e18d17e8512749", GitTreeState:"clean", BuildDate:"2019-12-04T07:23:47Z", GoVersion:"go1.12.12", Compiler:"gc", Platform:"linux/amd64"}
When i try to run kubespy trace deploy paymentservice
i see message:
Server is unable to handle extensions/v1beta1, Kind=Deployment
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.