feat: exposure actuator endpoints to improve observability (#4898)

#### What type of PR is this?
/kind feature
/area core
/milestone 2.11.x

#### What this PR does / why we need it:
暴露 Actuator 指标端点以便监控服务状态

暴露了 Actuator 端点并提供角色模板,用户可创建 PAT 用于获取 Halo 运行状态数据或分配给其他用户

#### Which issue(s) this PR fixes:
Fixes #4894

#### Does this PR introduce a user-facing change?
```release-note
暴露 Actuator 指标端点以便监控服务状态
```
pull/4878/head^2
guqing 2023-11-27 21:56:08 +08:00 committed by GitHub
parent 3306b1f881
commit 6d6b1611d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 1 deletions

View File

@ -64,7 +64,7 @@ management:
endpoints:
web:
exposure:
include: ["health", "info", "startup", "globalinfo", "logfile", "shutdown", "restart"]
include: "*"
endpoint:
shutdown:
enabled: true

View File

@ -0,0 +1,14 @@
apiVersion: v1alpha1
kind: "Role"
metadata:
name: role-template-actuator
labels:
halo.run/role-template: "true"
annotations:
rbac.authorization.halo.run/module: "Actuator Management"
rbac.authorization.halo.run/display-name: "Actuator Manage"
rbac.authorization.halo.run/ui-permissions: |
["system:actuator:manage"]
rules:
- nonResourceURLs: [ "actuator", "/actuator/*" ]
verbs: [ "get" ]