gpt4 book ai didi

postgresql - 在 Gitlab CI 中部署 helm chart 时如何修复节点主机名太长

转载 作者:行者123 更新时间:2023-11-29 14:24:47 29 4
gpt4 key购买 nike

我要达到的目标

您好,我目前正在尝试通过 gitlab CI 作业部署 postgresql-ha(更具体地说是 bitnami/postgresql-ha)helm chart。

我可以在本地实现什么

在本地,当运行 helm install postgresql ./postgresql-ha 时,我能够在我的远程 Kubernetes 集群上成功创建图表,没有任何错误。

./postgresql-ha 是未修改的 bitnami/postgresql-ha

当我通过 CI 运行它时会发生什么

当我尝试在 Gitlab 的 CI 中运行相同的命令,并正确设置 helmkubectl 时,我收到此错误:

Release "postgresql" does not exist. Installing it now.
Error: template: postgresql-ha/templates/NOTES.txt:60:4: executing "postgresql-ha/templates/NOTES.txt" at <include "postgresql-ha.validateValues" .>: error calling include: template: postgresql-ha/templates/_helpers.tpl:682:51: executing "postgresql-ha.validateValues" at <fail>: error calling fail:
VALUES VALIDATION:
postgresql-ha: Nodes hostnames
PostgreSQL nodes hostnames exceeds the characters limit for Pgpool: 128.
Consider using a shorter release name or namespace.

第一行验证 kubectl/helm 配置。

.gitlab-ci.yml 文件

##########
# Stages #
##########

stages:
- deploy charts

########
# Jobs #
########

deploy_postgresql-ha:
image: dtzar/helm-kubectl:3.0.0
stage: deploy charts
environment:
name: production
script:
- helm upgrade --install postgresql ./postgresql-ha

Kubernetes 集群是通过 Gitlab 的 Kubernetes 集成工具创建的,因此已经根据 this Gitlab Documentation page 进行了设置。 .

在此先感谢您的帮助!

最佳答案

似乎 pgpool 上有一个错误:

由于缓冲区较小,使用长主机名进行 ping 探测失败pgpool 调用“ping -q -c3”并解析结果以确定主机是启动还是关闭。不幸的是,它使用相当小的缓冲区来读取输出,并且 ping 命令的最后一行可能会被截断。这意味着 pgpool 假定主机已关闭。

https://pgpool.net/mantisbt/print_all_bug_page_word.php?search=&sort=&dir=DESC&type_page=html&export=-1&show_flag=0

Bitnami 升级了代码,现在不再允许使用长主机名。 Nodehostname由以下几个部分组成,所以你可以调整:

$nodeHostname := printf "%s-00.%s.%s.svc.%s:1234" $postgresqlFullname $postgresqlHeadlessServiceName $releaseNamespace $clusterDomain }}

https://github.com/bitnami/charts/blob/master/bitnami/postgresql-ha/templates/_helpers.tpl

关于postgresql - 在 Gitlab CI 中部署 helm chart 时如何修复节点主机名太长,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59092737/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com