GithubHelp home page GithubHelp logo

apisix-book's Introduction

banner

👉 https://cloudnative.to

Hi there 👋

yousa's github stats

  • 🌈 I’m currently working at Tencent. 😎
  • 🐳 I’m currently learning Golang\K8S\OpenResty\APISIX\Istio\Envoy. 😎
  • 🤔 I'm thinking changing the world more or less. 😎
  • 💬 Welcomed to ask me about API gateway or Cloud Native. 😎
  • 📫 How to reach me: email:[email protected]

logo

apisix-book's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

apisix-book's Issues

limit-count

代码里limit-count的lrucache是基于route和service的etcd的index的

不支持精确到consumer

请教下路由中vars怎么使用

{
    "uri": "/",
    "vars": [
        ["http_X-TC-Service", "KitServer"],
        ["http_X-TC-Action", "DescribeModel"]
    ],
    "plugins": {
        "ti-rewrite": {}
    }, 
    "desc": "Ti-Vision KitServer/DescribeModel",
    "upstream": {
        "type": "roundrobin",
        "nodes": {
            "10.73.12.54:12345": 1
        }
    }
}

期望请求头中X-TC-Service为KitServer、X-TC-Action为DescribeModel时能匹配上。但实际请求时会报匹配不到路由。

如何配置类似于Kong的strip_path

怎么实现这样的路由功能:
网关路由:/${app_id}/user/list,服务路由:http://{host}/user/list,类似Kong里的strip_path,去掉指定前缀

proxy http protocol rewrite to https

apisix-dashboard v1.5在配置请求改写 --> 协议 --> https的时候,比如代理百度,即使设置了请求改写为https,仍然代理不过去,返回405状态码。
试过启用proxy rewrite插件来改写,仍然不行。我觉的这是一个apisix的代理层面的问题。
apisix已经解析出来了baidu.com域名对应的ip是39.156.69.79,并且http转成https是成功的,然后用https://39.156.69.79:443这样的url去访问,得到405的响应,这个行为和浏览器直接访问这个url的行为是一致的。
我预期apisix走代理的话类似于nginx配置
proxy_pass https://www.baidu.com;
获得的效果,当我在nginx中这样设置的时候,是可以正常代理过去的,我发现nginx解析baidu.com的ip是14.215.177.39
和在docker内运行的apisix解析的结果不一样,不知道这是什么问题,继续探究吧,有问题会持续反馈。

如何配置全局插件?

看apisix的文档,好像没有不能配置全局插件?比如日志记录kafka-logger,不想每个路由单独配置

adminapi bug

1、adminapi有一个bug就是没判断yaml文件配置的方式,导致接口各种500,不看源码还不知道
2、基本所有的接口都直接ercd.get(key…。理论上应该去修改或获取ymal文件,以支持单机无数据库的部署方式
3、插件的bug,通过adminapi绕过了dashboard进行配置,但结果却和想象中的不一样,不断重定向
4、配置节点的时候不支持cdn的方式。必须写ip,导致dockercompose或k8s必须启动一个独立的网络配置每个服务必须有一个静态ip

竞态?

源码部分摘要:
{init_worker_by_lua_block phase} user_routes = radix_init_worker.init_worker(...) 这里使用ngx.timer.at起了一个thread做sync_data (watch etcd dir) 若event on 则更新user_routes.values .

{access_by_lua_block phase} 请求过来做路由匹配时会读取 user_routes.values :
create_radixtree_router(user_routes.values) for _, route in ipairs(routes) do ... end

问题:
每个worker有一个后台light thread在做sync_data(A thread), 当请求过来触发match时会读取user_routes.values(B thread), 而此时用户触发admin api的routes update, A thread会更新user_routes.values, 而B thread此时正在迭代user_routes.values. It is a race condition.

请教一个关于apisix路由数据初始化的问题

之前看源码,apisix的做法是在timer里面有个异步线程call sync_data , 这个函数里面在程序初次启动时会read /apisix/router目录下的所有配置.

我的问题是:

  1. 首次的full reload会不会很慢?
  2. 如果此时请求过来 恰好对应的用户路由配置还没有加载进memory, 那岂不是会报404,影响到用户使用?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.