<p dir="auto">Using kubectl create with a list no longer works. We get the output:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ _output/local/bin/linux/amd64/kubectl create -f /tmp/test.json
error validating &quot;/tmp/test.json&quot;: error validating data: couldn't find type: v1.List; if you choose to ignore these errors, turn validation off with --validate=false"><pre class="notranslate"><code class="notranslate">$ _output/local/bin/linux/amd64/kubectl create -f /tmp/test.json
error validating "/tmp/test.json": error validating data: couldn't find type: v1.List; if you choose to ignore these errors, turn validation off with --validate=false
</code></pre></div>
<h1 dir="auto">Proposal to create a generic interface from kubelet to cadvisor</h1>
<h2 dir="auto">1. Background</h2>
<p dir="auto">cadvisor was integrated with kubernetes in issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="58833302" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/4798" data-hovercard-type="issue" data-hovercard-url="/kubernetes/kubernetes/issues/4798/hovercard" href="https://github.com/kubernetes/kubernetes/issues/4798">#4798</a>, which made<br>
the deployment of kubernetes simpler and out-of-box UX smoother for new<br>
users. However, at the same time, it created a tight coupling between<br>
kubelet and cadvisor. We'd like create a generic interface so that other<br>
container health checking tools can be used with kubernetes.</p>
<h2 dir="auto">2. Motivation</h2>
<p dir="auto">It is great that there's a built-in cadvisor when a new user starts to<br>
play around with kubernetes. For most users, continuing to use this<br>
cadvisor, and then configure heapster, influxdb, and grafana is the natural<br>
way to go. However, for other users, they might prefer to use other open<br>
source tools for collecting this information or create their own custom tools.<br>
As there is no way to disable cadvisor, one way is to run both cadvisor<br>
and their custom tools at the same time, which is inefficient and wasteful.</p>
<p dir="auto">Other use cases to further motivate this proposal are:</p>
<ul dir="auto">
<li>a) Deploying kubernetes in a public cloud, and the cloud provider already provides<br>
similar health checking tools.</li>
<li>b) Deploying kubernetes on top of mesos, where there could be multiple frameworks<br>
deployed on the same mesos node. If each framework is using its own health checking<br>
tool, they would perform duplicate works.</li>
<li>c) The kubenetes-bundled cadvisor sometimes have performance issues where it is<br>
consuming a much larger amount of resources than expected (see issues <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="91490559" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/10451" data-hovercard-type="issue" data-hovercard-url="/kubernetes/kubernetes/issues/10451/hovercard" href="https://github.com/kubernetes/kubernetes/issues/10451">#10451</a>, <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="113435772" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/16296" data-hovercard-type="issue" data-hovercard-url="/kubernetes/kubernetes/issues/16296/hovercard" href="https://github.com/kubernetes/kubernetes/issues/16296">#16296</a>).<br>
In a production environment, one might want to run a stable version of cadvisor,<br>
and have Kubernetes simply connecting to it instead of using the newer built-in one.</li>
</ul>
<h2 dir="auto">3. Planned work</h2>
<p dir="auto">We're planning to create a generic interface and a set of Kubernetes-based (instead of<br>
cadvisor-based) health checking data structs, so that it can interface with different<br>
health checking backends, including cadvisor. Integrating kubernetes with a new health<br>
checking tool would involve writing a new driver that implements that generic interface.</p>
<h3 dir="auto">3a. Phased approach</h3>
<p dir="auto">We'd like to phase this work to smaller steps. Initially, we are planning to create this<br>
generic interface almost identical to what is defined in pkg/kubelet/cadvisor/types.go, and<br>
the corresponding data structs directly from cadvisor. This allows us to put in the generic<br>
health checking interface with minimal changes to the existing code.</p>
<p dir="auto">In the 2nd phase, we would like to clean up the generic interface and the corresponding<br>
data structs as not everything cadvisor collects are used by kubelet. Basically, we will make<br>
the interface and data structs more generic so that new health check drivers can be more<br>
easily written.</p>
<p dir="auto">In the 3rd phase, we will add one or two additional cmd flags to allow alternative health<br>
checking driver to be used when starting kubernetes. Of course, the default setting will be<br>
to use the built-in cadvisor.</p>