13.4. 手动启用监控
重要
如果您已经使用 central.monitoring.exposeEndpoint: Enabled
或使用 central.exposeMonitoring: true
Helm Chart 自定义选项启用了监控,请不要在本节中运行命令。
在监控 Red Hat Advanced Cluster Security for Kubernetes 前,您必须启用监控。
流程
修补服务,以公开端口号
9090
。对 Sensor 服务进行补丁:
oc -n stackrox patch svc/sensor -p '{"spec":{"ports":[{"name":"monitoring","port":9090,"protocol":"TCP","targetPort":9090}]}}'
$ oc -n stackrox patch svc/sensor -p '{"spec":{"ports":[{"name":"monitoring","port":9090,"protocol":"TCP","targetPort":9090}]}}'
1 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- 如果使用 Kubernetes,请输入
kubectl
而不是oc
。
对 Central 服务进行补丁:
oc -n stackrox patch svc/central -p '{"spec":{"ports":[{"name":"monitoring","port":9090,"protocol":"TCP","targetPort":9090}]}}'
$ oc -n stackrox patch svc/central -p '{"spec":{"ports":[{"name":"monitoring","port":9090,"protocol":"TCP","targetPort":9090}]}}'
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
修改网络策略以允许入口。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- 如果使用 Kubernetes,请输入
kubectl
而不是oc
。