Getting Apache Airflow™ administrator credentials
The administrator credentials are stored in a secret in the AirflowCluster namespace.
Finding the secret
To find the secret with the credentials for the cluster in question:
-
Get the cluster UID:
kubectl get airflowcluster <cluster_name> \ -n <namespace> \ -o jsonpath='{.metadata.uid}' -
Find the secrets created for this UID:
kubectl get secret -n <namespace> \ -l 'airflow.stackland.yandex.cloud/owner-uid=<cluster_UID>' -
Use the secret name with the
-adminsuffix instead of<secret_name>in the following commands.
Getting a username
kubectl get secret <secret_name> \
-n <namespace> \
-o jsonpath='{.data.username}' | base64 --decode
The default username is admin.
Getting a password
kubectl get secret <secret_name> \
-n <namespace> \
-o jsonpath='{.data.password}' | base64 --decode
Warning
The password gives administrative access to the Apache Airflow™ cluster. Save it in a secure location and do not provide it via logs, messages, or version control system.
Rotating a password
To change the admin's password, edit the password key in its secret. The operator monitors changes in the secret and re-runs account configuration. You cannot edit the username key.
Warning
In the current distribution, a new password of an existing user may not apply automatically. The Ready state does not confirm the password change. You need to log in using the new value. If you failed to log in, follow this guide on regaining access.
-
If the cluster is stopped, restart it.
-
Update only the
passwordkey in the secret you found:kubectl patch secret <secret_name> \ -n <namespace> \ --type=merge \ -p '{"stringData":{"password":"<new_password>"}}' -
Wait until the change is processed and the cluster switches back to
Ready:kubectl get airflowcluster <cluster_name> \ -n <namespace> \ -wIf the cluster does not switch back to
Ready, checkstatus.conditionsby running this command:kubectl describe airflowcluster <cluster_name> -n <namespace>. TheInitialUserReadycondition shows the account configuration result. -
Log out of the web interface, then log in again with the new password.