Skip to main content
Version 3.0

Who gets into ClickHouse,
with which user and from where.

Four scenarios: the administrator's password, login through the company directory, the applications' user, and login through the published URL. Each one covers: what the chart already provides, the values file commented line by line, and a step-by-step with verification.

ChartVersion3.0.3TypeapplicationAppVersion25.8.11.66
CompatibilityKubernetes1.32+OpenShift4.19+Rancher2.10.x+

The ClickHouse from the tdp-clickhouse chart starts with a single user, default, which is the administrator, has a temporary password, and accepts only connections from inside the pod. For applications, the chart can create the tdpuser, which accepts connections from any host. For people, ClickHouse can validate the login against an LDAP or Active Directory. Installation, resources, and exposure are in ClickHouse Configuration.

Your environment

If you fill in your environment details here, the examples and commands on the page use what you entered. The namespace, the release name, and the values file are your choices, not the chart's.

Scenarios​

Replace the default user's temporary password, in the values file or in a Secret.

This scenario sets the password of default, the ClickHouse administrator user.

ClickHouse is leaving the testing phase and the default user, the administrator, still has the temporary password ChangeMe!T3c, the same default password as the TDP charts. You set yours at installation, in one of two ways: directly in the values file, or in a Secret you create, with the password key, which keeps the password out of the values file.

Password

Temporary, in clickhouse.defaultUser.password. The chart stores it in the <RELEASE_NAME>-credentials Secret.

Network

Only connections from inside the pod.

The default user's password

Where the default user's password lives

Your choice changes the commands and passages below.

namespace <NAMESPACE>defaultAdministratorkubectl execClickHouseusers: defaultdefault: local onlyApplications and URLno userDefault user password<RELEASE_NAME>-credentialsPeopleno directory
  1. Administration. The default user is the administrator. With the defaults, it signs in only from inside the pod, with clickhouse-client opened through kubectl exec.
  2. ClickHouse users. The default user is the administrator and accepts only local connections, unless its network is opened. The tdpuser, when enabled, accepts connections from any host. Directory users sign in through the LDAP or Active Directory declared in clickhouse.extraConfig. Chart default: only default. (clickhouse.defaultUser · clickhouse.tdpUser · clickhouse.extraConfig)
  3. The default user's network. The default user rejects requests from other pods, from an Ingress, or from a Gateway. Chart default: local only. (clickhouse.extraUsers)
  4. Clients from other pods and from the published URL. Without the tdpuser or a user of your own, no client outside the pod can sign in: the default user rejects them. Chart default: tdpuser off. (clickhouse.tdpUser.enabled)
  5. Secret with the default user's password. The chart creates this Secret from clickhouse.defaultUser.password. Chart default: temporary password ChangeMe!T3c. (clickhouse.defaultUser.password)
  6. Directory login. LDAP off. Chart default: off. (clickhouse.extraConfig)

Where the default user's password lives: In the values file (default)

namespace <NAMESPACE>defaultAdministratorkubectl execClickHouseusers: defaultdefault: local onlyApplications and URLno userDefault user password<RELEASE_NAME>-credentialsPeopleno directory
  1. Administration. The default user is the administrator. With the defaults, it signs in only from inside the pod, with clickhouse-client opened through kubectl exec.
  2. ClickHouse users. The default user is the administrator and accepts only local connections, unless its network is opened. The tdpuser, when enabled, accepts connections from any host. Directory users sign in through the LDAP or Active Directory declared in clickhouse.extraConfig. Chart default: only default. (clickhouse.defaultUser · clickhouse.tdpUser · clickhouse.extraConfig)
  3. The default user's network. The default user rejects requests from other pods, from an Ingress, or from a Gateway. Chart default: local only. (clickhouse.extraUsers)
  4. Clients from other pods and from the published URL. Without the tdpuser or a user of your own, no client outside the pod can sign in: the default user rejects them. Chart default: tdpuser off. (clickhouse.tdpUser.enabled)
  5. Secret with the default user's password. The chart creates this Secret from clickhouse.defaultUser.password. Chart default: temporary password ChangeMe!T3c. (clickhouse.defaultUser.password)
  6. Directory login. LDAP off. Chart default: off. (clickhouse.extraConfig)

Where the default user's password lives: In your own Secret

namespace <NAMESPACE>defaultAdministratorkubectl execClickHouseusers: defaultdefault: local onlyApplications and URLno userDefault user passwordYour SecretPeopleno directory
  1. Administration. The default user is the administrator. With the defaults, it signs in only from inside the pod, with clickhouse-client opened through kubectl exec.
  2. ClickHouse users. The default user is the administrator and accepts only local connections, unless its network is opened. The tdpuser, when enabled, accepts connections from any host. Directory users sign in through the LDAP or Active Directory declared in clickhouse.extraConfig. Chart default: only default. (clickhouse.defaultUser · clickhouse.tdpUser · clickhouse.extraConfig)
  3. The default user's network. The default user rejects requests from other pods, from an Ingress, or from a Gateway. Chart default: local only. (clickhouse.extraUsers)
  4. Clients from other pods and from the published URL. Without the tdpuser or a user of your own, no client outside the pod can sign in: the default user rejects them. Chart default: tdpuser off. (clickhouse.tdpUser.enabled)
  5. Secret with the default user's password. A Secret you created, with the password key, referenced in clickhouse.defaultUser.password_secret_name. The password does not go through the values file. Chart default: temporary password ChangeMe!T3c. (clickhouse.defaultUser.password_secret_name)
  6. Directory login. LDAP off. Chart default: off. (clickhouse.extraConfig)
