Kubernetes 集群的策略治理与多集群应用部署
1. Gatekeeper 策略治理
1.1 策略审计
在 Kubernetes 集群中,使用 Gatekeeper 可以进行策略审计。以下是一个策略配置示例:
spec:
enforcementAction: dryrun
match:
kinds:
- apiGroups:
- ""
kinds:
- Pod
namespaces:
- default
parameters:
repos:
- gcr.io/kuar-demo/
status:
auditTimestamp: "2021-07-14T20:05:38Z"
...
totalViolations: 1
violations:
- enforcementAction: dryrun
kind: Pod
message: container <nginx> has an invalid image repo <nginx>, allowed repos
are ["gcr.io/kuar-demo/"]
name: nginx-noncompliant
namespace: default
在 status 部分, auditTimestamp 表示最后一次审计的时间, totalViolations
超级会员免费看
订阅专栏 解锁全文
3854

被折叠的 条评论
为什么被折叠?



