apache / apisix

The Cloud-Native API Gateway
https://apisix.apache.org/blog/
Apache License 2.0
14.45k stars 2.52k forks source link

help request: I deployed the apisix ingress controller on the k8s cluster. Can I use apisix Dashboard to create ApisixRoute and ApisixUpstream? #11679

Open lianfulei opened 1 day ago

lianfulei commented 1 day ago

Description

I deployed the apisix ingress controller on the k8s cluster. Can I use apisix Dashboard to create ApisixRoute and ApisixUpstream?

Environment

mikyll commented 1 day ago

Disclaimer: I'm still learning and I might be missing something, so if someone more experienced than me wants to add or point out inaccuracies, feel free to correct me 🙂


As a general rule you should always manage Kubernetes resources declaratively, via their manifests (YAML).

Technically, there's nothing stopping you from trying to create a resource from the Dashboard UI. However, that won't work properly, because the Dashboard doesn't have access to Kuberentes APIs, which are needed to create Kubernetes resources, such as ApisixRoute and ApisixUpstream.

Instead, it's true the viceversa: when you create or update APISIX in a Kubernetes cluster, the APISIX Ingress Controller detects the changes to both APISIX-specific resources (CRDs like ApisixRoute, ApisixConsumer, ApisixUpstream, etc.) and other Kubernetes resources that make sense in APISIX domain; then, it translates these changes in the corresponding APISIX resources (route, consumer, etc.) via Admin APIs and eventually stores them as key-value entries in etcd DB instances - if not in standalone mode.

Therefore, in a Kubernetes scenario, the APISIX Dashboard can be useful as a visualization tool, in read-only mode, but shouldn't be used to create/update resources, since that would generate an inconsistent configuration, where for example the etcd instance show some resources, but the Kubernetes cluster is missing them.