influxdata / influxdata/influxdata-docker

influxdb:1.8.10 when deploy it on kubernetes don't create admin user

Open
#744 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Shell
Stars
364
Forks
255
Avg merge
3h 18m
Merged PRs (30d)
7

Description

I deployed this container on docker, and it has created correctly the admin user:
```
docker run --name influxdb -t \
-e INFLUXDB_HTTP_AUTH_ENABLED="true" \
-e INFLUXDB_DB="mydatabase" \
-e INFLUXDB_USER="user" \
-e INFLUXDB_USER_PASSWORD="user" \
-e INFLUXDB_ADMIN_USER="admin" \
-e INFLUXDB_ADMIN_PASSWORD="admin" \
--restart unless-stopped \
-d influxdb:1.8.10
```

If I try do deploy the same container in Kubernetes the admin user is not created if the env variable ```INFLUXDB_HTTP_AUTH_ENABLED``` is set to true.
```
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: influxdb
spec:
serviceName: influxdb
replicas: 3
selector:
matchLabels:
app: influxdb
template:
metadata:
labels:
app: influxdb
spec:
containers:
- name: influxdb
image: influxdb:1.8.10
ports:
- containerPort: 8086
name: influxdb-http
protocol: TCP
env:
- name: INFLUXDB_ADMIN_USER
value: "admin"
- name: INFLUXDB_ADMIN_PASSWORD
value: "admin"
- name: INFLUXDB_HTTP_AUTH_ENABLED
value: "true"
securityContext:
allowPrivilegeEscalation: false
```

my **/etc/influxdb/influxdb.conf**
```
reporting-enabled = false

[meta]
dir = "/var/lib/influxdb/meta"

[data]
dir = "/var/lib/influxdb/data"
#engine = "tsm1"
wal-dir = "/var/lib/influxdb/wal"
max-series-per-database = 1000000
max-values-per-tag = 100000
index-version = "tsi1"
max-index-log-file-size = "100k"

[http]
enabled = true
bind-address = ":8086"
log-enabled = false
#auth-enabled = true
https-enabled = false
#https-certificate ="/etc/ldap/ssl/cert.pem"
#https-private-key ="/etc/ldap/ssl/key.pem"
flux-enabled = true
```

My kube version:
```
root@i-07f6d8752e8d92e7a:/opt/_out/grafana# kubectl version
Client Version: v1.30.0
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.28.0
```

If I disable ```INFLUXDB_HTTP_AUTH_ENABLED``` create the admin user but the authentication is not enabled.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by comparing the Docker command with the Kubernetes StatefulSet and the supplied /etc/influxdb/influxdb.conf, focusing on how INFLUXDB_ADMIN_USER, INFLUXDB_ADMIN_PASSWORD, and INFLUXDB_HTTP_AUTH_ENABLED are handled. Reproduce the influxdb:1.8.10 deployment in Kubernetes and verify that the admin user is created while HTTP authentication remains enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, kubernetes
Domain
databases, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.