Skip to content

bug: Upstream's created by K8's do not show up in dashboard until a matching route is added #2654

@vibbix

Description

@vibbix

Current Behavior

When adding just an upstream/service to APISIX via Kubectl/kubernetes discovery, they are neither reflected in the UI until a route is created.

Expected Behavior

The upstream should show up in the UI after it's created, even if there is no matching route. If this is intended behavior, it should be mentioned.

Error Logs

2022-11-03T02:27:42+08:00	warn	apisix/upstream.go:70	upstream not found	{"name": "default_httpbin_80", "url": "http://apisix-admin.default.svc.cluster.local:9180/apisix/admin/upstreams/5ce57b8e", "cluster": "default"}
2022-11-03T02:27:42+08:00	warn	ingress/controller.go:707	upstream is not referenced	{"cluster": "name=default; base_url=http://apisix-admin.default.svc.cluster.local:9180/apisix/admin", "upstream": "default_httpbin_80"}

Steps to Reproduce

  1. Install apisix to default (with dashboard)
#values.yaml
namespace: default
gateway:
    type: NodePort
ingress-controller:
    enabled: true
    config:
        apisix:
            serviceNamespace: default
dashboard:
    enabled: true
discovery:
    enabled: true
    kubernetes: { }

helm install -f values.yaml apisix apisix/apisix
2. Label the default namespace
kubectl label namespace default apisix.ingress=watching
3. Install http bin
kubectl run httpbin --image kennethreitz/httpbin --port 80

Apply this YAML file

apiVersion: apisix.apache.org/v2
kind: ApisixUpstream
metadata:
    name: httpbin
spec:
    retries: 3
  1. View dashboard/access admin API
  2. Apply this yaml
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
    name: httpbin-route
spec:
    http:
    - name: rule1
      match:
        hosts:
            - httpbin.com
        paths:
            - /ip
      backends:
        - serviceName: httpbin
          servicePort: 80

Correct entries now show up
image
image

Environment

APISix Kubernetes Helm Chart v0.11.1

2022-11-03T02:27:23+08:00	info	ingress/ingress.go:113	apisix ingress controller started
2022-11-03T02:27:23+08:00	info	ingress/ingress.go:115	version:
Version: 1.5.0
Git SHA: no-git-module
Go Version: go1.19.2
Building OS/Arch: linux/amd64
Running OS/Arch: linux/amd64
bash-5.1# apisix version
/usr/local/openresty/luajit/bin/luajit ./apisix/cli/apisix.lua version
2.15.0
bash-5.1# 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions