diff --git a/app/src/node.js b/app/src/node.js index bc88da3..7c13a09 100644 --- a/app/src/node.js +++ b/app/src/node.js @@ -13,7 +13,13 @@ export default class Node extends PIXI.Graphics { } isMaster() { - return this.node.labels.master == 'true' + for (var key in this.node.labels) { + if (key == 'node-role.kubernetes.io/master' || + key == 'kubernetes.io/role' && this.node.labels[key] == 'master' || + key == 'master' && this.node.labels[key] == 'true' ) { + return true + } + } } getResourceUsage() { diff --git a/kube_ops_view/mock.py b/kube_ops_view/mock.py index ffbdded..0948cde 100644 --- a/kube_ops_view/mock.py +++ b/kube_ops_view/mock.py @@ -58,7 +58,12 @@ def query_mock_cluster(cluster): continue labels = {} if i < 2: - labels['master'] = 'true' + if index == 0: + labels['kubernetes.io/role'] = 'master' + elif index == 1: + labels['node-role.kubernetes.io/master'] = '' + else: + labels['master'] = 'true' pods = {} for j in range(hash_int((index + 1) * (i + 1)) % 32): # add/remove some pods every 7 seconds