0
votes

Getting error while installing gitlab using terraform

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?')

I am trying to install Gitlab with helm chart version 4.4.4 using terraform , when I am trying install using persistent postgres database I am getting this error for postgres hostname, below is my values.yaml file. if i dont use persistent postgres it works. Error says label must use lower case character but I am using lower case only dont know why it is throwing error. Also in the error "-headless" is getting added to the postgres hostname which i am not adding from anywhere , it also changes from build to build.

Configuration used

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

Versions used

  • Chart: 4.4.4
  • Cloud: AKS
  • Kubernetes: 1.10
  • Helm: 1.3.2

Error log

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])?')
1
"Error says label must use lower case character but I am using lower case only" - it doesn't like the dot in your name (as dots have special meaning in the DNS world), the letters are fine. - Grzegorz Oledzki
but postgres host will have dot in it , i tried similar configuration for redis and it works , issue is coming for postgress - Umesh Kumar

1 Answers

0
votes

I got issue resolved by explicitly settting postgres install to false in values.yaml.

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
postgresql:
  install: false