Choose above and see where ClickHouse reads the password from. Click the Secret to see the key.

In the values file. Use a private values file. In the values file: Best suited when the values file is private and stays out of Git. It is the default mode.

1tdp-clickhouse:
2clickhouse:
3 defaultUser:
4 password: "<PASSWORD>"

ClickHouse keys live under the chart name.

  1. Chart prefix (linha 1). ClickHouse keys live under the chart name.
  2. Default user password (linha 4). Replace the placeholder with your password.
Default user password

In your own Secret. The password lives in a Secret you create and does not go through the values file. In your own Secret: Best suited when the password must not appear in the values file.

Create the Secret in the ClickHouse namespace, with the password key, before installing:

Terminal input
kubectl -n <NAMESPACE> create secret generic clickhouse-default-password --from-literal=password='<PASSWORD>'

And reference its name in the values file:

1tdp-clickhouse:
2clickhouse:
3 defaultUser:
4 password_secret_name: clickhouse-default-password

The name of the Secret created above. ClickHouse reads the password from the password key, and the password does not go through the values file.

  1. Password Secret (linha 4). The name of the Secret created above. ClickHouse reads the password from the password key, and the password does not go through the values file.
Default user password in a Secret

Apply to the release

The same command installs and upgrades.

Terminal input
helm upgrade --install <RELEASE_NAME> \
oci://registry.tecnisys.com.br/tdp/charts/tdp-clickhouse \
--version 3.0.3 \
-n <NAMESPACE> --create-namespace \
-f <VALUES_FILE>

Connect with the new password

clickhouse-client runs inside the pod, where the default user is accepted.

Terminal input
kubectl -n <NAMESPACE> exec -it chi-<RELEASE_NAME>-<RELEASE_NAME>-0-0-0 -- clickhouse-client --password '<PASSWORD>'

It worked when

The clickhouse-client prompt opens with the password you set. The pod name above applies to a release with the recommended name; kubectl -n <NAMESPACE> get pods -l clickhouse.altinity.com/chi shows the real name.

When something goes wrong​

Troubleshooting

Paste the error message or pick the symptom. The answer comes with the cause, what to do, and the command.

  1. Rendering error: tdpUser.password is required. Cause: The tdpuser is enabled with an empty password. What to do: Set clickhouse.tdpUser.password in a private values file and apply again.
  2. AUTHENTICATION_FAILED or IP_ADDRESS_NOT_ALLOWED. Cause: The client signed in as default from outside the pod: from another pod, from an Ingress, or from a Gateway. The default user accepts only local connections. What to do: Use the tdpuser or a user of your own, as in scenarios 3 and 4.
  3. The tdpuser does not exist or the new password does not work. Cause: The grants Job runs after the installation and after every upgrade and waits for a ready pod behind the clickhouse-<RELEASE_NAME> Service. If the Service has a different name, or the pods do not become ready, the Job never creates the user. What to do: Check the real names of the ClickHouseInstallation, the pods, and the Service, and the Job logs while it exists.
  4. The person signs in through the directory but cannot run anything. Cause: Directory users receive only the roles listed in <roles>, and the role is created without databases or grants. Without a role, or with a role that has no grants, the person signs in but cannot run anything. What to do: Check the role in <roles> and the ldapRoleInit block, and grant privileges to the role as default, as in the grants step of scenario 2.
  5. Another problem. Cause: Start with the logs of the ClickHouse pods. What to do: The ClickHouse pods carry the ClickHouseInstallation label.

Best practices​

  • Replace the temporary passwords of default and tdpuser before using the cluster for anything beyond testing, and keep them in a private values file or, for default, in a Secret.
  • Use default only for administration, from inside the pod. Applications and tools sign in with the tdpuser or with a user of their own.
  • For a client that needs only part of the data, create a user with only the necessary grants, instead of the tdpuser.
  • Open the default user's network only with a strong password.

All parameters​

Filter by name or by group. The chart prefix is already filled in.

8 of 8 parameters

ParameterDescriptionChart default
tdp-clickhouse.clickhouse.defaultUser.passwordAdministratorTemporary password of the default user (replace it)ChangeMe!T3c
tdp-clickhouse.clickhouse.defaultUser.password_secret_nameAdministratorYour own Secret, with the password key, in place of defaultUser.password""
tdp-clickhouse.clickhouse.tdpUser.enabledApplicationsCreates the tdpuser (any host, full privileges) through a post-install Jobfalse
tdp-clickhouse.clickhouse.tdpUser.passwordApplicationsTemporary password of the tdpuser (replace it; empty fails the rendering)ChangeMe!T3c
tdp-clickhouse.clickhouse.extraUsersUsersAdditional users and profiles (XML). Replaces the chart's entire block<profiles> block of the default profile
tdp-clickhouse.clickhouse.extraConfigDirectoryAdditional server configuration (XML), with <ldap_servers> and <user_directories>not defined
tdp-clickhouse.clickhouse.ldapRoleInit.enabledDirectoryCreates the directory role, without databases or grantsnot defined
tdp-clickhouse.clickhouse.ldapRoleInit.roleDirectoryName of the created rolenot defined (example: tdp_ldap_role)

Next steps​