使用 OpenShift 的 ConsoleNotification 创建通知横幅
肖娜·吉尔伯特
May 20, 2026


重要消息应该被看到,而不是在收件箱中被忽略或埋没在聊天记录中。
借助 OpenShift 的 ConsoleNotification,您可以直接在 OpenShift 控制台,就在管理员正在积极工作的地方。
无论是传达维护窗口、环境上下文还是操作警告,它都能确保在正确的时间显示正确的信息。
在本文中,我们将详细介绍如何为您的集群配置一个清晰有效的通知横幅。
ConsoleNotification 是 OpenShift 中的一个自定义资源,它允许您直接在 Web 控制台中显示横幅消息。
它非常适用于:
以下是一个简单的YAML文件,供您入门:
apiVersion: console.openshift.io/v1
kind: ConsoleNotification
metadata:
name: example
spec:
text: This is an example notification message with an optional link.
location: BannerTop
link:
href: 'https://www.example.com'
text: Optional link text
color: '#fff'
backgroundColor: '#0088ce'
要部署,只需导入此YAML文件即可。

我们来看看这个YAML文件的内容:
您创建的每个控制台通知都将成为一个独立的横幅。这意味着:

Discover everything you need to know to modernize your asset management strategy.
Inside, you’ll learn:

ActiveG, BPD Zenith, EAM Swiss, InterPro Solutions, Lexco, Peacock Engineering, Projetech, Sharptree, and ZNAPZ have united under one brand: Naviam.
You’ll be redirected to the most relevant page at Naviam.io in a few seconds — or you can
go now.