clickhouse-operator icon indicating copy to clipboard operation
clickhouse-operator copied to clipboard

default: Authentication failed: password is incorrect or there is no user with such name.

Open jiugem opened this issue 3 years ago • 4 comments

My pod: chi-test-chtest-0-0-0.chi-test-chtest-0-0.default.svc.cluster.local

Regular expression: host_regexp:'(chi-test-chtest-\d+-\d+|clickhouse-test).default.svc.cluster.local$'

Not tested

Using the above method, it still doesn't work default/networks/host_regexp: - ^chi-test-chtest-\d-\d.$ - ^chi-test-chtest-\d-\d-\d..$

20211125210725

jiugem avatar Nov 25 '21 13:11 jiugem

@jiugem , if you need to disable hostRegexp, you can do it with this:

spec:
  configuration:
    users:
      default/networks/ip: "::/0"

alex-zaitsev avatar Nov 26 '21 07:11 alex-zaitsev

The purpose is to only allow the nodes in the cluster to use this default empty password to access, so that other nodes can also be configured to access it. @alex-zaitsev

I don’t know if I configured it wrong, my user configuration is as follows:

spec: configuration: users: default/password: "" default/networks/host_regexp: '(chi-test-chtest-\d+-\d+|clickhouse-test).default.svc.cluster.local$' default/networks/ip: - "127.0.0.1" - "::1" default/profile: default default/quota: default settings: disable_internal_dns_cache: 1

jiugem avatar Nov 26 '21 10:11 jiugem

It is configured to work this way by default. If you do not do anything to default user, it generates proper hostRegexp and empty password.

However, sometimes (in GCP, for example) kube-dns does not resolve host correctly, so host_regexp may not work.

As a workaround, you can put IP addresses of all pods to networks/ip.

alex-zaitsev avatar Nov 26 '21 15:11 alex-zaitsev

Thanks for the solution. I had the same problem in my K8s cluster and it was solved by changing the regex to allow all hosts. Not sure but might be a good idea to reflect this change in default values or even in the CH-examples

yasha-dev1 avatar Dec 24 '21 13:12 yasha-dev1