Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
marcoferraraUK opened this issue May 2, 2024 · 1 comment

Comments

@marcoferraraUK
Copy link

marcoferraraUK commented May 2, 2024

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.

@dmesad
Copy link

dmesad commented Oct 8, 2024

Any update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants