Comments (5)
thanks, no need to @ since it's my repo and I get notifications about everything
from kubectl-tree.
@ahmetb FYI
from kubectl-tree.
Found out the issue was the bug I introduced in the code. Still it takes time but significantly less:
I0106 15:02:16.109438 53594 query.go:45] all goroutines have returned in 19.125264491s
I0106 15:02:16.109445 53594 query.go:46] query result: error=<nil>, objects=8991
from kubectl-tree.
Increased the burst and qps to 2000 each and increased pagination value to 1000. Still no significant improvement. It went down to 17s.
What I can understand is that the large the cluster the more objects are listed. If I have 10k pods running then it will cause listing of all 10k pods which is definitely going to be slow.
The ideal way would require a change in design st. we start using labels of deployment and other objects to list down the children. Or maybe better if we could directly use field selector with ownerID (Not sure if there is a support for this in client-go).
func (od objectDirectory) ownedBy(id types.UID) []unstructured.Unstructured {
var out sortedObjects
for k := range od.ownership[id] { // instead of finding owner here make modification in snippet pasted below
out = append(out, od.getObject(k))
}
sort.Sort(out)
return out
}
Query api:
func queryAPI(client dynamic.Interface, api apiResource) ([]unstructured.Unstructured, error) {
var out []unstructured.Unstructured
var next string
for {
resp, err := client.Resource(api.GroupVersionResource()).List(metav1.ListOptions{
Limit: 1000,
Continue: next,
// The logic to filter should go here
})
from kubectl-tree.
Sadly, server side filtering is not possible.
The only improvement I can think of is to query resources only in specified namespace (Except nonnamespaced apis) and separately do a --all-namespaces flag for the current behavior.
I am not sure itโs worth fixing just yet. If it effects 1% users and takes only 20s waiting, I donโt want to fix it and change experience for everyone.
from kubectl-tree.
Related Issues (20)
- Accept kind/name as nomenclature HOT 1
- Getting "can't have a plugin without specifying file operations" HOT 2
- CR always report no resources HOT 1
- "kubectl tree" not working for Kubeflow profiles (not namespaced) HOT 3
- support for custom columns HOT 2
- Add --watch support HOT 1
- Plugin won't install on newer macs with Apple Silicon / M1 processor
- Add a flag to support a list of condition types HOT 3
- Enhancement: Add cli switch to search all ALL un-namespaced objects (can be used in addition to the -n switch) HOT 7
- Doesn't take into account cluster.proxy-url
- Feature request: include events HOT 1
- Feature Request: List all containers (if --containers flag given) HOT 1
- Feature Request: List resources in a scope HOT 1
- kubectl tree command doesn't work for Statefulsets HOT 1
- Support PV/PVC/StorageClass? HOT 3
- Fails if privileges are limited HOT 1
- Duplicate tree items, if a resource has two owners. HOT 1
- Linux/aarch64 : plugin "tree" does not offer installation for this platform
- Command reports ambiguous kind that's not ambiguous HOT 4
- Add label-selector to mitigate workload and data volume
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kubectl-tree.