charts icon indicating copy to clipboard operation
charts copied to clipboard

[bitnami/influxdb] InfluxDb probes not working with authEnabled

Open anton-chuhunou opened this issue 6 years ago • 8 comments

Which chart: 0.5.0

Describe the bug With enabled authentication, readiness and liveness probes cannot connect to the influxdb.

To Reproduce

  1. Set:
authEnabled: true
  1. Set:
adminUser:
  name: admin
  pwd: password
  usePasswordFile: false
user:
  name: test
  pwd: password
  usePasswordFile: false
  1. Errors:
"[httpd] 10.52.4.81 - admin [15/Jun/2020:18:18:27 +0000] "POST /query?chunked=true&db=&epoch=ns&q=SHOW+DATABASES HTTP/1.1" 401 33 "-" "InfluxDBShell/1.8.0"

anton-chuhunou avatar Jun 15 '20 18:06 anton-chuhunou

Hi,

I am unable to reproduce the issue. I just did these steps

 1 ❯ cat /tmp/values.yaml
adminUser:
  name: admin
  pwd: password
  usePasswordFile: false
user:
  name: test
  pwd: password
  usePasswordFile: false

❯ kubectl get pods -w
NAME                               READY   STATUS    RESTARTS   AGE
influx-influxdb-756897b885-x26wv   1/1     Running   0          5m4s

As you can see, the probe is working fine. Are you referring to a different probe?

javsalgar avatar Jun 16 '20 09:06 javsalgar

Hi! I can still reproduce it with default values-production.yaml. Clone repo:

git clone [email protected]:bitnami/charts.git

Set admin password:

vi charts/bitnami/influxdb/values-production.yaml

adminUser:
  name: admin
  pwd: password
  usePasswordFile: false

Install to cluster:

helm install --name test-influxdb \
  charts/bitnami/influxdb \
  -f charts/bitnami/influxdb/values-production.yaml
NAME:   test-influxdb
LAST DEPLOYED: Tue Jun 16 08:20:16 2020
NAMESPACE: default
STATUS: DEPLOYED

RESOURCES:
==> v1/ConfigMap
NAME                 DATA  AGE
test-influxdb-relay  1     3s

==> v1/Deployment
NAME                 READY  UP-TO-DATE  AVAILABLE  AGE
test-influxdb-relay  0/2    2           0          3s

==> v1/NetworkPolicy
NAME           AGE
test-influxdb  3s

==> v1/Pod(related)
NAME                                  READY  STATUS             RESTARTS  AGE
test-influxdb-0                       0/1    ContainerCreating  0         3s
test-influxdb-relay-64ccc488d7-29trp  0/1    Running            0         3s
test-influxdb-relay-64ccc488d7-wcvbf  0/1    Running            0         3s

==> v1/Secret
NAME           TYPE    DATA  AGE
test-influxdb  Opaque  1     3s

==> v1/Service
NAME                    TYPE       CLUSTER-IP    EXTERNAL-IP  PORT(S)            AGE
test-influxdb           ClusterIP  10.100.14.39  <none>       8086/TCP,8088/TCP  3s
test-influxdb-headless  ClusterIP  None          <none>       8086/TCP,8088/TCP  3s
test-influxdb-metrics   ClusterIP  10.100.2.159  <none>       9122/TCP           3s
test-influxdb-relay     ClusterIP  10.100.6.94   <none>       9096/TCP           3s

==> v1/StatefulSet
NAME           READY  AGE
test-influxdb  0/3    3s


NOTES:

** Please be patient while the chart is being deployed **


InfluxDB can be accessed through following DNS names from within your cluster:
    InfluxDB Relay (write operations): test-influxdb-relay.default.svc.cluster.local (port 9096)
    InfluxDB servers (read operations):  test-influxdb.default.svc.cluster.local (port 8086)
    InfluxDB Prometheus Metrics: test-influxdb-metrics.default.svc.cluster.local (port 9122)

To get the password for the admin user, run:

    export ADMIN_PASSWORD=$(kubectl get secret --namespace default test-influxdb -o jsonpath="{.data.admin-user-password}" | base64 --decode)

To connect to your database run the following commands:

    (write operations):

    kubectl run test-influxdb-client --rm --tty -i --restart='Never' --namespace default --env="INFLUX_USERNAME=admin" --env="INFLUX_PASSWORD=$ADMIN_PASSWORD" \
        --labels="test-influxdb-client=true" --image docker.io/bitnami/influxdb:1.8.0-debian-10-r48 \
        --command -- influx -host test-influxdb-relay -port 9096

    (read operations):

    kubectl run test-influxdb-client --rm --tty -i --restart='Never' --namespace default --env="INFLUX_USERNAME=admin" --env="INFLUX_PASSWORD=$ADMIN_PASSWORD" \
        --labels="test-influxdb-client=true" --image docker.io/bitnami/influxdb:1.8.0-debian-10-r48 \
        --command -- influx -host test-influxdb -port 8086

Note: Since NetworkPolicy is enabled, only pods with label "test-influxdb-client=true" will be able to connect to InfluxDB server(s).

