update(k8s): add namespace metrics
This commit is contained in:
@@ -24,7 +24,7 @@ def export_data(format: str = "yaml"):
|
|||||||
data = {
|
data = {
|
||||||
"metal_nodes": fetch_all("metal_nodes"),
|
"metal_nodes": fetch_all("metal_nodes"),
|
||||||
"virtual_machines": fetch_all("virtual_machines"),
|
"virtual_machines": fetch_all("virtual_machines"),
|
||||||
"kubernetes": fetch_k8s_data(),
|
"kubernetes": fetch_k8s_data_with_usage(),
|
||||||
}
|
}
|
||||||
|
|
||||||
if format.lower() == "yaml":
|
if format.lower() == "yaml":
|
||||||
|
|||||||
@@ -25,3 +25,25 @@ roleRef:
|
|||||||
kind: ClusterRole
|
kind: ClusterRole
|
||||||
name: metalcheck-clusterrole
|
name: metalcheck-clusterrole
|
||||||
apiGroup: rbac.authorization.k8s.io
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRole
|
||||||
|
metadata:
|
||||||
|
name: metrics-reader
|
||||||
|
rules:
|
||||||
|
- apiGroups: ["metrics.k8s.io"]
|
||||||
|
resources: ["pods"]
|
||||||
|
verbs: ["get", "list", "watch"]
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRoleBinding
|
||||||
|
metadata:
|
||||||
|
name: metrics-reader-binding
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: metalcheck-sa
|
||||||
|
namespace: metalcheck
|
||||||
|
roleRef:
|
||||||
|
kind: ClusterRole
|
||||||
|
name: metrics-reader
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
|||||||
Reference in New Issue
Block a user