Feynman 在master上执行
kubectl edit cm kubesphere-config -n kubesphere-system
找到
alerting:
prometheusEndpoint: http://prometheus-operated.kubesphere-monitoring-system.svc:9090
thanosRulerEndpoint: http://thanos-ruler-operated.kubesphere-monitoring-system.svc:10902
thanosRuleResourceLabels: thanosruler=thanos-ruler,role=thanos-alerting-rules
按i
进行编辑,在下方添加
metering:
retentionDay: 7d
billing:
priceInfo:
currencyUnit: "CNY"
cpuPerCorePerHour: 0.1
memPerGigabytesPerHour: 0.06
ingressNetworkTrafficPerMegabytesPerHour: 0.000006
egressNetworkTrafficPerMegabytesPerHour: 0
pvcPerGigabytesPerHour: 0.0003
之后ctrl+c,输入x保存。
执行kubectl rollout restart deploy ks-apiserver -n kubesphere-system
打开web console,登录后在页面右下角找到锤子图标,点击选择资源消费统计即可查看结果。