To connect to your database from outside the cluster execute the following commands:

  (write operations):

    kubectl port-forward svc/test-influxdb-relay 9096:9096 &INFLUX_USERNAME="admin" INFLUX_PASSWORD="$ADMIN_PASSWORD" influx -host 127.0.0.1 -port 9096

  (read operations):

    kubectl port-forward svc/test-influxdb 8086:8086 &INFLUX_USERNAME="admin" INFLUX_PASSWORD="$ADMIN_PASSWORD" influx -host 127.0.0.1 -port 8086

Logs:

kubectl logs my-release-influxdb-0
influxdb 13:27:34.74
influxdb 13:27:34.74 Welcome to the Bitnami influxdb container
influxdb 13:27:34.74 Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-influxdb
influxdb 13:27:34.75 Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-influxdb/issues
influxdb 13:27:34.75
influxdb 13:27:34.75 INFO  ==> ** Starting InfluxDB setup **
influxdb 13:27:34.79 INFO  ==> Initializing InfluxDB...
influxdb 13:27:34.79 INFO  ==> No injected configuration files found. Creating default config files...
influxdb 13:27:34.80 INFO  ==> Deploying InfluxDB with persisted data
influxdb 13:27:34.80 INFO  ==> Stopping InfluxDB...

influxdb 13:27:34.81 INFO  ==> ** InfluxDB setup finished! **
influxdb 13:27:34.83 INFO  ==> ** Starting InfluxDB **
ts=2020-06-16T13:27:34.852958Z lvl=info msg="InfluxDB starting" log_id=0NRKrhm0000 version=1.8.0 branch=1.8 commit=781490de48220d7695a05c29e5a36f550a4568f5
ts=2020-06-16T13:27:34.852983Z lvl=info msg="Go runtime" log_id=0NRKrhm0000 version=go1.13.8 maxprocs=4
ts=2020-06-16T13:27:34.953721Z lvl=info msg="Using data dir" log_id=0NRKrhm0000 service=store path=/bitnami/influxdb/data
ts=2020-06-16T13:27:34.953801Z lvl=info msg="Compaction settings" log_id=0NRKrhm0000 service=store max_concurrent_compactions=2 throughput_bytes_per_second=50331648 throughput_bytes_per_second_burst=50331648
ts=2020-06-16T13:27:34.953815Z lvl=info msg="Open store (start)" log_id=0NRKrhm0000 service=store trace_id=0NRKriAG001 op_name=tsdb_open op_event=start
ts=2020-06-16T13:27:34.958278Z lvl=info msg="Reading file" log_id=0NRKrhm0000 engine=tsm1 service=cacheloader path=/bitnami/influxdb/wal/_internal/monitor/1/_00001.wal size=130643
ts=2020-06-16T13:27:34.985099Z lvl=info msg="Opened shard" log_id=0NRKrhm0000 service=store trace_id=0NRKriAG001 op_name=tsdb_open index_version=inmem path=/bitnami/influxdb/data/_internal/monitor/1 duration=27.368ms
ts=2020-06-16T13:27:34.985203Z lvl=info msg="Open store (end)" log_id=0NRKrhm0000 service=store trace_id=0NRKriAG001 op_name=tsdb_open op_event=end op_elapsed=31.389ms
ts=2020-06-16T13:27:34.985227Z lvl=info msg="Opened service" log_id=0NRKrhm0000 service=subscriber
ts=2020-06-16T13:27:34.985235Z lvl=info msg="Starting monitor service" log_id=0NRKrhm0000 service=monitor
ts=2020-06-16T13:27:34.985242Z lvl=info msg="Registered diagnostics client" log_id=0NRKrhm0000 service=monitor name=build
ts=2020-06-16T13:27:34.985247Z lvl=info msg="Registered diagnostics client" log_id=0NRKrhm0000 service=monitor name=runtime
ts=2020-06-16T13:27:34.985253Z lvl=info msg="Registered diagnostics client" log_id=0NRKrhm0000 service=monitor name=network
ts=2020-06-16T13:27:34.985263Z lvl=info msg="Registered diagnostics client" log_id=0NRKrhm0000 service=monitor name=system
ts=2020-06-16T13:27:34.985284Z lvl=info msg="Starting precreation service" log_id=0NRKrhm0000 service=shard-precreation check_interval=10m advance_period=30m
ts=2020-06-16T13:27:34.985319Z lvl=info msg="Starting snapshot service" log_id=0NRKrhm0000 service=snapshot
ts=2020-06-16T13:27:34.985326Z lvl=info msg="Starting continuous query service" log_id=0NRKrhm0000 service=continuous_querier
ts=2020-06-16T13:27:34.985335Z lvl=info msg="Starting HTTP service" log_id=0NRKrhm0000 service=httpd authentication=true
ts=2020-06-16T13:27:34.985347Z lvl=info msg="opened HTTP access log" log_id=0NRKrhm0000 service=httpd path=stderr
ts=2020-06-16T13:27:34.985352Z lvl=info msg="Auth is enabled but shared-secret is blank. BearerAuthentication is disabled." log_id=0NRKrhm0000 service=httpd
ts=2020-06-16T13:27:34.985380Z lvl=info msg="Storing statistics" log_id=0NRKrhm0000 service=monitor db_instance=_internal db_rp=monitor interval=10s
ts=2020-06-16T13:27:34.985413Z lvl=info msg="Listening on HTTP" log_id=0NRKrhm0000 service=httpd addr=[::]:8086 https=false
ts=2020-06-16T13:27:34.985440Z lvl=info msg="Starting retention policy enforcement service" log_id=0NRKrhm0000 service=retention check_interval=30m
ts=2020-06-16T13:27:34.985608Z lvl=info msg="Listening for signals" log_id=0NRKrhm0000
[httpd] 10.52.18.26 - admin [16/Jun/2020:13:28:46 +0000] "GET /ping HTTP/1.1" 204 0 "-" "InfluxDBShell/1.8.0" 4e09be8c-afd5-11ea-8001-f2b9a404a69b 171
[httpd] 10.52.18.26 - admin [16/Jun/2020:13:28:46 +0000] "POST /query?chunked=true&db=&epoch=ns&q=SHOW+DATABASES HTTP/1.1" 401 33 "-" "InfluxDBShell/1.8.0" 4e09d461-afd5-11ea-8002-f2b9a404a69b 85883
[httpd] 10.52.18.26 - admin [16/Jun/2020:13:29:31 +0000] "GET /ping HTTP/1.1" 204 0 "-" "InfluxDBShell/1.8.0" 68dbf70a-afd5-11ea-8003-f2b9a404a69b 65
[httpd] 10.52.18.26 - admin [16/Jun/2020:13:29:31 +0000] "POST /query?chunked=true&db=&epoch=ns&q=SHOW+DATABASES HTTP/1.1" 401 33 "-" "InfluxDBShell/1.8.0" 68dc0b49-afd5-11ea-8004-f2b9a404a69b 83777
[httpd] 10.52.18.26 - admin [16/Jun/2020:13:30:16 +0000] "GET /ping HTTP/1.1" 204 0 "-" "InfluxDBShell/1.8.0" 83ae5a2f-afd5-11ea-8005-f2b9a404a69b 74
[httpd] 10.52.18.26 - admin [16/Jun/2020:13:30:16 +0000] "POST /query?chunked=true&db=&epoch=ns&q=SHOW+DATABASES HTTP/1.1" 401 33 "-" "InfluxDBShell/1.8.0" 83ae6d67-afd5-11ea-8006-f2b9a404a69b 83795
[httpd] 10.52.18.26 - admin [16/Jun/2020:13:30:34 +0000] "GET /ping HTTP/1.1" 204 0 "-" "InfluxDBShell/1.8.0" 8e9187f4-afd5-11ea-8007-f2b9a404a69b 87
[httpd] 10.52.18.26 - admin [16/Jun/2020:13:30:34 +0000] "POST /query?chunked=true&db=&epoch=ns&q=SHOW+DATABASES HTTP/1.1" 401 33 "-" "InfluxDBShell/1.8.0" 8e919c55-afd5-11ea-8008-f2b9a404a69b 83605
[httpd] 10.52.18.26 - admin [16/Jun/2020:13:31:01 +0000] "GET /ping HTTP/1.1" 204 0 "-" "InfluxDBShell/1.8.0" 9e80c9a6-afd5-11ea-8009-f2b9a404a69b 59

