• k8s-merge-robot's avatar
    Merge pull request #18835 from brendandburns/3rdparty · 07929972
    k8s-merge-robot authored
    Automatic merge from submit-queue
    
    Add support for 3rd party objects to kubectl
    
    @deads2k @jlowdermilk
    
    Instructions for playing around with this:
    
    Run an apiserver with third party resources turned on (`--runtime-config=extensions/v1beta1=true,extensions/v1beta1/thirdpartyresources=true`)
    
    Then you should be able to:
    
    ```
    kubectl create -f rsrc.json
    ```
    
    ```json
    {
      "metadata": {
        "name": "foo.company.com"
      },
      "apiVersion": "extensions/v1beta1",
      "kind": "ThirdPartyResource",
      "versions": [
        {
          "apiGroup": "group",
          "name": "v1"
        },
        {
          "apiGroup": "group",
          "name": "v2"
        }
      ]
    }
    ```
    
    Once that is done, you should be able to:
    
    ```
    curl http://<server>/apis/company.com/v1/foos
    ```
    
    ```
    curl -X POST -d @${HOME}/foo.json http://localhost:8080/apis/company.com/v1/namespaces/default/foos
    ```
    
    ```json
    {
      "kind": "Foo",
      "apiVersion": "company.com/v1",
      "metadata": {
        "name": "baz"
      },
      "someField": "hello world",
      "otherField": 1
    }
    ```
    
    After this PR, you can do:
    
    ```
    kubectl create -f foo.json
    ```
    
    ```
    kubectl get foos
    ```
    
    etc.
    07929972
Name
Last commit
Last update
..
cache Loading commit data...
chaosclient Loading commit data...
clientset_generated Loading commit data...
leaderelection Loading commit data...
metrics Loading commit data...
record Loading commit data...
restclient Loading commit data...
testdata Loading commit data...
testing/core Loading commit data...
transport Loading commit data...
typed Loading commit data...
unversioned Loading commit data...
OWNERS Loading commit data...