get_k8s_resource
Gets one or more Kubernetes resources from a cluster. Resources can be filtered by type, name, namespace, and label selectors. Returns the resources in YAML format. This is similar to running kubectl get.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Optional. The name of the resource to retrieve. If not specified, all resources of the given type are returned. | |
| parent | Yes | Required. The cluster, which owns this collection of resources. Format: projects/{project}/locations/{location}/clusters/{cluster} | |
| namespace | No | Optional. The namespace of the resource. If not specified, all namespaces are searched. | |
| outputFormat | No | Optional. The output format. One of: (table, wide, yaml, json). If not specified, defaults to table. When both custom_columns and output_format are specified, output_format is ignored. | |
| resourceType | Yes | Required. The type of resource to retrieve. Kubernetes resource/kind name in singular form, lower case. e.g. "pod", "deployment", "service". | |
| customColumns | No | Optional. The field mask to specify columns to display. Use a single "*" to get all fields. When both custom_columns and output_format are specified, output_format is ignored. | |
| fieldSelector | No | Optional. A field selector to filter resources. | |
| labelSelector | No | Optional. A label selector to filter resources. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| errors | No | Errors encountered during retrieval. | |
| output | No | The output of the command in the requested format. It may contain resources in YAML or JSON format, or a table in plain text, or errors. |