diff --git a/app/src/cluster.js b/app/src/cluster.js index 05aef4c..28a9b2d 100644 --- a/app/src/cluster.js +++ b/app/src/cluster.js @@ -130,20 +130,23 @@ export default class Cluster extends PIXI.Graphics { nodeBox.y += masterHeight } + /* + Place unassigned pods to the right of the master nodes, or + to the right of the worker nodes if there were no masters. + */ + var unassignedX = masterX === left ? workerX : masterX for (const pod of Object.values(this.cluster.unassigned_pods)) { var podBox = Pod.getOrCreate(pod, this, this.tooltip) - podBox.x = masterX + podBox.x = unassignedX podBox.y = masterY podBox.draw() this.addChild(podBox) - masterX += 20 + unassignedX += 20 } - masterWidth = Math.max(masterX, masterWidth) - workerWidth = Math.max(workerX, workerWidth) this.lineStyle(2, App.current.theme.primaryColor, 1) - const width = Math.max(masterWidth, workerWidth) + const width = Math.max(masterX, masterWidth, workerX, workerWidth, unassignedX) this.drawRect(0, 0, width, top + masterHeight + workerHeight) const topHandle = this.topHandle = new PIXI.Graphics() diff --git a/kube_ops_view/mock.py b/kube_ops_view/mock.py index a7f0b8d..950262a 100644 --- a/kube_ops_view/mock.py +++ b/kube_ops_view/mock.py @@ -85,7 +85,8 @@ def query_mock_cluster(cluster): if i == 8 and int(time.time() / 13) % 2 == 0: continue labels = {} - if i < 2: + # only the first two clusters have master nodes + if i < 2 and index < 2: if index == 0: labels['kubernetes.io/role'] = 'master' elif index == 1: