<p dir="auto"><code class="notranslate">kubectl get &lt;resource_name&gt;</code> prints all the resource info as a table by default. Sometimes there is just too much data and one row of the table is not able to fit in one line. It takes time to comprehend that entire output. It may be particularly useful to restrict columns by name. So for example in context of resource pod, something like..</p>
<p dir="auto"><code class="notranslate">kubectl get pods --filter names</code></p>
<p dir="auto">that would only pod names instead of an entire table containing all columns like POD, HOST, STATUS, CREATED, etc. would be particularly useful.</p>
<p dir="auto">Exact interface for this might need to be discussed and planned on a wiki. (I'll try to update this issue with a more detailed suggest if I can think of something)</p>
<p dir="auto">I am working with Huawei PaaS team on Ubernetes Phase I implementation, and focus on Uberenetes scheduler. I created a sequence diagram to illustrate the process of ubernetes scheduler and want to start some discussions.</p>
<p dir="auto"><strong>A general principle design spec</strong><br>
Currently clusterSelector (implemented as a LabelSelector) only supports a simple list of acceptable clusters. Workloads will be evenly distributed on these acceptable clusters in phase one.</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Need to make agreement that "evenly distributed" simply means cloning Federation-RC as sub-RC, and assign target clusters, replicas will not be cared in Federation level, that is sub-RC will keep the same value for replicas of Federation RC.</li>
</ul>
<p dir="auto"><strong>Supported cases in phase I</strong><br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="35192559" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/1" data-hovercard-type="issue" data-hovercard-url="/kubernetes/kubernetes/issues/1/hovercard" href="https://github.com/kubernetes/kubernetes/issues/1">#1</a>. User specifies clusterSelector in RC Spec, e.g. The following RC is created in Federation-1 with 3 running clusters a, b and c.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="apiVersion: v1
kind: ReplicationController
metadata:
  name: nginx-controller
spec:
  replicas: 5
  ...
  clusterSelector:   
  name in (a, b) "><pre class="notranslate"><code class="notranslate">apiVersion: v1
kind: ReplicationController
metadata:
  name: nginx-controller
spec:
  replicas: 5
  ...
  clusterSelector:   
  name in (a, b) 
</code></pre></div>
<p dir="auto">The result will be, if scheduling succeeds, the two sub-RC are created, each RC has 5 replicas, one RC is assigned to cluster a, the other RC is assigned to cluster b.<br>
<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="35192602" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/2" data-hovercard-type="issue" data-hovercard-url="/kubernetes/kubernetes/issues/2/hovercard" href="https://github.com/kubernetes/kubernetes/issues/2">#2</a>. User does not specify clusterSelector in RC Spec, e.g. The following RC is created in Federation-1 with 3 running clusters a, b and c.</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> need to discuss should we support this case?</li>
</ul>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="apiVersion: v1
kind: ReplicationController
metadata:
  name: nginx-controller
spec:
  replicas: 5
  ..."><pre class="notranslate"><code class="notranslate">apiVersion: v1
kind: ReplicationController
metadata:
  name: nginx-controller
spec:
  replicas: 5
  ...
</code></pre></div>
<p dir="auto">As a result, the RC will be cloned to 3 sub-RC and assigned to all running clusters a, b, and c in Federation-1.</p>
<p dir="auto"><strong>Code logics, details in the diagram</strong></p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> most of code of package plugin/cmd/kube-scheduler could be reused, minor changes include package import to ube-scheduler, and remove some unnecessary logics.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> The design of ube-scheduler will be created based on k8s scheduler code, but with some logical changes, highlighted in RED in the sequence diagram.</li>
</ul>
<ol dir="auto">
<li>There is no need for binding pod, so Ubernetes scheduler will not check scheduled Federation RC, no code like scheduledPodPopulator</li>
<li>Only default predicate and priority plugins are supported in P1</li>
<li>No need to watch Federation Services, as there is no need for spreading sub-RC of same Federation Service</li>
<li>About scheduler plugins<br>
a). There will be two predicates plugins, MatchClusterSelector and RCFitsResources<br>
b).<br>
From above cases description, I did not see requirement to do prioritize, so only a dummy priority plugin will be created.</li>
<li>The plugin will return a list of clusters, the Federation RC will be cloned as sub-RC and each element of the cluster list will be assigned as target.</li>
<li>As <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="35192559" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/1" data-hovercard-type="issue" data-hovercard-url="/kubernetes/kubernetes/issues/1/hovercard" href="https://github.com/kubernetes/kubernetes/issues/1">#1</a> described, no need for cluster binding, scheduling done after step 5.</li>
</ol>
<p dir="auto"><strong>Dependencies</strong></p>
<p dir="auto">Need definition of cluster, federation RC and sub RC</p>
<ul class="contains-task-list">
<li>Cluster entity is already in WIP</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Federation RC and sub RC definition need to be settled ASAP.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Need api of accessing new defined entities in pkg/client/cache/listers.go</li>
</ul>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/16643108/13914519/d4ef1444-ef89-11e5-958b-acef4e60c9fe.png"><img src="https://cloud.githubusercontent.com/assets/16643108/13914519/d4ef1444-ef89-11e5-958b-acef4e60c9fe.png" alt="scheduler" style="max-width: 100%;"></a></p>