apache / apache/iotdb

[Feature request] Support configuring initial credentials via environment variables

Offen
#17,319 3 Kommentare 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Java
Sterne
6.4k
Forks
1.2k
Ø Merge
1 T. 23 Std.
Gemergte PRs (30 T.)
115

Beschreibung

### 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!

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne damit, den IoTDB-Einstiegspunkt oder die Startskripte zu finden, die den Server und die Zugangsdaten initialisieren. Verfolge, wie das anfängliche Root-Konto erstellt wird, und ermittle dann, wo IOTDB_USER und IOTDB_PASSWORD beim ersten Start gelesen werden könnten. Als erledigt gilt die Aufgabe, wenn eine containerisierte Bereitstellung diese Variablen bereitstellen und mit den angeforderten Zugangsdaten starten kann, ohne dass manuell ALTER USER ausgeführt werden muss.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
docker-compose, helm, java, kubernetes
Bereich
authentication, database, devops
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
55/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.