I have been looking through the kubectl create command source code and was wondering if anyone has an example of using the kubectl with the --raw option?
What --raw does is allow you to interact with the Kubernetes API more directly using kubectl.
For example, if you are doing a command that retrieves data (like kubectl get), instead of displaying the formatted output it will display the json data that was returned by the Kubernetes API. You can also specify the API endpoint as a portion of the URL instead of specifying the object you want to get in the normal way.
For commands that make changes (like kubectl create), you can still specify the API endpoint as a portion of the URL.
Basically, it lets you do the same things you normally do with kubectl, but you're working with the lower-level API calls that kubectl normally makes.