liveBook · Manning

Kubectl get --raw

As explained in Kubernetes in Action, Second Edition

kubectl get --raw is a kubectl command that sends a raw request to a URI through the Kubernetes API server.

kubectl get --raw sends a request to a URI through the Kubernetes API server, which proxies the request to an HTTP application running in a pod. It provides a quick alternative to setting up port-forwarding for developer and administrator access. section 5.3.1

Requesting a pod’s root path

Run `kubectl get --raw /api/v1/namespaces/default/pods/kiada/proxy/` to request the root path of the `kiada` pod through the API server. Append another URL path to request a different resource. section 5.3.1

$ kubectl get --raw /api/v1/namespaces/default/pods/kiada/proxy/
Kiada version 0.1. Request processed by "kiada". Client IP: ::ffff:172.18.0.5

Shows the raw proxy request and the application response returned through the API server. section 5.3.1

How Kubernetes in Action, Second Edition covers it

How deep it goes
Explains the API-server proxy path and command syntax, without detailing proxy implementation internals.
Examples
Demonstrates requesting the root path of the Kiada application through a pod proxy URI.
What it assumes
Assumes an HTTP application is running in a pod and that its URI path can be formed for proxy access.
What you can do after
Operate/configure HTTP access by sending requests to pod applications through API-server proxy URIs.
How it connects
Connects Kubernetes API server, pods, HTTP applications, URI paths, and kubectl port-forwarding.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Kubernetes in Action, Second Edition. The section links point to the parts of the book it draws on.