anton-chuhunou avatar Jun 16 '20 13:06 anton-chuhunou

Hi,

I just followed the exact steps and found no issue

 1 ❯ kubectl get pods -w
NAME                                   READY   STATUS    RESTARTS   AGE
infl-influxdb-0                        1/1     Running   0          6m18s
infl-influxdb-1                        1/1     Running   0          4m51s
infl-influxdb-2                        1/1     Running   0          3m44s
infl-influxdb-relay-55d8944db7-jjm2z   1/1     Running   0          6m18s
infl-influxdb-relay-55d8944db7-qhg82   1/1     Running   0          6m18s

Could it be that we are missing something? Which Kubernetes platform are you using?

javsalgar avatar Jun 17 '20 09:06 javsalgar

It is a cluster in GCP:

→ gcloud container clusters list
NAME                           LOCATION    MASTER_VERSION  MASTER_IP       MACHINE_TYPE   NODE_VERSION    NUM_NODES  STATUS
kubernetes-cluster-dev  us-east1-b  1.14.10-gke.37  35.237.186.184  e2-standard-4  1.14.10-gke.37  10         RUNNING

Can you also please check your logs? Do you have the same error messages there?

anton-chuhunou avatar Jun 17 '20 13:06 anton-chuhunou

Also it looks like that issue is reproducible with high-available architecture.

anton-chuhunou avatar Jun 17 '20 15:06 anton-chuhunou

Hi,

I'm sorry, but I'm unable to find the error message in the logs. I see initialization messages and then some access logs. Could you point me to the exact error message you are seeing?

javsalgar avatar Jun 18 '20 09:06 javsalgar

This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.

stale[bot] avatar Jul 03 '20 10:07 stale[bot]

Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.

stale[bot] avatar Jul 10 '20 05:07 stale[bot]