【发布时间】:2021-03-02 00:39:35
【问题描述】:
使用 terraform 安装 gitlab 时出错
错误:服务“test-gitlab.postgres.database.azure.com-headless”无效:metadata.name:无效值:“test-gitlab.postgres.database.azure.com-headless”:DNS- 1035 标签必须由小写字母数字字符或“-”组成,以字母字符开头,并以字母数字字符结尾(例如“my-name”或“abc-123”,用于验证的正则表达式为“az?” )
我正在尝试使用 terraform 安装带有 helm chart 版本 4.4.4 的 Gitlab,当我尝试使用持久性 postgres 数据库安装时,我收到 postgres 主机名的此错误,下面是我的 values.yaml 文件。 如果我不使用持久的 postgres 它可以工作。 错误说标签必须使用小写字符但我只使用小写不知道它为什么会抛出错误。同样在错误“-headless”被添加到我没有从任何地方添加的postgres主机名中,它也会随着构建而变化。
使用的配置
global:
edition: ce
psql:
password:
secret: gitlabsecret
key: gitlab-password
host: test-gitlab.postgres.database.azure.com
port: 5432
username: postgres@test-gitlab
database: postgres
使用的版本
- 图表:4.4.4
- 云:AKS
- Kubernetes:1.10
- 头盔:1.3.2
错误日志
2020-11-18T16:55:18.313Z [DEBUG] plugin.terraform-provider-helm_v1.3.2_x4: 2020/11/18 16:55:18 [DEBUG] [resourceReleaseExists: gitlab] Done
2020-11-18T16:55:18.313Z [DEBUG] plugin.terraform-provider-helm_v1.3.2_x4: 2020/11/18 16:55:18 [DEBUG] [resourceReleaseCreate: gitlab] Release was created but returned an error
2020/11/18 16:55:18 [DEBUG] helm_release.gitlab: apply errored, but we're indicating that via the Error pointer rather than returning it: Service "test-gitlab.postgres.database.azure.com-headless" is invalid: metadata.name: Invalid value: "test-gitlab.postgres.database.azure.com-headless": a DNS-1035 label must consist of lower case alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character (e.g. 'my-name', or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?')
2020/11/18 16:55:18 [TRACE] <root>: eval: *terraform.EvalMaybeTainted
2020/11/18 16:55:18 [ERROR] <root>: eval: *terraform.EvalApplyPost, err: Service "test-gitlab.postgres.database.azure.com-headless" is invalid: metadata.name: Invalid value: "test-gitlab.postgres.database.azure.com-headless": a DNS-1035 label must consist of lower case alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character (e.g. 'my-name', or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?')
2020/11/18 16:55:18 [ERROR] <root>: eval: *terraform.EvalSequence, err: Service "test-gitlab.postgres.database.azure.com-headless" is invalid: metadata.name: Invalid value: "test-gitlab.postgres.database.azure.com-headless": a DNS-1035 label must consist of lower case alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character (e.g. 'my-name', or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?')
Error: Service "test-gitlab.postgres.database.azure.com-headless" is invalid: metadata.name: Invalid value: "test-gitlab.postgres.database.azure.com-headless": a DNS-1035 label must consist of lower case alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character (e.g. 'my-name', or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?')
【问题讨论】:
-
“错误说标签必须使用小写字符,但我只使用小写” - 它不喜欢你名字中的点(因为点在 DNS 世界中具有特殊含义),字母很好。
-
但是 postgres 主机中会有点,我尝试了类似的 redis 配置,它可以工作,postgress 问题来了
标签: gitlab terraform kubernetes-helm azure-aks