apache / apisix-dashboard

Dashboard for Apache APISIX
https://apisix.apache.org/
Apache License 2.0
1.01k stars 527 forks source link

dashboard连接etcd异常 #2882

Open saikey0379 opened 1 year ago

saikey0379 commented 1 year ago

Issue description

镜像版本:apache/apisix-dashboard:3.0.0-alpine 因单节点测试集群,起了单节点etcd,dashboard连接异常报错 连接192.168.159.128:12379,报0.0.0.0:12379 connection refused image

测试容器到etcd的访问是正常的,如下图: image

Expected behavior

正常使用dashboard,无相关异常日志

How to Reproduce

helm安装,修改configmap configmap

apiVersion: v1
data:
  conf.yaml: |-
    conf:
      listen:
        host: 0.0.0.0
        port: 9000
      etcd:
        prefix: "/apisix"
        endpoints:
          - 192.168.159.128:12379
      log:
        error_log:
          level: warn
          file_path: /dev/stderr
        access_log:
          file_path: /dev/stdout
    authentication:
      secret: secret
      expire_time: 3600
      users:
        - username: admin
          password: admin
kind: ConfigMap
metadata:
  annotations:
    meta.helm.sh/release-name: apisix-dashboard
    meta.helm.sh/release-namespace: default
  creationTimestamp: "2023-11-06T11:53:06Z"
  labels:
    app.kubernetes.io/instance: apisix-dashboard
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: apisix-dashboard
    app.kubernetes.io/version: 3.0.0
    helm.sh/chart: apisix-dashboard-0.8.1
  name: apisix-dashboard
  namespace: default
  resourceVersion: "459303"
  uid: 78451dc1-33ee-4cea-b323-01a149fad8af

deployment:

apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    deployment.kubernetes.io/revision: "1"
    meta.helm.sh/release-name: apisix-dashboard
    meta.helm.sh/release-namespace: default
  creationTimestamp: "2023-11-06T11:53:06Z"
  generation: 1
  labels:
    app.kubernetes.io/instance: apisix-dashboard
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: apisix-dashboard
    app.kubernetes.io/version: 3.0.0
    helm.sh/chart: apisix-dashboard-0.8.1
  name: apisix-dashboard
  namespace: default
  resourceVersion: "459356"
  uid: 7df75778-9f83-4df0-b632-4f89260f1223
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app.kubernetes.io/instance: apisix-dashboard
      app.kubernetes.io/name: apisix-dashboard
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      annotations:
        checksum/config: d9c07e6f239cecca5ce3a29f196a86f6821f53e3b890df8b7cb8271666c38d9f
      creationTimestamp: null
      labels:
        app.kubernetes.io/instance: apisix-dashboard
        app.kubernetes.io/name: apisix-dashboard
    spec:
      containers:
      - image: apache/apisix-dashboard:3.0.0-alpine
        imagePullPolicy: IfNotPresent
        livenessProbe:
          failureThreshold: 3
          httpGet:
            path: /ping
            port: http
            scheme: HTTP
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 1
        name: apisix-dashboard
        ports:
        - containerPort: 9000
          name: http
          protocol: TCP
        readinessProbe:
          failureThreshold: 3
          httpGet:
            path: /ping
            port: http
            scheme: HTTP
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 1
        resources: {}
        securityContext: {}
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /usr/local/apisix-dashboard/conf/conf.yaml
          name: apisix-dashboard-config
          subPath: conf.yaml
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      serviceAccount: apisix-dashboard
      serviceAccountName: apisix-dashboard
      terminationGracePeriodSeconds: 30
      volumes:
      - configMap:
          defaultMode: 420
          name: apisix-dashboard
        name: apisix-dashboard-config

Screenshots

No response

Environment

Additional context

No response

hanqingwu commented 9 months ago

can you try to cat /usr/local/apisix-dashboard/conf/conf.yaml in pod apisix-dashboard ?

chenhaipeng commented 6 months ago

问题一样,同求

leosxie commented 5 months ago

我也遇到这个问题,压根没有去读取配置文件中的监听,还是直接去读了默认的127.0.0.1:9000

chenhaipeng commented 5 months ago

我也遇到这个问题,压根没有去读取配置文件中的监听,还是直接去读了默认的127.0.0.1:9000

我已经找到问题了,可以参考https://github.com/chenhaipeng/apisix-docker , cd example , docker-compose up, 可以拉起整个测试环境

hanqingwu commented 4 months ago

如果没有配置 endpoints 则默认127.0.0.1:2379 , 需要确认配置是否正确