--raw option to kubectl command

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?
  • post-author-pic
    Will B
    10-01-2018

    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.

  • post-author-pic
    Angelo M
    10-02-2018

    Thanks Will. Can you give an example?

Looking For Team Training?

Learn More