whizard-telemetry:
config:
monitoring:
enabled: true
kind: 1
endpoint: http://prometheus.loki.svc:9090
这里已改为直接请求后端,对应的我的prometheus部署在loki的命名空间
kubectl apply -f https://raw.githubusercontent.com/WizTelemetry/prometheus-charts/refs/heads/main/ks-prometheus/manifests/whizard-telemetry-prometheusRule.yaml
kubectl apply -f kubernetesControlPlane-prometheusRule.yaml
加载 WhizardTelemetry 自定义的 recording rules,也将kube-state-metrics 参数, 增加metric-labels-allowlist
apiVersion: apps/v1
kind: Deployment
metadata:
name: kube-state-metrics
namespace: loki
spec:
replicas: 1
selector:
matchLabels:
app: kube-state-metrics
template:
metadata:
labels:
app: kube-state-metrics
spec:
containers:
- image: kcuatharbor.com/kube-state-metrics/kube-state-metrics:v2.6.0
args:
- --metric-labels-allowlist=\*=[kubesphere.io/workspace,storage.kubesphere.io/storagetype]
livenessProbe:
httpGet:
kubernetesControlPlane-prometheusRule.yaml 部署在loki命名空间
获取不到对应的数据