apache / apache/iotdb

[Feature request] Support configuring initial credentials via environment variables

Aperta
#17,319 3 commenti 2 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Java
Stelle
6.4k
Fork
1.2k
Merge medio
1g 23h
PR unite (30g)
115

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia individuando l’entrypoint di IoTDB o gli script di avvio che inizializzano il server e le credenziali. Traccia il modo in cui viene creato l’account root iniziale, quindi determina dove IOTDB_USER e IOTDB_PASSWORD potrebbero essere letti durante il primo avvio. Il lavoro sarà considerato completato quando un deployment containerizzato potrà fornire queste variabili e avviarsi con le credenziali richieste senza dover eseguire manualmente ALTER USER.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
docker-compose, helm, java, kubernetes
Ambito
authentication, database, devops
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
55/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.