在Gitlab CI中部署Helm图表时,如何将节点主机名修复太长时间

问题描述 投票:0回答:1

我要实现的目标

嗨,我目前正在尝试通过gitlab CI作业部署一个postgresql-ha(更具体地说是bitnami / postgresql-ha)掌舵图。

我可以在本地取得的成就

在本地运行helm install postgresql ./postgresql-ha时,我可以在远程Kubernetes群集上成功创建图表,而不会出现任何错误。

[./postgresql-habitnami/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进行了设置。

感谢您的帮助!

postgresql kubernetes gitlab-ci kubernetes-helm bitnami
1个回答
3
投票

似乎在pgpool上有一个bug:

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

© www.soinside.com 2019 - 2024. All rights reserved.