Postgres Operator UI 提供了一个图形界面,基础即代方便用户体验数据库即服务。设施一旦 database 和/或 Kubernetes (K8s) 管理员设置了 operator,码I门其他团队就很容易创建、基础即代克隆、设施监视、码I门编辑和删除自己的基础即代 Postgres 集群。有关设置和技术细节的设施信息可以在 admin 文档中找到。
admin 文档: https://postgres-operator.readthedocs.io/en/latest/administrator/#setting-up-the-postgres-operator-ui。码I门
在顶部菜单中选择 New cluster 选项并调整文本字段中的基础即代值。集群名称由团队加给定名称组成。设施可用选项包括启用负载均衡器、码I门卷大小、基础即代用户和数据库以及 pod 资源。设施
启用负载均衡器:https://postgres-operator.readthedocs.io/en/latest/administrator/#load-balancers-and-allowed-ip-ranges。码I门卷大小:https://postgres-operator.readthedocs.io/en/latest/user/#increase-volume-size用户和数据库:https://postgres-operator.readthedocs.io/en/latest/user/#manifest-rolespod 资源:https://postgres-operator.readthedocs.io/en/latest/operator-ui/cluster-manifest.md#postgres-container-resources。在左侧,您将看到 Postgres 集群清单的预览,当单击绿色的 Create cluster 按钮时应用该清单。
清单应用于 K8s 后,Postgres Operator 将创建所有必要的资源。服务器托管在 UI status 页面中可以很好地跟踪此过程的进度。
通常,启动最多只需要 1 分钟。如果您觉得流程卡住了,请单击 Logs 按钮检查 operator 日志。如果日志看起来没问题,但 UI 似乎卡住了,请检查您是否配置了与 operator 相同的集群名称标签。
operator:https://github.com/zalando/postgres-operator/blob/master/manifests/configmap.yaml#L13。集群名称标签:https://github.com/zalando/postgres-operator/blob/master/ui/manifests/deployment.yaml#L45。从顶部菜单的 Status 字段中,您还可以检索 operator 正在使用的每个 worker 的日志和队列。可以配置并发 worker 的数量。
配置:https://postgres-operator.readthedocs.io/en/latest/reference/operator_parameters/#general。
启动完成后,您将看到集群地址路径。启用负载均衡器后,列出的路径可用作连接 PostgreSQL 时的站群服务器主机名。但是,请确保您的 IP 在指定的 allowedSourceRanges 范围内。
创建的集群列在 PostgreSQL clusters 菜单下。您可以通过 Status 按钮返回集群的 status 页面。从这两个菜单中,您可以选择编辑清单、克隆或删除集群。
克隆:https://postgres-operator.readthedocs.io/en/latest/user/#how-to-clone-an-existing-postgresql-cluster。
请注意,UI 中尚不支持所有清单选项。如果您尝试将它们添加到编辑器视图中,则不会产生效果。请改用 kubectl 命令。左侧显示的清单也将显示以这种方式修补的参数。
清单选项:https://postgres-operator.readthedocs.io/en/latest/reference/cluster_manifest/。删除集群时,系统会要求您输入其命名空间和名称以确认操作。