clickhouse-operator
clickhouse-operator copied to clipboard
default: Authentication failed: password is incorrect or there is no user with such name.
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..$
@jiugem , if you need to disable hostRegexp, you can do it with this:
spec:
configuration:
users:
default/networks/ip: "::/0"
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
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.
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