检查日志和事件

没有集成的日志查看器。请使用 Kubernetes CLI 命令。

实例状态和事件

kubectl -n <namespace> describe valkey <name>
kubectl -n <namespace> get events --sort-by=.lastTimestamp
kubectl -n <namespace> get pods -l buf.red/name=<name> -o wide

先查看 .status.message 和警告事件。它们通常会先于需要查看容器日志之前,指出 admission、调度、证书、Service、存储或协调失败。

Data Pod 日志

kubectl -n <namespace> logs <pod-name> -c valkey --tail=200
kubectl -n <namespace> logs <pod-name> -c valkey --previous --tail=200
# Run only when the exporter sidecar is enabled.
kubectl -n <namespace> logs <pod-name> -c exporter --tail=200

在容器重启后使用 --previous。对于正在发生的故障,添加 --follow 和限定范围的 --since 值,而不是下载无限制的日志。

集群 Data Pod 和 Sentinel Pod 还运行一个 agent sidecar 容器,用于执行 Pod 内的协调任务。在诊断拓扑、通告或凭证问题时,也要包含它的日志:

kubectl -n <namespace> logs <pod-name> -c agent --tail=200

Sentinel 日志

查找 Sentinel Pod 并检查 sentinel 容器:

kubectl -n <namespace> get pods -l buf.red/name=<name>
kubectl -n <namespace> logs <sentinel-pod> -c sentinel --tail=200

Operator 日志

定位 Operator Deployment,而不要假定其命名空间:

kubectl get deployment -A -l app.kubernetes.io/name=valkey-operator
kubectl -n <operator-namespace> logs deployment/<operator-deployment> \
  --all-containers --since=30m

在提交支持工单时,请提供已移除 Secret 数据的 Valkey YAML、相关事件、Pod 状态、相关容器日志、Operator 日志,以及确切的时间范围。切勿包含 Secret 值或生成的 TLS 私钥。