<p dir="auto">Following PR <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="98053276" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/12001" data-hovercard-type="pull_request" data-hovercard-url="/kubernetes/kubernetes/pull/12001/hovercard" href="https://github.com/kubernetes/kubernetes/pull/12001">#12001</a>.</p>
<p dir="auto">From what I can gather, there are 3 sets of changes that need to be made to finish off the experimental api support. Deep copies and conversions need to be autogenerated, the client library needs support, as does kubectl.</p>
<p dir="auto">Within the master, we now have types (and their conversions and deep copies) being generated in multiple packages. However, types from the experimental api may refer to types in the standard api. However, since the deep copies and conversions are not exported, they must be regenerated in each package. This leads to duplicate (albeit autogenerated) code. We can avoid this by modifying the autogeneration code to use Scheme.DeepCopy/Scheme.Convert when we find a type that has been declared in another package. Alternatively, we may move the conversion and deepcopy functions to a common location. The disadvantage with the second approach is that we have a new package that needs to be imported everywhere as both pkg/api and pkg/expapi should be initialized before adding the functions (it <em>may</em> be safe to add the functions before the types, but if so this isn't clearly stated anywhere).</p>
<p dir="auto">For the client library, the Config object causes trouble.</p>
<div class="highlight highlight-source-go notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="type Config struct {
    // Host must be a host string, a host:port pair, or a URL to the base of the API.
    Host string
    // Prefix is the sub path of the server. If not specified, the client will set
    // a default value.  Use &quot;/&quot; to indicate the server root should be used
    Prefix string
    // Version is the API version to talk to. Must be provided when initializing
    // a RESTClient directly. When initializing a Client, will be set with the default
    // code version.
    Version string
    // Codec specifies the encoding and decoding behavior for runtime.Objects passed
    // to a RESTClient or Client. Required when initializing a RESTClient, optional
    // when initializing a Client.
    Codec runtime.Codec

    // Server requires Basic authentication
    Username string
    Password string

    // Server requires Bearer authentication. This client will not attempt to use
    // refresh tokens for an OAuth2 flow.
    // TODO: demonstrate an OAuth2 compatible client.
    BearerToken string

    // TLSClientConfig contains settings to enable transport layer security
    TLSClientConfig

    // Server should be accessed without verifying the TLS
    // certificate. For testing only.
    Insecure bool

    // UserAgent is an optional field that specifies the caller of this request.
    UserAgent string

    // Transport may be used for custom HTTP behavior. This attribute may not
    // be specified with the TLS client certificate options. Use WrapTransport
    // for most client level operations.
    Transport http.RoundTripper
    // WrapTransport will be invoked for custom HTTP behavior after the underlying
    // transport is initialized (either the transport created from TLSClientConfig,
    // Transport, or http.DefaultTransport). The config may layer other RoundTrippers
    // on top of the returned RoundTripper.
    WrapTransport func(rt http.RoundTripper) http.RoundTripper

    // QPS indicates the maximum QPS to the master from this client.  If zero, QPS is unlimited.
    QPS float32

    // Maximum burst for throttle
    Burst int
}"><pre class="notranslate"><span class="pl-k">type</span> <span class="pl-smi">Config</span> <span class="pl-k">struct</span> {
    <span class="pl-c">// Host must be a host string, a host:port pair, or a URL to the base of the API.</span>
    <span class="pl-c1">Host</span> <span class="pl-smi">string</span>
    <span class="pl-c">// Prefix is the sub path of the server. If not specified, the client will set</span>
    <span class="pl-c">// a default value.  Use "/" to indicate the server root should be used</span>
    <span class="pl-c1">Prefix</span> <span class="pl-smi">string</span>
    <span class="pl-c">// Version is the API version to talk to. Must be provided when initializing</span>
    <span class="pl-c">// a RESTClient directly. When initializing a Client, will be set with the default</span>
    <span class="pl-c">// code version.</span>
    <span class="pl-c1">Version</span> <span class="pl-smi">string</span>
    <span class="pl-c">// Codec specifies the encoding and decoding behavior for runtime.Objects passed</span>
    <span class="pl-c">// to a RESTClient or Client. Required when initializing a RESTClient, optional</span>
    <span class="pl-c">// when initializing a Client.</span>
    <span class="pl-c1">Codec</span> runtime.<span class="pl-smi">Codec</span>

    <span class="pl-c">// Server requires Basic authentication</span>
    <span class="pl-c1">Username</span> <span class="pl-smi">string</span>
    <span class="pl-c1">Password</span> <span class="pl-smi">string</span>

    <span class="pl-c">// Server requires Bearer authentication. This client will not attempt to use</span>
    <span class="pl-c">// refresh tokens for an OAuth2 flow.</span>
    <span class="pl-c">// TODO: demonstrate an OAuth2 compatible client.</span>
    <span class="pl-c1">BearerToken</span> <span class="pl-smi">string</span>

    <span class="pl-c">// TLSClientConfig contains settings to enable transport layer security</span>
    <span class="pl-smi">TLSClientConfig</span>

    <span class="pl-c">// Server should be accessed without verifying the TLS</span>
    <span class="pl-c">// certificate. For testing only.</span>
    <span class="pl-c1">Insecure</span> <span class="pl-smi">bool</span>

    <span class="pl-c">// UserAgent is an optional field that specifies the caller of this request.</span>
    <span class="pl-c1">UserAgent</span> <span class="pl-smi">string</span>

    <span class="pl-c">// Transport may be used for custom HTTP behavior. This attribute may not</span>
    <span class="pl-c">// be specified with the TLS client certificate options. Use WrapTransport</span>
    <span class="pl-c">// for most client level operations.</span>
    <span class="pl-c1">Transport</span> http.<span class="pl-smi">RoundTripper</span>
    <span class="pl-c">// WrapTransport will be invoked for custom HTTP behavior after the underlying</span>
    <span class="pl-c">// transport is initialized (either the transport created from TLSClientConfig,</span>
    <span class="pl-c">// Transport, or http.DefaultTransport). The config may layer other RoundTrippers</span>
    <span class="pl-c">// on top of the returned RoundTripper.</span>
    <span class="pl-c1">WrapTransport</span> <span class="pl-k">func</span>(<span class="pl-s1">rt</span> http.<span class="pl-smi">RoundTripper</span>) http.<span class="pl-smi">RoundTripper</span>

    <span class="pl-c">// QPS indicates the maximum QPS to the master from this client.  If zero, QPS is unlimited.</span>
    <span class="pl-c1">QPS</span> <span class="pl-smi">float32</span>

    <span class="pl-c">// Maximum burst for throttle</span>
    <span class="pl-c1">Burst</span> <span class="pl-smi">int</span>
}</pre></div>
<p dir="auto">In particular, the Prefix, Version, and Codec fields need to be changed for both experimental support and eventual multiple api group support. These fields also exist within client.RESTClient, although Codec is the only field there which is public. It's likely that these fields are not used by many clients since we default them in <a href="https://github.com/GoogleCloudPlatform/kubernetes/blob/master/pkg/client/helper.go#L275">helper.go</a>, so breaking this may be acceptable. For actually adding experimental objects, we could create a new Experimental field in Client of type ExperimentalClient (also embedding a *RESTClient) that would be not have to be explicitly initialized (i.e. it would be created in the Client's constructor). So from a user's perspective, they would run something like</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="c, err := client.New(config)
// err handling
list, err := client.Experimental.DaemonController(ns).List(selector)"><pre class="notranslate"><code class="notranslate">c, err := client.New(config)
// err handling
list, err := client.Experimental.DaemonController(ns).List(selector)
</code></pre></div>
<p dir="auto">Finally, for the changes to kubectl, proxy needs to proxy the experimental prefix if it is enabled, api-versions needs to print out information for the experimental api, validation (via swagger) needs to check the experimental api, and since kubectl uses the client library, kubectl support cannot be completed until support is added to client library.</p>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/smarterclayton/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/smarterclayton">@smarterclayton</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/bgrant0607/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/bgrant0607">@bgrant0607</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/nikhiljindal/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/nikhiljindal">@nikhiljindal</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/lavalamp/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/lavalamp">@lavalamp</a></p>
<p dir="auto">Hello,<br>
I would like to make rolling update by node:</p>
<ol dir="auto">
<li>Select one node</li>
<li>Stop all pods of the RC on this node.</li>
<li>Start new pods on this node</li>
<li>Select an other node</li>
<li>Stop all pods of the RC on this node.</li>
<li>...</li>
</ol>
<p dir="auto">Questions:</p>
<ul dir="auto">
<li>Is this using is OK with Kubernetes philosophy ?</li>
<li>Is there any way to do it right now ?</li>
<li>If not, which files are concerned by this ?<br>
I can patch it to get something like: kubectl rolling-update frontend-v1 -f frontend-v2.json --by-node</li>
</ul>
<p dir="auto">Thanks</p>