Kubernetes GCP Influxdb无法创建管理员帐户

时间:2019-06-11 19:04:19

标签: kubernetes google-cloud-platform google-kubernetes-engine influxdb

运行安装步骤https://github.com/GoogleCloudPlatform/click-to-deploy/tree/master/k8s/influxdb已停止正常工作,上周工作正常。 Influxdb清单已创建,但是当通过kubectl apply -f部署时,influxdb管理员帐户并未创建,即使已声明,我也无法通过chronograf访问它。

我在此清单中看不到任何错误,也看不到为何不再创建管理员帐户。

---
# Source: influxdb/templates/influxdb-secrets.yaml
apiVersion: v1
kind: Secret
metadata:
  name: influxdb-1-influxdb-secret
  labels:
    app.kubernetes.io/name: influxdb-1
    app.kubernetes.io/component: influxdb-server
stringData:
  influxdb-admin: root
data:
  influxdb-pass: cm9vdAo=

---
# Source: influxdb/templates/manifests.yaml
apiVersion: apps/v1beta2
kind: StatefulSet
metadata:
  labels: &InfluxDBDeploymentLabels
    app.kubernetes.io/name: influxdb-1
    app.kubernetes.io/component: influxdb-server
  name: influxdb-1-influxdb
spec:
  replicas: 1
  selector:
    matchLabels: *InfluxDBDeploymentLabels
  serviceName: influxdb-1-influxdb-svc
  updateStrategy:
    type: RollingUpdate
  template:
    metadata:
      labels: *InfluxDBDeploymentLabels
    spec:
      terminationGracePeriodSeconds: 180
      containers:
      - name: influxdb
        image: marketplace.gcr.io/google/influxdb:1.7
        imagePullPolicy: Always
        args: ["influxd"]
        env:
        - name: INFLUXDB_HTTP_AUTH_ENABLED
          value: 'true'
        - name: INFLUXDB_ADMIN_ENABLED
          value: 'true'
        - name: INFLUXDB_ADMIN_USER
          valueFrom:
            secretKeyRef:
              name: influxdb-1-influxdb-secret
              key: influxdb-admin
        - name: INFLUXDB_ADMIN_PASSWORD
          valueFrom:
            secretKeyRef:
              name: influxdb-1-influxdb-secret
              key: influxdb-pass
        ports:
        - name: influxdb
          containerPort: 8086
          protocol: TCP
        - name: influx-admin
          containerPort: 8088
          protocol: TCP
        - name: influx-graphite
          containerPort: 2003
          protocol: TCP
        livenessProbe:
          tcpSocket:
            port: influxdb
          initialDelaySeconds: 10
          timeoutSeconds: 5
        readinessProbe:
          tcpSocket:
            port: influxdb
          initialDelaySeconds: 5
          timeoutSeconds: 2
        volumeMounts:
         - name: influxdb-1-data-pvc
           mountPath: /var/lib/influxdb
  volumeClaimTemplates:
  - metadata:
      name: influxdb-1-data-pvc
      labels: *InfluxDBDeploymentLabels
    spec:
      resources:
        requests:
          storage: 1Gi
      accessModes:
      - ReadWriteOnce
      storageClassName: standard
---
apiVersion: v1
kind: Service
metadata:
  name: influxdb-1-influxdb-svc
  labels:
    app.kubernetes.io/name: influxdb-1
    app.kubernetes.io/component: influxdb-server
spec:
  ports:
  - name: influxdb
    port: 8086
    protocol: TCP
  selector:
    app.kubernetes.io/name: influxdb-1
    app.kubernetes.io/component: influxdb-server
  type: ClusterIP # LoadBalancer

---

-更新- 使用点击部署市场进行部署时,我会在日志中看到以下内容:

    ts=2019-06-11T20:07:19.520107Z lvl=info msg=“Sending usage statistics to usage.influxdata.com” log_id=0Fz2HIT0000
[httpd] 127.0.0.1 - - [11/Jun/2019:20:07:21 +0000] “GET /ping HTTP/1.1" 204 0 “-” “InfluxDBShell/1.7.6" 854b0e3f-8c84-11e9-8001-125c1c06721c 285
ts=2019-06-11T20:07:21.138286Z lvl=info msg=“Executing query” log_id=0Fz2HIT0000 service=query query=“CREATE USER \“influxdb-admin\” WITH PASSWORD [REDACTED] WITH ALL PRIVILEGES”
[httpd] 127.0.0.1 - - [11/Jun/2019:20:07:21 +0000] “POST /query?chunked=true&db=&epoch=ns&q=CREATE+USER+%22influxdb-admin%22+WITH+PASSWORD+%5BREDACTED%5D+WITH+ALL+PRIVILEGES HTTP/1.1” 200 57 “-” “InfluxDBShell/1.7.6” 854b3017-8c84-11e9-8002-125c1c06721c 99892
/init-influxdb.sh: ignoring /docker-entrypoint-initdb.d/*

但是通过命令行安装时

ts=2019-06-11T20:12:12.679786Z lvl=info msg=“Sending usage statistics to usage.influxdata.com” log_id=0Fz2ZBbW000
[httpd] 127.0.0.1 - - [11/Jun/2019:20:12:14 +0000] “GET /ping HTTP/1.1" 204 0 “-” “InfluxDBShell/1.7.6" 34205cf1-8c85-11e9-8001-b62630ac388d 166
[httpd] 127.0.0.1 - - [11/Jun/2019:20:12:14 +0000] “POST /query?chunked=true&db=&epoch=ns&q=CREATE+USER+%22influxdb-admin%22+WITH+PASSWORD+%5BREDACTED%5D HTTP/1.1” 400 84 “-” “InfluxDBShell/1.7.6” 34207e7c-8c85-11e9-8002-b62630ac388d 240
influxdb init process in progress...
[httpd] 127.0.0.1 - - [11/Jun/2019:20:12:16 +0000] “GET /ping HTTP/1.1" 204 0 “-” “InfluxDBShell/1.7.6" 353c13de-8c85-11e9-8003-b62630ac388d 46
[httpd] 127.0.0.1 - - [11/Jun/2019:20:12:16 +0000] “POST /query?chunked=true&db=&epoch=ns&q=CREATE+USER+%22influxdb-admin%22+WITH+PASSWORD+%5BREDACTED%5D HTTP/1.1” 400 84 “-” “InfluxDBShell/1.7.6” 353c25f0-8c85-11e9-8004-b62630ac388d 256

可以看出生成的查询是不同的

1 个答案:

答案 0 :(得分:1)