apache / apache/iotdb

[Feature request] Support configuring initial credentials via environment variables

Ouverte
#17,319 3 commentaires 2 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Java
Étoiles
6.4k
Forks
1.2k
Merge moyen
1 j 23 h
PR mergées (30 j)
115

Description

### Search before asking

- [x] I searched in the [issues](https://github.com/apache/iotdb/issues) and found nothing similar.

### Motivation

When deploying IoTDB in a containerized or orchestrated environment (e.g. Kubernetes), there is currently no way to set the initial user credentials through environment variables. The only documented approach is to start the server with default credentials, manually connect, and run:

`ALTER USER root SET PASSWORD 'newpwd';`

This is impractical for automated deployments where manual intervention is not an option.

Requested behavior:

The entrypoint/startup scripts should check for the presence of environment variables — for example IOTDB_USER and IOTDB_PASSWORD — and, if set, apply those credentials automatically on first startup. This would allow orchestration tools (Helm charts, Docker Compose, etc.) to inject credentials via secrets without requiring a manual post-deploy step.

Use case:

```
- name: IOTDB_USER
valueFrom:
secretKeyRef:
name: iotdb-secret
key: iotdb-user
- name: IOTDB_PASSWORD
valueFrom:
secretKeyRef:
name: iotdb-secret
key: iotdb-password
```

In a Kubernetes Helm chart, we inject IOTDB_USER and IOTDB_PASSWORD into the pod spec from a Secret:

The environment variables are present inside the container, but IoTDB ignores them entirely. The server starts with the default root/root credentials regardless.

### Solution

If IOTDB_USER and IOTDB_PASSWORD are set, the startup scripts should apply them (e.g. by running the equivalent of ALTER USER root SET PASSWORD ...) so the instance is ready to use with the desired credentials without manual intervention.

### Alternatives

_No response_

### Are you willing to submit a PR?

- [ ] I'm willing to submit a PR!

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par localiser le point d’entrée de IoTDB ou les scripts de démarrage qui initialisent le serveur et les identifiants. Suivez la manière dont le compte root initial est créé, puis déterminez où IOTDB_USER et IOTDB_PASSWORD pourraient être lus lors du premier démarrage. Le travail sera considéré comme terminé lorsqu’un déploiement conteneurisé pourra fournir ces variables et démarrer avec les identifiants demandés sans intervention manuelle avec ALTER USER.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
docker-compose, helm, java, kubernetes
Domaine
authentication, database, devops
Type d'issue
Fonctionnalité
Difficulté
4/5
Temps estimé
3-5 jours
Activité
Calme
Clarté
Plutôt claire
Accessibilité débutants
55/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.