Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting all namespaces from custom resources #456

Closed
robinglen opened this issue May 27, 2020 · 1 comment
Closed

Getting all namespaces from custom resources #456

robinglen opened this issue May 27, 2020 · 1 comment

Comments

@robinglen
Copy link

robinglen commented May 27, 2020

Hello,

I might just be missing something obvious, I want to get custom resources - specifically virtualservices from istio.

With kubectl I can do that with the following:
kubectl get virtualservices --all-namespaces -v=8

which results in a GET for the following path /apis/networking.istio.io/v1beta1/virtualservices?limit=500 and the expected services are listed.

in Go I can do something like this to build a request for custom resources:

virtualServiceGVR := schema.GroupVersionResource{
    Group:    "networking.istio.io",
    Version:  "v1alpha3",
    Resource: "virtualservices",
}

virtualServices, err := client.Resource(virtualServiceGVR).List(metav1.ListOptions{})

Documented here GroupVersionResource

However I can't find something similar the CoreV1Api, am I missing something obvious? Is this feature available?

@robinglen
Copy link
Author

As suspected, there was an obvious solution, which can be found here:

public async listClusterCustomObject (group: string, version: string, plural: string, pretty?: string, _continue?: string, fieldSelector?: string, labelSelector?: string, limit?: number, resourceVersion?: string, timeoutSeconds?: number, watch?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: object; }> {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant