You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by ju...@apache.org on 2021/10/26 05:59:55 UTC
[apisix-website] 01/01: docs: update blog on 2021.08
This is an automated email from the ASF dual-hosted git repository.
juzhiyuan pushed a commit to branch docs-202108
in repository https://gitbox.apache.org/repos/asf/apisix-website.git
commit 1784c909cdfc08cf2dd45b9de3673a7cab7b995e
Author: juzhiyuan <ju...@apache.org>
AuthorDate: Tue Oct 26 13:59:41 2021 +0800
docs: update blog on 2021.08
---
website/blog/2021/08/05/Kong-to-APISIX.md | 4 +-
...apisix-to-improve-the-observability-of-nginx.md | 210 +++++++--------
website/blog/2021/08/10/apisix-nginx.md | 282 ++++++++++-----------
website/blog/2021/08/11/interview-TuZhengsong.md | 142 +++++------
website/blog/2021/08/17/interview-airwallex.md | 87 ++++---
.../08/18/Auth-with-Casbin-in-Apache-APISIX.md | 74 +++---
.../2021/08/19/go-makes-Apache-APISIX-better.md | 128 +++++-----
website/blog/2021/08/21/shanghai-meetup.md | 98 +++----
website/blog/2021/08/23/ApacheCon-Asia-2021.md | 117 +++++----
website/blog/2021/08/24/shanghai-meetup-recap.md | 60 +++--
...onnect-Plugin-for-Centralized-Authentication.md | 258 +++++++++----------
website/blog/2021/08/30/Ingress-Meeting.md | 46 ++--
website/blog/2021/08/30/weekly-report.md | 78 +++---
...a-better-gateway-and-K8S-Ingress-Controller.md" | 146 +++++------
14 files changed, 863 insertions(+), 867 deletions(-)
diff --git a/website/blog/2021/08/05/Kong-to-APISIX.md b/website/blog/2021/08/05/Kong-to-APISIX.md
index 0517904..b2af493 100644
--- a/website/blog/2021/08/05/Kong-to-APISIX.md
+++ b/website/blog/2021/08/05/Kong-to-APISIX.md
@@ -18,11 +18,11 @@ tags: [Technology]
Apache APISIX is a production-ready open source seven-layer full traffic processing platform that serves as an API gateway for business entry traffic with high performance, low latency, official dashboard support, and over fifty plugins. If you are using Kong and are interested in APISIX but struggle to get started, try our just open source migration tool Kong-To-APISIX to help you migrate smoothly with one click.
-## What is Kong-To-APISIX?
+## What is Kong-To-APISIX
[Kong-To-APISIX](https://github.com/api7/kong-to-apisix) leverages the declarative configuration files of Kong and APISIX to migrate configuration data, and adapts to the architecture and functionality of both sides. Currently, we support the migration of configuration data for Route, Service, Upstream, Target, Consumer and three plugins Rate Limiting, Proxy Caching and Key Authentication on one side of Kong, and we have completed a minimal demo using Kong’s Getting Started Guide as an e [...]
-## How to Migrate?
+## How to migrate configuration
1. To export a Kong declarative configuration file using Deck, refer to the following steps: [Kong Official Document: Backup and Restore of Kong’s Configuration](https://docs.konghq.com/deck/1.7.x/guides/backup-restore/)
diff --git a/website/blog/2021/08/06/using-apache-apisix-to-improve-the-observability-of-nginx.md b/website/blog/2021/08/06/using-apache-apisix-to-improve-the-observability-of-nginx.md
index 47536da..a139fcf 100644
--- a/website/blog/2021/08/06/using-apache-apisix-to-improve-the-observability-of-nginx.md
+++ b/website/blog/2021/08/06/using-apache-apisix-to-improve-the-observability-of-nginx.md
@@ -1,213 +1,213 @@
---
-title: "如何利用 Apache APISX 提升 Nginx 的可观测性"
-author: "金卫"
+title: How to Improve the Observability of Nginx with Apache APISX
+author: Wei Jin
authorURL: "https://github.com/gxthrj"
authorImageURL: "https://avatars.githubusercontent.com/u/4413028?v=4"
keywords:
-- API 网关
+- API Gateway
- APISIX
- Apache APISIX
- Nginx
-- 可观测性
-description: 最佳实践:本文将从 Nginx 可观测性、Apache APISIX 与 Nginx 的关系、Apache APISIX 可观测性,以及结合 Apache SkyWalking 进一步提升可观测性这些方面分享关于可观测性的方案与实践。
+- observability
+description: Best Practices: This article shares solutions and practices for observability in the context of Nginx observability, the relationship between Apache APISIX and Nginx, Apache APISIX observability, and further enhancing observability with Apache SkyWalking.
tags: [Practical Case]
---
-> 本文将从 Nginx 可观测性、Apache APISIX 与 Nginx 的关系、Apache APISIX 可观测性,以及结合 Apache SkyWalking 进一步提升可观测性这些方面分享关于可观测性的方案与实践。
+> This article shares solutions and practices for observability in the context of Nginx observability, the relationship between Apache APISIX and Nginx, Apache APISIX observability, and further enhancing observability in conjunction with Apache SkyWalking.
-<!--truncate-->
+<! --truncate-->
-## 概述
+## Overview
-“可观测性“是一种度量手段,方便掌握基础设施、系统平台或者应用程序的运行状况。常见的手段是收集 metrics、logging 和 tracing 及 events 数据,可以帮助开发人员和运维人员检测、调查、预警和纠正系统问题。
+"Observability" is a metric that allows you to keep track of how your infrastructure, system platform, or application is performing. Commonly, metrics, logging, and tracing and events data are collected to help developers and operations staff detect, investigate, alert, and correct system problems.
-本文将从 Nginx 可观测性、Apache APISIX 与 Nginx 的关系、Apache APISIX 可观测性,以及结合 Apache SkyWalking 进一步提升可观测性这些方面分享关于可观测性的方案与实践。
+In this article, we will share solutions and practices for observability in the context of Nginx observability, the relationship between Apache APISIX and Nginx, Apache APISIX observability, and further observability improvements in conjunction with Apache SkyWalking.
-## Nginx 的可观测性
+## Nginx Observability
-### Nginx 常见监控方式
+### Common monitoring methods for Nginx
-Nginx 在一定程度上能够做到可观测,以下罗列出 Nginx 的常见监控方式:
+Nginx is observable to some extent, and the following is a list of common monitoring methods for Nginx.
1. ngx_http_stub_status_module
-2. VTS module + exporter + prometheus + grafana(如果 Nginx 版本比较低,需要引入 exporter )
+2. VTS module + exporter + prometheus + grafana (if you have a low version of Nginx, you need to introduce exporter)
3. Nginx Amplify SaaS
#### ngx_http_stub_status_module
-ngx_http_stub_status_module 主要收集实例级别的统计信息。
+The ngx_http_stub_status_module mainly collects instance-level statistics.
#### VTS module
-VTS module 有 3 个比较明显的缺点:
+The VTS module has 3 obvious drawbacks.
-1. **安装复杂**:虽然 VTS module 能够采集指标,采集的指标类型也比较多,但是它的安装比较复杂。如果想要采用 VTS module,需要重新编译 Nginx,在编译 Nginx 之前加入 VTS moudle,完成编译后重新安装 Nginx 才可以正常使用 VTS。
+1. **Complex installation**: Although VTS module is able to collect metrics and collect more types of metrics, it is more complex to install. If you want to use the VTS module, you need to recompile Nginx, add the VTS moudle before compiling Nginx, and reinstall Nginx after completing the compilation before you can use VTS properly. 2.
-2. **扩展能力弱**:VTS 扩展能力分为两部分,一是在编译之前给 VTS 增加扩展;二是在编译之后增加扩展 —— 修改 nginx.conf 配置文件。通过修改 nginx.conf 文件来增加扩展会使 Nginx reload,生产环境直接 reload 或多或少会对业务产生一些影响。
+2. **Weak extensibility**: VTS extensibility is divided into two parts: one is to add extensions to VTS before compilation; the other is to add extensions after compilation -- modifying the nginx.conf configuration file. Adding extensions by modifying the nginx.conf file will cause Nginx to reload, and a direct reload of the production environment may have some impact on the business.
-3. **社区更新缓慢**:VTS module 最新的一次更新是在 2018 年,已经停摆 3 年了。
+3. **Slow community updates**: The last update to the VTS module was in 2018, and it has been down for 3 years.
#### Nginx Amplify SaaS
-Nginx Amplify 是一个 SaaS 服务,Nginx Amplify 在远端提供服务,在 Nginx 服务之外安装 Agent。
-在 Nginx 之外安装采集模块,那么在采集指标上就会有限制,只能拿到 Nginx 暴露出来的信息,没有暴露的内部信息是拿不到的。
+Nginx Amplify is a SaaS service where Nginx Amplify provides services on the remote end and installs agents outside of the Nginx service.
+If you install the collection module outside of Nginx, you are limited in the metrics you can collect, and you can only get the information exposed by Nginx, not the internal information that is not exposed.
-另外,由于 Nginx Amplify SaaS 是一个 SaaS 服务,需要通过公网将采集到的数据传到服务端,这会带来一些安全隐患,同时把一些企业用户阻挡在外面。或许 Nginx Amplify 的目标群体是 Nginx plus 这样的企业用户,不是开源用户。
+In addition, because Nginx Amplify SaaS is a SaaS service, you need to transfer the collected data to the server through the public network, which can pose some security risks and keep some enterprise users out. Perhaps Nginx Amplify is targeted at enterprise users like Nginx plus, not open source users.
-另外,Nginx Amplify SaaS 社区也不活跃,已经停摆 2 年。
+Also, the Nginx Amplify SaaS community is not active and has been down for 2 years.
-### Nginx 的缺陷
+### Nginx's flaws
-Nginx 在 Events 收集上自身有缺陷,这里列举出两个问题:
+Nginx has its own flaws in Events collection, two of which are listed here.
-1. Nginx 基于 nginx.conf 进行配置,修改后通过 reload nginx.conf 文件使配置生效。除 reload 事件外,没有其他 Events 可用,我们无法得知每次修改文件的变化,如:起初只配置 1 个路由,修改文件增加 10 个路由,只有 reload 事件无法得知增加的到低是哪 10 个路由。
+Nginx is configured based on nginx.conf, which is reloaded after changes are made to the nginx.conf file. There are no Events available other than reload events, so we can't know what has changed each time we modify the file, e.g., if we start with one route and modify the file to add 10 routes, we won't know which 10 routes have been added with only reload events.
-2. Nginx 开源产品缺少主动健康检查。Nginx 是一个反向代理,真正的后端服务可能会出现重启、升级或者异常的情况,如果没有主动的健康检查,依靠被动检查,只能在流量出现异常的时候,才知道服务出了问题,这会丢掉很多 Events,导致上游 Events 事件信息不完整。
+Nginx is a reverse proxy, and the real backend service may be restarted, upgraded, or abnormal, so without active health checks and relying on passive checks, we will only know that something is wrong with the service when the traffic is abnormal, which will throw away many Events and result in incomplete information about upstream Events. .
-### Nginx 可观测性总结
+### Nginx Observability Summary
-Nginx 的开源版本没有提供非常好用的监控。虽然 Nginx 提供了一些监控工具,但这些工具的安装和配置非常复杂,几乎没有扩展性。可能这些工具的设计并不是为了可观测性,只是为了能看到指标或统计数据,方便定位问题。现在有各种可观测性设置类的产品,但是很难集成到 Nginx 上。
+The open source version of Nginx does not provide very good monitoring. Although Nginx provides some monitoring tools, they are very complex to install and configure and have little scalability. It is possible that these tools are not designed for observability, but simply to be able to see metrics or statistics to easily pinpoint problems. There are various observability setup products available, but they are difficult to integrate into Nginx.
-另外,Nginx 社区停滞不前,导致 Nginx 迭代速度慢。
+In addition, the Nginx community is stagnant, resulting in slow iterations of Nginx.
-## Apache APISIX 概述
+## Apache APISIX Overview
-### Apache APISIX 与 Nginx 的关系
+### Apache APISIX in relation to Nginx
-
+! Relationship between [Apache APISIX and Nginx](https://static.apiseven.com/202108/1630651158638-aba4e627-d2d6-4bf5-b431-61eb3913a296.png)
-Apache APISIX 基于 Nginx 实现,但只依赖 Nginx 的网络库,在 Nginx 基础上,Apache APISIX 实现了自己的核心的代码,并预留了扩展机制。
+Apache APISIX is based on the Nginx implementation, but relies only on the Nginx network libraries. On top of Nginx, Apache APISIX implements its own core code, with extension mechanisms reserved.
-在表格中列出了 Apache APISIX 和 Nginx 的功能对比,Apache APISIX 既可以做反向代理,又可以实现一些 Nginx 不支持的功能,如:主动健康检查、流量管理、横向扩缩容等,而且这些功能都是开源的。
+The table shows a comparison of Apache APISIX and Nginx features. Apache APISIX can do both reverse proxy and implement some features that Nginx does not support, such as: active health checking, traffic management, horizontal scaling, etc., and these features are open source.
-- **API 设计**:在 API 设计方面使用 Apache APISIX 更加简单。
-- **开源 Dashboard**:在界面上就能把反向代理全部配置完。
-- **主动健康检查**:Apache APISIX 支持主动健康检查,可以结合 Events 完善可观测性。
-- **流量管理**:适合监测数据,或者在业务发布上线时使用。
-- **横向扩缩容**:Apache APISIX 支持横向扩缩容,这个特性得益于 Apache APISIX 的架构(见下图)。
-- **插件扩展机制**:Apache APISIX 的插件扩展机制使其具有极为强大的扩展能力。
-- **插件编排**:按照业务需求,将多个插件按照逻辑编排,组合起来使用。
-- **证书管理**:Apache APISIX 支持动态的证书管理。
+- **API Design**: It is simpler to use Apache APISIX for API design.
+- **Open Source Dashboard**: The reverse proxy can be configured all in the interface.
+- **Active Health Check**:Apache APISIX supports active health checks, which can be combined with Events to improve observability.
+- **Traffic Management**: Suitable for monitoring data, or for use when a business release goes live.
+- **Horizontal Scaling**: Apache APISIX supports horizontal scaling, a feature that is made possible by the Apache APISIX architecture (see below).
+- **Plug-in extension mechanism**: Apache APISIX's plug-in extension mechanism makes it extremely powerful and scalable.
+- **Plugin orchestration**: Multiple plugins are logically orchestrated and combined for use according to business requirements.
+- **Certificate Management**: Apache APISIX supports dynamic certificate management.
-
+! [Apache APISIX Architecture Diagram](https://static.apiseven.com/202108/1630651158643-ecc67e12-2076-41e5-88d8-baa14144f35d.png)
-### Apache APISIX 简介
+### Apache APISIX Introduction
-Apache APISIX 是一个动态、实时、高性能的 API 网关,提供负载均衡、动态上游、灰度发布、服务熔断、身份认证、可观测性等丰富的流量管理功能。Apache APISIX 也是全世界最活跃的开源 API 网关项目,是生产可用的高性能网关。全球已有数百家企业使用 Apache APISIX 处理关键业务流量,涵盖金融、互联网、制造、零售、运营商等等,比如美国航空航天局(NASA)、欧盟的数字工厂、中国航信、中国移动、腾讯、华为、微博、网易、贝壳找房、360、泰康等。
+Apache APISIX is a dynamic, real-time, high-performance API gateway that provides load balancing, dynamic upstream, grayscale publishing, service meltdown, authentication, observability, and other rich traffic management features. Apache APISIX is also the world's most active open source API gateway project, and is a production-ready, high-performance gateway. Hundreds of enterprises around the world have used Apache APISIX to handle business-critical traffic, covering finance, Internet, [...]
-### Apache APISIX 解决方案
+### Apache APISIX Solution
-
+! [Apache APISIX Full Traffic Solution](https://static.apiseven.com/202108/1630651158645-83c22975-ebf1-4861-8b61-38639a28875a.png)
-上图左边,从上往下是从单体服务到 SOA(面向服务的架构)到微服务的演进过程。
+On the left side of the diagram above, the evolution from top to bottom is from monolithic services to SOA (Service Oriented Architecture) to microservices.
-在 SOA 下,网关一般采用 Nginx 或者 HAProxy;在微服务架构下,网关使用 Nginx 做负载均衡。微服务架构有两个比较常见的解决方案:一个是基于 Java 技术栈实现,如 Spring Cloud 系列;另一个是 Service Mesh。
+Under SOA, gateways typically use Nginx or HAProxy; under microservices architecture, gateways use Nginx for load balancing. There are two common solutions for microservices architecture: one is based on Java technology stack implementation, such as Spring Cloud series; the other is Service Mesh.
-在这个演进过程中,Apache APISIX 处于什么位置,能做什么呢?
+Where does Apache APISIX fit into this evolutionary process and what can it do?
-简单的说,左图中红色的部分(Nginx / HAProxy / Kong / Spring Cloud Zuul / Spring Cloud Gateway / Traefik / Envoy / Ingress Nginx)都可以替换为 Apache APISIX 的解决方案。
+Simply put, the parts in red in the diagram on the left (Nginx / HAProxy / Kong / Spring Cloud Zuul / Spring Cloud Gateway / Traefik / Envoy / Ingress Nginx) can all be replaced with an Apache APISIX solution.
-**在 SOA 下有 Apache APISIX SLB 解决方案,在微服务架构下有 Apache APISIX Gateway,在 Kubernetes 部署有 Apache APISIX Ingress,在 Service Mesh 里部署有 Apache APISIX mesh**。
+**In SOA there is Apache APISIX SLB solution, in microservice architecture there is Apache APISIX Gateway, in Kubernetes deployment there is Apache APISIX Ingress, in Service Mesh deployment there is Apache APISIX mesh**.
-
+! [Apache APISIX Full Traffic Data Surface](https://static.apiseven.com/202108/1630651158648-dffd59dd-15c2-4f76-832e-5ed3763b18e5.png)
-从业务请求的流量方面看,当客户端发起请求时会经过 LB,经过 Gateway,请求被分发到后端业务服务。红色的部分(LB / Gateway / Spring Cloud Gateway / K8s Ingress / Sidecar)都可以选择 Apache APISIX 作为解决方案。Apache APISIX 支持多语言开发插件,可以在 Java 体系下使用 Java 编写插件。
+In terms of service request traffic, when a client initiates a request, it passes through the LB, passes through the Gateway, and the request is distributed to the back-end business service. The parts in red (LB / Gateway / Spring Cloud Gateway / K8s Ingress / Sidecar) can all choose Apache APISIX as the solution. Apache APISIX supports multi-language development plug-ins and can be written in Java under the Java architecture.
-Apache APISIX 是全流量的数据面,在 LB、Gateway、Ingress、sidecar 方面 Apache APISIX 都有相应的解决方案,他们是统一的解决方案,在可观测性方面也是统一的方案。当解决方案统一时,管理控制链也是很容易实现出来的。
+Apache APISIX is a full-flow data plane, and Apache APISIX has solutions for LB, Gateway, Ingress, and sidecar, and they are unified solutions in terms of observability. When the solution is unified, the management control chain is also easy to implement out.
-## Apache APISIX 的可观测性
+## Apache APISIX Observability
-简单了解完 Nginx 和 Apache APISIX 之后,现在有两个问题:Apache APISIX 在可观测性上可以做哪些事情?Apache APISIX 可观测性上的优势在哪里?
+After a brief look at Nginx and Apache APISIX, here are two questions: What can Apache APISIX do in terms of observability, and what are the advantages of Apache APISIX observability?
-### Apache APISIX 支持采集的数据类型
+### Types of data Apache APISIX supports to collect
-Apache APISIX 支持采集的数据类型:
+Apache APISIX supports the following types of data collection.
-1. Tracing - 集成 SkyWalking
-2. Metrics - 集成 SkyWalking / Prometheus
-3. Logging - 集成 SkyWalking / 其他日志平台
+1. Tracing - integrated with SkyWalking
+2. Metrics - integrated with SkyWalking / Prometheus
+3. Logging - integration with SkyWalking / other logging platforms
-Apache APISIX 是一个网关类的产品,可以替代 Nginx 或者其他的网关;在可观测性上 Apache APISIX 可以集成多个 APM 或可观测性系统,如:Tracing 部分可以集成 SkyWalking,Metrics 指标上可以集成 SkyWalking 或 Prometheus,Logging 可以集成 SkyWalking 以及其他一些日志系统。
+Apache APISIX is a gateway-type product that can replace Nginx or other gateways; in terms of observability Apache APISIX can integrate with multiple APM or observable systems, e.g. Tracing part can integrate with SkyWalking, Metrics can integrate with SkyWalking or Prometheus, Logging can integrate with SkyWalking and other logging systems.
-### Apache APISIX 在可观测性上的优势
+### Apache APISIX advantages in observability
-#### 高度扩展能力
+#### High Scalability
-为什么 Apache APISIX 拥有强大的扩展能力?因为 Apache APISIX 支持多语言编写插件,可以使用 Lua、Java、Golang 等编程语言编写插件。Apache APISIX 可以通过插件扩展自身的能力。上文提到的三种数据类型,都是通过插件机制来实现的。
+Why does Apache APISIX have great extensibility? Because Apache APISIX supports writing plug-ins in multiple languages and can write plug-ins in programming languages such as Lua, Java, Golang, etc. Apache APISIX can extend its capabilities through plug-ins. The three data types mentioned above are implemented through the plug-in mechanism.
-#### 灵活的配置能力
+#### Flexible Configuration Capabilities
-举三个例子来介绍一下 Apache APISIX 灵活的配置能力。
+Three examples are given to illustrate the flexible configuration capabilities of Apache APISIX.
-第一个例子是 **Apache APISIX 可以在运行时修改 logging 的配置**,如:增加或修改日志字段。修改日志字段是一个比较常见的需求,比如:业务刚开始上线时,配置好了日志字段,系统运行一段时间后,需要修改或者增加几个日志字段。如果使用 Nginx,通过修改 nginx.conf 文件实现需求,reload 使配置生效。 **Apache APISIX 只需要通过脚本把字段配置好,就会动态生效**。
+The first example is **Apache APISIX can modify the configuration of logging at runtime**, for example, by adding or modifying logging fields. Modifying logging fields is a relatively common requirement. For example, when a business first goes live, logging fields are configured, and after the system has been running for a while, several logging fields need to be modified or added. If you are using Nginx, you can do this by modifying the nginx.conf file and reloading the configuration to [...]
-第二个灵活配置能力的例子是 Prometheus 的使用。在 Apache APISIX 里,想要创建 / 删除某一个 metric 或者扩展 metrics labels,只需要在 Prometheus 插件里新增一个 metircs 或者填写相关信息,Apache APISIX 有 hot reload 机制可以直接生效,不需要重启。
+A second example of flexible configuration capabilities is the use of Prometheus. In Apache APISIX, if you want to create/delete a metric or extend metrics labels, just add a new metircs or fill in the relevant information in the Prometheus plugin, and Apache APISIX has a hot reload mechanism to take effect directly without restarting.
-第三个灵活的配置能力体现在 Apache APISIX 的实现。Apache APISIX 把路由对象全部管理起来,在内存里有一套对象管理机制。在 Apache APISIX 里给某个 API 加插件,生效的级别可以细化到 API,每一个 API 都可以绑定插件,也可以从 API 上把插件去掉。 Apache APISIX 可以精细化控制到每一个服务里面每一个 API 的可观测性数据采集。换句话说,你可以只采集最关心的数据,而且这些配置都是动态生效的,可以随时调整。
+The third flexible configuration capability is in the Apache APISIX implementation, which manages all routing objects and has a set of object management mechanisms in memory. In Apache APISIX, you can add a plug-in to an API, and the level of effect can be refined to the API, and each API can be bound to the plug-in or the plug-in can be removed from the API. Apache APISIX can be fine-grained to control the observable data collection for each API in each service. In other words, you can [...]
-#### 活跃的社区
+#### Active Community
-Apache APISIX 最重要的一个优势是有一个活跃的社区,一个活跃的社区可以让产品快速迭代、变得越来越完善,让大家的需求得到满足。
+One of the most important advantages of Apache APISIX is that there is an active community, and an active community allows the product to iterate quickly, get better and better, and get everyone's needs met.
-
+! [Apache APISIX Community Activity Comparison Chart](https://static.apiseven.com/202108/1630651158650-2c4a287f-45a3-4c49-94d1-5be3914e5f69.png)
-上图展示的是 Apache APISIX(绿色)、Kong(浅蓝)、mosn(黄色)、bfe (深蓝)贡献者增长曲线,Apache APISX 增长趋势最快,曲线最为陡峭。 Apache APISIX 社区活跃度在同类型项目里面是最活跃的。
+The graph above shows the growth curves of Apache APISIX (green), Kong (light blue), mosn (yellow), and bfe (dark blue) contributors, with Apache APISX showing the fastest growth trend and the steepest curve. Apache APISIX community activity is the most active within its category.
-## 结合 Apache SkyWalking,在可观测性上做进一步提升
+## Combining Apache SkyWalking for further improvements in observability
-Apache APISIX 与 Apache SkyWalking 结合可以做哪些提升?除了 SkyWalking tracing 插件,还可以将 tracing、metrics、logging、events 汇聚到 SkyWalking,借助 SkyWalking 的聚合能力让数据实现联动。
+What enhancements can be made by combining Apache APISIX with Apache SkyWalking? In addition to the SkyWalking tracing plugin, you can also aggregate tracing, metrics, logging, and events into SkyWalking, and use SkyWalking's aggregation capabilities to link data.
### SkyWalking Satellite
-SkyWalking Satellite 由 Apache APISIX 社区、Apache SkyWalking 社区、百度深度合作开发。
+SkyWalking Satellite is developed by the Apache APISIX community, the Apache SkyWalking community, and Baidu in deep cooperation.
-
+! [Apache APISIX SkyWalking Satellite](https://static.apiseven.com/202108/1630651158652-130e62e1-32dd-4705-9f24-ceffd039560a.png)
-SkyWalking Satellite 按照上图步骤采集数据,SkyWalking Satellite 可以部署到更靠近产生数据的前端,以 sidecar 的形式存在。
+SkyWalking Satellite follows the steps in the above diagram to collect data. SkyWalking Satellite can be deployed closer to the front-end where the data is generated, in the form of a sidecar.
-图中从上往下业务请求经过 Apache APISIX 代理到 Upstream,Satellite 在 Apache APISIX 的旁边,以 sidecar 的形式部署,收集 Apache APISIX 的 tracing、metrics、logging 这三种数据类型的数据,通过 GRPC 协议发送给 SkyWalking。
+In the diagram from top to bottom business requests go through Apache APISIX proxy to Upstream, Satellite is deployed next to Apache APISIX in the form of sidecar to collect data from Apache APISIX in three data types: tracing, metrics and logging, and send it to SkyWalking via GRPC protocol.
-最重要的一点是:**在这种部署方式下,Apache APISIX 不需要做任何改动就可以直接将三种数据类型集成到 SkyWalking**。
+The most important point is that **in this deployment method, Apache APISIX can integrate the three data types directly into SkyWalking without making any changes**.
-### ALS 方案
+### ALS Solution
-ALS (Access Log Service)将经过 Apache APISIX 的访问日志发送出来,在普通的 access log 上增加特殊的字段,如:增加关键字段便于生成拓扑图,同时聚合出 metrics。
+ALS (Access Log Service) sends out access logs from Apache APISIX, adding special fields to the normal access log, e.g., adding key fields to facilitate topology map generation and aggregating metrics.
-ALS 方案最大的好处是可以直接通过 access log 方式分析和聚合出拓扑图、metrics 、logging 这三种类型的数据。
-在使用 Prometheus 时,如果配置了 URI 级别的 metrics 指标的统计,会导致整个 metrics 急剧膨胀。因为 URI 级别的服务可能有几十个,每个 metrics 后面可能有许多 labels,这会降低网关性能,增加 metrics 获取难度。**使用 ALS 方案,通过流的方式将数据发送给 SkyWalking,把计算的事情交给 SkyWalking,后续也方便查询**,不会出现每隔几秒钟拉取一次非常庞大的数据的情况。
+The biggest advantage of ALS solution is that it can directly analyze and aggregate three types of data, such as topology, metrics, and logging, by means of access log.
+When using Prometheus, if you configure the statistics of metrics at the URI level, the whole metrics will be inflated dramatically. Because there may be dozens of services at the URI level, each metrics may be followed by many labels, which will slow down the performance of the gateway and make the metrics more difficult to obtain. **Use ALS solution to send the data to SkyWalking by streaming, leaving the calculation to SkyWalking and making it easy to query later**, without pulling ve [...]
-### 将 Events 整合到 SkyWalking
+### Integrating Events into SkyWalking
-常用的 Events 包括:配置分发、集群变化、健康检查。
+Commonly used Events include: configuration distribution, cluster changes, and health checks.
-**配置分发**:在配置 API 分发时,可能会新增路由、修改路由、删除路由或增加插件。
+**Configuration Distribution**: When configuring API distribution, routes may be added, routes modified, routes removed, or plugins added.
-**集群变化**:集群发生变化时,需要知道集群里的服务数。如:扩容时 IP 会发生变化,变化体现在网关收到消息的时候。每个过程都是一个事件,这些事件都需要被暴露出来。
+**Cluster Changes**: When the cluster changes, you need to know the number of services in the cluster. For example, IPs change during expansion, and the changes are reflected when the gateway receives the message. Each process is an event, and these events need to be exposed.
-**健康检查**:主动探测是否健康,例如:业务请求失败率突然变高,事件探测到业务服务不健康,此时可以快速定位到问题。
+**Health Check**: Proactive detection of health, e.g., business request failure rate suddenly becomes high, and events detect unhealthy business services, at which point the problem can be quickly located.
-## 延伸阅读
+## Extended Reading
-### Apache APISIX 的扩展机制的实现原理及其对稳定性的影响
+### How the extension mechanism of Apache APISIX is implemented and its impact on stability
-问题:Apache APISIX 的扩展机制是怎么实现的?扩展这个功能是否对 Apache APISIX 本身稳定性有影响?
+Question: How is the extension mechanism of Apache APISIX implemented? Does extending this feature have an impact on the stability of Apache APISIX itself?
-答:Apache APISIX 扩展机制得益于它的架构,可以在各个 phases (rewrite / access / header_filter / body_filter / preread_filter / log)增加业务逻辑。
+A: The Apache APISIX extension mechanism benefits from its architecture, which allows adding business logic to each phase (rewrite / access / header_filter / body_filter / preread_filter / log).
-至于稳定性方面, Apahce APISIX 已经开源了近 50 个插件,每一个插件都会有端到端的测试,这些插件都是经过验证的、是稳定可用的。但是自定义插件要遵循一定的规范,虽然很简单,但是大家也不能太随意。自定义插件的稳定性保证,需要由业务方自己来保证。
+As for stability, Apahce APISIX has open sourced nearly 50 plugins, each of which is tested end-to-end and is proven to be stable and available. However, custom plug-ins have to follow certain specifications, which are simple, but we should not be too casual. The stability of the custom plug-ins is guaranteed and needs to be guaranteed by the business side itself.
-### 如何确认规则已生效
+### How to confirm that rules are in effect
-问:Nginx 的 nginx.conf 文件里面可能配置了很多规则,后面的规则可能被前面的规则拦截,不清楚后面的规则是否生效,Apache APISIX 是否有什么方法知道哪些规则已生效?
+Q: Nginx may have a lot of rules configured in the nginx.conf file, and the later rules may be blocked by the earlier rules, so it is not clear if the later rules are in effect.
-答:Nginx 的 nginx.conf 文件配置越多,配置服务越复杂,这个文件越难以维护。但是在 Apache APISIX 里配置文件是固定的,Apache APISIX 官方提供的配置就是在大多数场景下的最优配置,其他路由的配置是通过 API 的方式配置进去的,路由配置都是在内存里面的。
+A: The more configuration you have in the nginx.conf file, and the more complex the configuration service, the more difficult it is to maintain this file. But in Apache APISIX, the configuration file is fixed, and the official Apache APISIX configuration is the optimal configuration for most scenarios, while other routing configurations are configured in the API, and the routing configuration is in memory.
-在管理方式上,可以通过多种组织方式管理你的路由,例如,可以通过 Dashboard 来管理。
+In terms of management, you can manage your routes in a variety of organizational ways, for example, through the Dashboard.
-举例说明,比如有一个服务叫 ABC,在这个服务下面可会有各种路由定义,路由定义通过列表的方式进行查看,路由里有一个字段叫优先级,可以通过配置路由的优先级字段,让相似的路由规则按照优先级依次匹配。另外一种路由查看方式是在 dashboard 中给 API 打上标签,可以让路由的管理变得更加人性化,便于按照标签过滤查询路由列表。
+For example, if you have a service called ABC, you can have various route definitions under this service, and the route definitions can be viewed in a list. Another way to view routes is to tag the API in the dashboard, which makes the management of routes more user-friendly and makes it easy to query the list of routes by tag filtering.
-## 关于作者
+## About the Author
-金卫,Apache APISIX PMC 和 Apache SkyWalking committer。
+Wei Jin, Apache APISIX PMC and Apache SkyWalking committer.
-
+! [Jin Wei's profile](https://static.apiseven.com/202108/1630651158654-2e028970-9e09-4d52-bf72-ab53aa98706b.png)
diff --git a/website/blog/2021/08/10/apisix-nginx.md b/website/blog/2021/08/10/apisix-nginx.md
index f06a1c1..9077cc6 100644
--- a/website/blog/2021/08/10/apisix-nginx.md
+++ b/website/blog/2021/08/10/apisix-nginx.md
@@ -1,81 +1,81 @@
---
-title: "Apache APISIX 架构分析:如何动态管理 Nginx 集群?"
-author: "陶辉"
+title: "Apache APISIX Architecture Analysis: How to Dynamically Manage Nginx Clustering?"
+author: Hui Tao
keywords:
-- API 网关
+- API Gateway
- Apache APISIX
- Nginx
- Lua
-- 动态管理
+- Dynamic Management
date: "2021-08-10"
-description: 本文转发自陶辉个人博客,主要介绍了基于 APISIX 2.8 版本、OpenResty 1.19.3.2 版本以及 Nginx 1.19.3 版本进行 Apache APISIX 实现 REST API 远程控制 Nginx 集群的原理讲解。
+description: This article is re-posted from Tao Hui's personal blog, and introduces the principles of Apache APISIX based on APISIX version 2.8, OpenResty version 1.19.3.2, and Nginx version 1.19.3 to implement a REST API for remote control of Nginx clusters.
tags: [Technology]
---
-> 本文转发自陶辉个人博客,主要介绍了基于 APISIX 2.8 版本、OpenResty 1.19.3.2 版本以及 Nginx 1.19.3 版本进行 Apache APISIX 实现 REST API 远程控制 Nginx 集群的原理讲解。
+> This article is re-posted from Tao Hui's personal blog, and introduces the principles of Apache APISIX for REST API remote control of Nginx clusters based on APISIX version 2.8, OpenResty version 1.19.3.2, and Nginx version 1.19.3.
-<!--truncate-->
+<! --truncate -->
-开源版 Nginx 最为人诟病的就是不具备动态配置、远程 API 及集群管理的能力,而 Apache APISIX 作为 Apache 基金会毕业的开源七层网关,基于 etcd 和 Lua 实现了对 Nginx 集群的动态管理。
+One of the most criticized aspects of the open source version of Nginx is that it does not have dynamic configuration, remote API, and cluster management capabilities. Apache APISIX, the open source seven-tier gateway graduated from the Apache Foundation, implements dynamic management of Nginx clusters based on etcd and Lua.
-
+! [APISIX architecture diagram](https://static.apiseven.com/202108/1631170283612-ba5e27ff-726b-47a6-aa51-84731b067c44.png)
-让 Nginx 具备动态、集群管理能力并不容易,因为这将面临以下问题:
+Making Nginx dynamically, cluster-managed is not easy, as it would face the following problems.
-* 微服务架构使得上游服务种类多、数量大,这导致路由规则、上游 Server 的变更极为频率。而 Nginx 的路由匹配是基于静态的 Trie 前缀树、哈希表、正则数组实现的,一旦`server_name`、`location` 变动,不执行 reload 就无法实现配置的动态变更
-* Nginx 将自己定位于 ADC 边缘负载均衡,因此它对上游并不支持 HTTP2 协议。这增大了 OpenResty 生态实现 etcd gRPC 接口的难度,因此通过 watch 机制接收配置变更必然效率低下
-* 多进程架构增大了 Worker 进程间的数据同步难度,必须选择 1 个低成本的实现机制,保证每个 Nginx 节点、Worker 进程都持有最新的配置
+* The microservices architecture makes for a large variety and number of upstream services, which leads to extremely frequent changes to routing rules, and upstream Servers. Nginx's route matching is based on static Trie prefix trees, hash tables, and regular arrays, so once `server_name` and `location` change, it is impossible to dynamically change the configuration without performing a reload.
+* Nginx positions itself as an ADC edge load balancer, so it does not support the HTTP2 protocol upstream. This makes it more difficult for the OpenResty ecosystem to implement the etcd gRPC interface, so receiving configuration changes through the watch mechanism is inefficient
+* Multi-process architecture makes it harder to synchronize data between worker processes, so you must choose a low-cost implementation mechanism to ensure that each Nginx node and worker process has the latest configuration
-Apache APISIX 基于 Lua 定时器及 lua-resty-etcd 模块实现了配置的动态管理,本文将基于 APISIX 2.8 版本、OpenResty 1.19.3.2 版本以及 Nginx 1.19.3 版本进行 Apache APISIX 实现 REST API 远程控制 Nginx 集群的原理。
+Apache APISIX is based on the Lua timer and the lua-resty-etcd module for dynamic configuration management. The principle of Nginx clustering.
-## 基于 etcd watch 机制的配置同步方案
+## Configuration synchronization scheme based on etcd watch mechanism
-管理集群必须依赖中心化的配置,etcd 就是这样一个数据库。Apache APISIX 没有选择关系型数据库作为配置中心,是因为 etcd 具有以下 2 个优点:
+Managing a cluster must rely on a centralized configuration, and etcd is one such database. etcd was not chosen as the configuration center for Apache APISIX because it has two advantages.
-* etcd 采用类 Paxos 的 Raft 协议保障了数据一致性,它是去中心化的分布式数据库,可靠性高于关系数据库
-* etcd 的 watch 机制允许客户端监控某个 key 的变动,即,若类似 /nginx/http/upstream 这种 key 的 value 值发生变动,watch 客户端会立刻收到通知,如下图所示:
-
+* etcd uses the Paxos-like Raft protocol to guarantee data consistency, and it is a decentralized, distributed database that is more reliable than relational databases
+* etcd's watch mechanism allows clients to monitor changes to a key, i.e., if the value of a key like /nginx/http/upstream changes, the watch client will be notified immediately, as shown in the following figure.
+! [etcd-based synchronization of nginx configuration](https://static.apiseven.com/202108/1631170345853-f020a64d-3e97-49c0-8395-c9e4e9cf4233.jpeg)
-因此,不同于 Orange 和 Kong,Apache APISIX 采用了 etcd 作为中心化的配置组件。你可以在生产环境的 Apache APISIX 中通过 etcdctl 看到如下类似配置:
+Therefore, unlike Orange and Kong, Apache APISIX uses etcd as the centralized configuration component. You can see a similar configuration in a production environment of Apache APISIX via etcdctl as follows.
```yaml
-# etcdctl get "/apisix/upstreams/1"
+# etcdctl get "/apisix/upstreams/1"
/apisix/upstreams/1
-{"hash_on":"vars","nodes":{"httpbin.org:80":1},"create_time":1627982128,"update_time":1627982128,"scheme":"http","type":"roundrobin","pass_host":"pass","id":"1"}
+{"hash_on": "vars", "nodes":{"httpbin.org:80":1}, "create_time":1627982128, "update_time":1627982128, "scheme": "http", "type":" roundrobin", "pass_host": "pass", "id": "1"}
```
-其中,/apisix 这个前缀可以在 conf/config.yaml 中修改,比如:
+Where the prefix /apisix can be changed in conf/config.yaml, e.g.
```yaml
etcd:
host:
- "http://127.0.0.1:2379"
- prefix: /apisix # apisix configurations prefix
+ prefix: /apisix # apisix configurations prefix
```
-而 upstreams/1 就等价于 nginx.conf 中的 http { upstream 1 {} } 配置。类似关键字还有 /apisix/services/、/apisix/routes/ 等。
+and upstreams/1 is equivalent to http { upstream 1 {} } in nginx.conf. Similar keywords are used in /apisix/services/, /apisix/routes/, and so on.
-那么,Nginx 是怎样通过 watch 机制获取到 etcd 配置数据变化的呢?有没有新启动一个 agent 进程?它通过 HTTP/1.1 还是 gRPC 与 etcd 通讯的?
+So, how does Nginx get the etcd configuration data changes through the watch mechanism? Does it start a new agent process? Does it communicate with etcd via HTTP/1.1 or gRPC?
-## ngx.timer.at 定时器
+## ngx.timer.at timer
-Apache APISIX 并没有启动 Nginx 以外的进程与 etcd 通讯。实际上它是通过 `ngx.timer.at` 这个定时器实现了 watch 机制。为了方便对 OpenResty 不太了解的同学理解,我们先来看看 Nginx 中的定时器是如何实现的,它是 watch 机制实现的基础。
+Apache APISIX does not start a process other than Nginx to communicate with etcd. It actually implements the watch mechanism through the `ngx.timer.at` timer. For those who are not familiar with OpenResty, let's take a look at how the timer is implemented in Nginx, which is the basis for the watch mechanism.
-### Nginx 的红黑树定时器
+### Nginx's red-black tree timer
-Nginx 采用了 epoll + nonblock socket 这种多路复用机制实现事件处理模型,其中每个 worker 进程会循环处理网络 IO 及定时器事件:
+Nginx uses an epoll + nonblock socket multiplexing mechanism to implement an event handling model in which each worker process cycles through network IO and timer events.
```c
-//参见 Nginx 的 src/os/unix/ngx_process_cycle.c 文件
+//see the src/os/unix/ngx_process_cycle.c file for Nginx
static void
ngx_worker_process_cycle(ngx_cycle_t *cycle, void *data)
{
- for ( ;; ) {
+ for (;; ) {
ngx_process_events_and_timers(cycle);
}
}
-// 参见 ngx_proc.c 文件
+// See the ngx_proc.c file
void
ngx_process_events_and_timers(ngx_cycle_t *cycle)
{
@@ -87,18 +87,18 @@ ngx_process_events_and_timers(ngx_cycle_t *cycle)
}
```
-`ngx_event_expire_timers` 函数会调用所有超时事件的 handler 方法。事实上,定时器是由[红黑树](https://zh.wikipedia.org/zh-hans/%E7%BA%A2%E9%BB%91%E6%A0%91)(一种平衡有序二叉树)实现的,其中 key 是每个事件的绝对过期时间。这样,只要将最小节点与当前时间做比较,就能快速找到过期事件。
+The `ngx_event_expire_timers` function calls the handler method of all timeout events. In fact, the timer is implemented by a [red-black tree](https://zh.wikipedia.org/zh-hans/%E7%BA%A2%E9%BB%91%E6%A0%91) (a balanced ordered binary tree), where the key is the absolute expiration time of each event. This way, expired events can be found quickly by comparing the minimum node with the current time.
-### OpenResty 的 Lua 定时器
+Lua timer for ### OpenResty
-当然,以上 C 函数开发效率很低。因此,OpenResty 封装了 Lua 接口,通过 [ngx.timer.at](https://github.com/openresty/lua-nginx-module#ngxtimerat) 将 `ngx_timer_add` 这个 C 函数暴露给了 Lua 语言:
+Of course, the above C functions are very inefficient to develop. Therefore, OpenResty wraps the Lua interface and exposes the C function `ngx_timer_add` to the Lua language via [ngx.timer.at](https://github.com/openresty/lua-nginx-module#ngxtimerat).
```c
-//参见 OpenResty /ngx_lua-0.10.19/src/ngx_http_lua_timer.c 文件
+//see OpenResty /ngx_lua-0.10.19/src/ngx_http_lua_timer.c file
void
ngx_http_lua_inject_timer_api(lua_State *L)
{
- lua_createtable(L, 0 /* narr */, 4 /* nrec */); /* ngx.timer. */
+ lua_createtable(L, 0 /* narr */, 4 /* nrec */); /* ngx.timer. */
lua_pushcfunction(L, ngx_http_lua_ngx_timer_at);
lua_setfield(L, -2, "at");
@@ -113,38 +113,38 @@ ngx_http_lua_ngx_timer_at(lua_State *L)
static int
ngx_http_lua_ngx_timer_helper(lua_State *L, int every)
{
- ngx_event_t *ev = NULL;
+ ngx_event_t *ev = NULL;
ev->handler = ngx_http_lua_timer_handler;
ngx_add_timer(ev, delay);
}
```
-因此,当我们调用 `ngx.timer.at` Lua 定时器时,就是在 Nginx 的红黑树定时器里加入了 `ngx_http_lua_timer_handler` 回调函数,这个函数不会阻塞 Nginx。
+So when we call `ngx.timer.at` Lua timer, we are adding the `ngx_http_lua_timer_handler` callback function to Nginx's red-black tree timer, which does not block Nginx.
-下面我们来看看 Apache APISIX 是怎样使用 `ngx.timer.at` 的。
+Let's see how Apache APISIX uses `ngx.timer.at`.
-### Apache APISIX 基于定时器实现的 watch 机制
+### Apache APISIX timer-based watch mechanism
-Nginx 框架为 C 模块开发提供了许多钩子,而 OpenResty 将部分钩子以 Lua 语言形式暴露了出来,如下图所示:
+The Nginx framework provides a number of hooks for C module development, and OpenResty exposes some of them as Lua, as shown in the following image.
-
+! [openresty hooks](https://static.apiseven.com/202108/1631170424663-53f56c99-aefc-4546-ac0b-76a25a6f0071.png)
-Apache APISIX 仅使用了其中 8 个钩子(注意,APISIX 没有使用 `set_by_lua` 和 `rewrite_by_lua`,rewrite 阶段的插件其实是 Apache APISIX 自定义的,与 Nginx 无关),包括:
+Apache APISIX uses only eight of these hooks (note that APISIX does not use `set_by_lua` and `rewrite_by_lua`; the rewrite phase of the plugin is actually self-defined by Apache APISIX and is not related to Nginx), including
-* init_by_lua:Master 进程启动时的初始化
-* init_worker_by_lua:每个 Worker 进程启动时的初始化(包括 privileged agent 进程的初始化,这是实现 Java 等多语言插件远程 RPC 调用的关键)
-* ssl_certificate_by_lua:在处理 TLS 握手时,openssl 提供了一个钩子,OpenResty 通过修改 Nginx 源码以 Lua 方式暴露了该钩子
-* access_by_lua:接收到下游的 HTTP 请求头部后,在此匹配 Host 域名、URI、Method 等路由规则,并选择 Service、Upstream 中的插件及上游 Server
-* balancer_by_lua:在 content 阶段执行的所有反向代理模块,在选择上游 Server 时都会回调 `init_upstream` 钩子函数,OpenResty 将其命名为 `balancer_by_lua`
-* header_filter_by_lua:将 HTTP 响应头部发送给下游前执行的钩子
-* body_filter_by_lua:将 HTTP 响应包体发送给下游前执行的钩子
-* log_by_lua:记录 access 日志时的钩子
+* init_by_lua: initialization of the Master process when it starts
+* init_worker_by_lua: initialization of each worker process at startup (including initialization of privileged agent processes, which are key to implementing remote RPC calls from multilingual plugins such as Java)
+* ssl_certificate_by_lua: openssl provides a hook when handling the TLS handshake, which OpenResty exposes as Lua by modifying the Nginx source code
+* access_by_lua: After receiving the downstream HTTP request header, it matches the routing rules such as Host domain, URI, Method, etc., and selects the Service, plugins in Upstream and upstream Server.
+* balancer_by_lua: All reverse proxy modules executed in the content phase call back the `init_upstream` hook function, named `balancer_by_lua` by OpenResty, when the upstream Server is selected.
+* header_filter_by_lua: hook to be executed before sending HTTP response headers downstream
+* body_filter_by_lua: hook to be executed before sending the HTTP response packet body downstream
+* log_by_lua: hook for logging access logs
-准备好上述知识后,我们就可以回答 Apache APISIX 是怎样接收 etcd 数据的更新了。
+Once we have the above knowledge ready, we can answer how Apache APISIX receives updates to etcd data.
-#### nginx.conf 的生成方式
+How #### nginx.conf is generated
-每个 Nginx Worker 进程都会在 `init_worker_by_lua` 阶段通过 `http_init_worker` 函数启动定时器:
+Each Nginx worker process starts a timer in the ``init_worker_by_lua`` phase with the ``http_init_worker`` function.
```lua
init_worker_by_lua_block {
@@ -152,9 +152,9 @@ init_worker_by_lua_block {
}
```
-你可能很好奇,下载 Apache APISIX 源码后没有看到 nginx.conf,这段配置是哪来的?
+You may be curious to know that you don't see nginx.conf after downloading the Apache APISIX source code, where did this configuration come from?
-这里的 nginx.conf 实际是由 Apache APISIX 的启动命令实时生成的。当你执行 make run 时,它会基于 Lua 模板 apisix/cli/ngx_tpl.lua 文件生成 nginx.conf。请注意,这里的模板规则是 OpenResty 自实现的,语法细节参见 [lua-resty-template](https://github.com/bungle/lua-resty-template)。生成 nginx.conf 的具体代码参见 apisix/cli/ops.lua 文件:
+The nginx.conf here is actually generated in real time by the Apache APISIX startup command. When you execute make run, it generates nginx.conf based on the Lua template apisix/cli/ngx_tpl.lua file. Note that the template rules here are self-implemented by OpenResty; see [lua-resty-template](https://github.com) for syntax details. /bungle/lua-resty-template). See the apisix/cli/ops.lua file for the specific code that generates nginx.conf.
```lua
local template = require("resty.template")
@@ -164,11 +164,11 @@ local function init(env)
local conf_render = template.compile(ngx_tpl)
local ngxconf = conf_render(sys_conf)
- local ok, err = util.write_file(env.apisix_home .. "/conf/nginx.conf",
+ local ok, err = util.write_file(env.apisix_home . "/conf/nginx.conf",
ngxconf)
```
-当然,Apache APISIX 允许用户修改 nginx.conf 模板中的部分数据,具体方法是模仿 conf/config-default.yaml 的语法修改 conf/config.yaml 配置。其实现原理参见 `read_yaml_conf` 函数:
+Of course, Apache APISIX allows you to modify some of the data in the nginx.conf template by modifying the conf/config.yaml configuration in a way that mimics the syntax of conf/config-default.yaml. See the *read_yaml_conf* function for an example of how to do this.
```conf
function _M.read_yaml_conf(apisix_home)
@@ -181,25 +181,25 @@ function _M.read_yaml_conf(apisix_home)
end
```
-可见,ngx_tpl.lua 模板中仅部分数据可由 yaml 配置中替换,其中 conf/config-default.yaml 是官方提供的默认配置,而 conf/config.yaml 则是由用户自行覆盖的自定义配置。如果你觉得仅替换模板数据还不够,大可直接修改 ngx_tpl 模板。
+As you can see, only some of the data in the ngx_tpl.lua template can be replaced by the yaml configuration, where conf/config-default.yaml is the official default configuration, and conf/config.yaml is a custom configuration overridden by the user. If you feel that replacing the template data is not enough, you can modify the ngx_tpl template directly.
-#### Apache APISIX 获取 etcd 通知的方式
+#### How Apache APISIX gets etcd notifications
-Apache APISIX 将需要监控的配置以不同的前缀存入了 etcd,目前包括以下 11 种:
+Apache APISIX stores the configurations to be monitored in etcd with different prefixes, which currently include the following 11 types.
-* /apisix/consumers/:Apache APISIX 支持以 consumer 抽象上游种类
-* /apisix/global_rules/:全局通用的规则
-* /apisix/plugin_configs/:可以在不同 Router 间复用的 Plugin
-* /apisix/plugin_metadata/:部分插件的元数据
-* /apisix/plugins/:所有 Plugin 插件的列表
-* /apisix/proto/:当透传 gRPC 协议时,部分插件需要转换协议内容,该配置存储 protobuf 消息定义
-* /apisix/routes/:路由信息,是 HTTP 请求匹配的入口,可以直接指定上游 Server,也可以挂载 services 或者 upstream
-* /apisix/services/:可以将相似的 router 中的共性部分抽象为 services,再挂载 plugin
-* /apisix/ssl/:SSL 证书公、私钥及相关匹配规则
-* /apisix/stream_routes/:OSI 四层网关的路由匹配规则
-* /apisix/upstreams/:对一组上游 Server 主机的抽象
+* /apisix/consumers/: Apache APISIX supports the consumer abstraction upstream category
+* /apisix/global_rules/: global generic rules
+* /apisix/plugin_configs/: Plugin that can be reused across Router
+* /apisix/plugin_metadata/: metadata of some plugins
+* /apisix/plugins/: list of all Plugin plugins
+* /apisix/proto/: When passing the gRPC protocol, some plugins need to convert the protocol content, this configuration stores the protobuf message definition
+* /apisix/routes/: Routing information, which is the entry point for HTTP request matching, you can specify the upstream Server directly, or mount services or upstream
+* /apisix/services/: you can abstract the common parts of similar router as services and mount the plugin
+* /apisix/ssl/: SSL certificate public and private keys and related matching rules
+* /apisix/stream_routes/: route matching rules for OSI Layer 4 gateways
+* /apisix/upstreams/: abstraction of a set of upstream Server hosts
-这里每类配置对应的处理逻辑都不相同,因此 Apache APISIX 抽象出 apisix/core/config_etcd.lua 文件,专注 etcd 上各类配置的更新维护。在 `http_init_worker` 函数中每类配置都会生成 1 个 config_etcd 对象:
+Each type of configuration here has a different processing logic, so Apache APISIX abstracts the apisix/core/config_etcd.lua file to focus on the update maintenance of each type of configuration on etcd. Each type of configuration in the `http_init_worker` function generates 1 config_etcd object.
```lua
function _M.init_worker()
@@ -212,7 +212,7 @@ function _M.init_worker()
end
```
-而在 `config_etcd` 的 new 函数中,则会循环注册 `_automatic_fetch` 定时器:
+And in the new function of `config_etcd`, the `_automatic_fetch` timer will be registered recursively:
```lua
function _M.new(key, opts)
@@ -220,7 +220,7 @@ function _M.new(key, opts)
end
```
-`_automatic_fetch` 函数会反复执行 `sync_data` 函数(包装到 xpcall 之下是为了捕获异常):
+The `_automatic_fetch` function iterates the `sync_data` function (wrapped under xpcall to catch exceptions).
```lua
local function _automatic_fetch(premature, self)
@@ -231,16 +231,16 @@ local function _automatic_fetch(premature, self)
end
```
-`sync_data` 函数将通过 etcd 的 watch 机制获取更新,它的实现机制我们接下来会详细分析。
+The `sync_data` function will get updates through etcd's watch mechanism, which we will analyze in detail next.
-所以总结来看,Apache APISIX 在每个 Nginx Worker 进程的启动过程中,通过 `ngx.timer.at` 函数将 `_automatic_fetch` 插入定时器。`_automatic_fetch` 函数执行时会通过 `sync_data` 函数,基于 watch 机制接收 etcd 中的配置变更通知,这样,每个 Nginx 节点、Worker 进程都将保持最新的配置。如此设计还有 1 个明显的优点:etcd 中的配置直接写入 Nginx Worker 进程中,这样处理请求时就能直接使用新配置,无须在进程间同步配置,这要比启动 1 个 agent 进程更简单!
+So to summarize, Apache APISIX inserts `_automatic_fetch` into the timer via the `ngx.timer.at` function during the startup of each Nginx worker process. The `_automatic_fetch` function receives notifications of configuration changes in etcd through the `sync_data` function, based on a watch mechanism, so that each Nginx node and worker process will be kept up to date with the latest configuration. This design also has one obvious advantage: the configuration in etcd is written directly [...]
-### lua-resty-etcd 库的 HTTP/1.1 协议
+### HTTP/1.1 protocol for the lua-resty-etcd library
-`sync_data` 函数到底是怎样获取 etcd 的配置变更消息的呢?先看下 `sync_data` 源码:
+How exactly does the `sync_data` function get the configuration change messages from etcd? Let's look at the `sync_data` source code.
```lua
-local etcd = require("resty.etcd")
+local etcd = require("resty.etcd")
etcd_cli, err = etcd.new(etcd_conf)
local function sync_data(self)
@@ -255,22 +255,22 @@ local function waitdir(etcd_cli, key, modified_index, timeout)
end
```
-这里实际与 etcd 通讯的是 [lua-resty-etcd](https://github.com/api7/lua-resty-etcd) 库。它提供的 watchdir 函数用于接收 etcd 发现 key 目录对应 value 变更后发出的通知。
+The actual communication with etcd here is the [lua-resty-etcd](https://github.com/api7/lua-resty-etcd) library. It provides the watchdir function to receive notifications from etcd when it finds a change in the value of the key directory.
-watchcancel 函数又是做什么的呢?这其实是 OpenResty 生态的缺憾导致的。etcd v3 已经支持高效的 gRPC 协议(底层为 HTTP2 协议)。你可能听说过,HTTP2 不但具备多路复用的能力,还支持服务器直接推送消息,从 HTTP3 协议对照理解 HTTP2 :
+And what does the watchcancel function do? This is actually the result of a deficiency in the OpenResty ecosystem. etcd v3 already supports the efficient gRPC protocol (the underlying HTTP2 protocol). As you may have heard, HTTP2 not only has the ability to multiplex, but also supports direct server pushing of messages from the HTTP3 protocol against HTTP2: !
-
+! [http2_stream_frame_conn](https://static.apiseven.com/202108/1631170499370-57a7c452-e97e-4ac0-b7bf-073e13946a21.png)
-然而,Lua 生态目前并不支持 HTTP2 协议,所以 lua-resty-etcd 库实际是通过低效的 HTTP/1.1 协议与 etcd 通讯的,因此接收 /watch 通知也是通过带有超时的 /v3/watch 请求完成的。这个现象其实是由 2 个原因造成的:
+However, Lua Eco does not currently support the HTTP2 protocol, so the lua-resty-etcd library actually communicates with etcd via the inefficient HTTP/1.1 protocol, and therefore receives /watch notifications via /v3/watch requests with timeouts. This phenomenon is actually caused by two things.
-1. Nginx 将自己定位为边缘负载均衡,因此上游必然是企业内网,时延低、带宽大,所以对上游协议不必支持 HTTP2 协议
-2. 当 Nginx 的 upstream 不能提供 HTTP2 机制给 Lua 时,Lua 只能基于 cosocket 自己实现了。HTTP2 协议非常复杂,目前还没有生产环境可用的 HTTP2 cosocket 库。
+1. Nginx positions itself as an edge load balancer, so the upstream must be the corporate intranet, which has low latency and high bandwidth, so it does not need to support the HTTP2 protocol for the upstream protocol
+The HTTP2 protocol is very complex, and there is no HTTP2 cosocket library available for production environments.
-使用 HTTP/1.1 的 lua-resty-etcd 库其实很低效,如果你在 APISIX 上抓包,会看到频繁的 POST 报文,其中 URI 为 /v3/watch,而 Body 是 Base64 编码的 watch 目录:
+The lua-resty-etcd library using HTTP/1.1 is actually very inefficient, and if you capture packets on APISIX, you will see frequent POST messages with a URI of /v3/watch and a Base64-encoded watch directory with a body of
-
+! [APISIX communicates with etcd over HTTP1](https://static.apiseven.com/202108/1631170602368-d105d014-efe4-48c7-93b8-be5447c76a70.jpeg)
-我们可以验证下 `watchdir` 函数的实现细节:
+We can verify the implementation details of the `watchdir` function.
```lua
-- lib/resty/etcd/v3.lua 文件
@@ -313,19 +313,19 @@ local function http_request_chunk(self, http_cli)
end
```
-可见,Apache APISIX 在每个 worker 进程中,**通过 `ngx.timer.at` 和 lua-resty-etcd 库反复请求 etcd,以此保证每个 Worker 进程中都含有最新的配置。**
+As you can see, Apache APISIX makes sure that each worker process contains the latest configuration by **repeatedly requesting etcd through the `ngx.timer.at` and lua-resty-etcd libraries in each worker process.**
-## APISIX 配置与插件的远程变更
+## APISIX configuration and plugin remote changes
-接下来,我们看看怎样远程修改 etcd 中的配置。
+Next, let's look at how to remotely modify the configuration in etcd.
-我们当然可以直接通过 gRPC 接口修改 etcd 中相应 key 的内容,再基于上述的 watch 机制使得 Nginx 集群自动更新配置。然而,这样做的风险很大,因为配置请求没有经过校验,进面导致配置数据与 Nginx 集群不匹配。
+We can of course modify the contents of the corresponding key in etcd directly through the gRPC interface, and then make the Nginx cluster automatically update its configuration based on the watch mechanism described above. However, this is risky because the configuration request is not verified, and the configuration data does not match the Nginx cluster.
-### 通过 Nginx 的 /apisix/admin/ 接口修改配置
+### Modifying configuration via Nginx's /apisix/admin/ interface
-Apache APISIX 提供了这么一种机制:访问任意 1 个 Nginx 节点,通过其 Worker 进程中的 Lua 代码校验请求成功后,再由 /v3/dv/put 接口写入 etcd 中。下面我们来看看 Apache APISIX 是怎么实现的。
+Apache APISIX provides a mechanism to access any one Nginx node, verify the request with Lua code in its worker process, and then write it to etcd through the /v3/dv/put interface. Let's take a look at how Apache APISIX does this.
-首先,make run 生成的 nginx.conf 会自动监听 9080 端口(可通过 config.yaml 中 apisix.node_listen 配置修改),当 `apisix.enable_admin` 设置为 true 时,nginx.conf 就会生成以下配置:
+First, the nginx.conf generated by make run automatically listens on port 9080 (as modified by the apisix.node_listen configuration in config.yaml), and when ``apisix.enable_admin`` is set to true, nginx.conf will generate the following configuration.
```yaml
server {
@@ -340,28 +340,28 @@ server {
```
-这样,Nginx 接收到的 /apisix/admin 请求将被 `http_admin` 函数处理:
+Thus, the /apisix/admin requests received by Nginx will be processed by the `http_admin` function.
```lua
--- /apisix/init.lua 文件
+-- /apisix/init.lua file
function _M.http_admin()
local ok = router:dispatch(get_var("uri"), {method = get_method()})
end
```
-admin 接口能够处理的 API 参见 [GitHub](https://github.com/apache/apisix/blob/release/2.8/docs/zh/latest/admin-api.md) 文档,其中,当 method 方法与 URI 不同时,dispatch 会执行不同的处理函数,其依据如下:
+See the [GitHub](https://github.com/apache/apisix/blob/release/2.8/docs/zh/latest/admin-api.md) documentation for APIs that the admin interface can handle, where when the method method differs from the URI, the dispatch performs different handler functions based on the following.
```lua
--- /apisix/admin/init.lua 文件
+-- /apisix/admin/init.lua file
local uri_route = {
{
paths = [[/apisix/admin/*]],
- methods = {"GET", "PUT", "POST", "DELETE", "PATCH"},
+ methods = { "GET", "PUT", "POST", "DELETE", "PATCH"},
handler = run,
},
{
paths = [[/apisix/admin/stream_routes/*]],
- methods = {"GET", "PUT", "POST", "DELETE", "PATCH"},
+ methods = {"GET", "PUT", "POST", "DELETE", "PATCH"}, { paths = [[/apisix/admin/stream_routes/*]], { methods = {"GET", "PUT", "POST", "DELETE", "PATCH"},
handler = run_stream,
},
{
@@ -377,26 +377,26 @@ local uri_route = {
}
```
-比如,当通过 /apisix/admin/upstreams/1 和 PUT 方法创建 1 个 Upstream 上游时:
+For example, when creating 1 Upstream via /apisix/admin/upstreams/1 and the PUT method.
```shell
curl "http://127.0.0.1:9080/apisix/admin/upstreams/1" -H "X-API-KEY: edd1c9f034335f136f87ad84b625c8f1" -X PUT -d '
> {
-> "type": "roundrobin",
-> "nodes": {
-> "httpbin.org:80": 1
-> }
+> "type": "roundrobin",
+> "nodes": {
+> "httpbin.org:80": 1
+> }
> }'
-{"action":"set","node":{"key":"\/apisix\/upstreams\/1","value":{"hash_on":"vars","nodes":{"httpbin.org:80":1},"create_time":1627982128,"update_time":1627982128,"scheme":"http","type":"roundrobin","pass_host":"pass","id":"1"}}}
+{ "action": "set", "node":{"key":"\/apisix\/upstreams\/1", "value":{"hash_on": "vars", "nodes":{"httpbin.org:80":1}, "create_time": 1627982128, "update_time":1627982128, "scheme": "http", "type": "roundrobin", "pass_host": "pass", "id": "1"}}}
```
-你会在 error.log 中会看到如下日志(想看到这行日志,必须将 config.yaml 中的 nginx_config.error_log_level 设为 INFO):
+You will see the following log in error.log (to see this line, you must set the nginx_config.error_log_level in config.yaml to INFO)
```yaml
-2021/08/03 17:15:28 [info] 16437#16437: *23572 [lua] init.lua:130: handler(): uri: ["","apisix","admin","upstreams","1"], client: 127.0.0.1, server: _, request: "PUT /apisix/admin/upstreams/1 HTTP/1.1", host: "127.0.0.1:9080"
+2021/08/03 17:15:28 [info] 16437#16437: *23572 [lua] init.lua:130: handler(): uri: ["", "apisix", "admin", "upstreams", "1"], client: 127.0.0.1, server: _, request: "PUT /apisix/admin/upstreams/1 HTTP/1.1", host: "127.0.0.1:9080"
```
-这行日志实际是由 /apisix/admin/init.lua 中的 `run` 函数打印的,它的执行依据是上面的 uri_route 字典。我们看下 run 函数的内容:
+This line is actually printed by the `run` function in /apisix/admin/init.lua, which is executed based on the uri_route dictionary above. Let's look at the contents of the run function.
```lua
-- /apisix/admin/init.lua文件
@@ -433,49 +433,49 @@ local resources = {
}
```
-因此,上面的 curl 请求将被 /apisix/admin/upstreams.lua 文件的 `put` 函数处理,看下 `put` 函数的实现:
+Therefore, the above curl request will be processed by the ``put`` function in the /apisix/admin/upstreams.lua file, see the implementation of the ``put`` function as follows
```lua
--- /apisix/admin/upstreams.lua文件
+-- /apisix/admin/upstreams.lua file
function _M.put(id, conf)
- -- 校验请求数据的合法性
+ -- check the legitimacy of the requested data
local id, err = check_conf(id, conf, true)
- local key = "/upstreams/" .. id
+ local key = "/upstreams/" ... id
core.log.info("key: ", key)
- -- 生成etcd中的配置数据
+ -- Generate configuration data in etcd
local ok, err = utils.inject_conf_with_prev_conf("upstream", key, conf)
- -- 写入etcd
+ -- write to etcd
local res, err = core.etcd.set(key, conf)
end
-- /apisix/core/etcd.lua
local function set(key, value, ttl)
- local res, err = etcd_cli:set(prefix .. key, value, {prev_kv = true, lease = data.body.ID})
+ local res, err = etcd_cli:set(prefix ... key, value, {prev_kv = true, lease = data.body.ID})
end
```
-最终新配置被写入 etcd 中。可见,Nginx 会校验数据再写入 etcd,这样其他 Worker 进程、Nginx 节点都将通过 watch 机制接收到正确的配置。上述流程你可以通过 error.log 中的日志验证:
+The new configuration is eventually written to etcd. As you can see, Nginx verifies the data before writing it to etcd, so that other worker processes and Nginx nodes will receive the correct configuration through the watch mechanism. You can verify this process with the logs in error.log.
```yaml
-2021/08/03 17:15:28 [info] 16437#16437: *23572 [lua] upstreams.lua:72: key: /upstreams/1, client: 127.0.0.1, server: _, request: "PUT /apisix/admin/upstreams/1 HTTP/1.1", host: "127.0.0.1:9080"
+2021/08/03 17:15:28 [info] 16437#16437: *23572 [lua] upstreams.lua:72: key: /upstreams/1, client: 127.0.0.1, server: _, request: "PUT /apisix/ admin/upstreams/1 HTTP/1.1", host: "127.0.0.1:9080"
```
-### 为什么新配置不 reload 就可以生效
+### Why the new configuration works without reload
-我们再来看 admin 请求执行完 Nginx Worker 进程可以立刻生效的原理。
+Let's look at how the Nginx worker process takes effect immediately after the admin request is executed.
-开源版 Nginx 的请求匹配是基于 3 种不同的容器进行的:
+The open source version of Nginx matches requests based on three different containers.
-1. 将静态哈希表中的 `server_name` 配置与请求的 `Host` 域名匹配
-2. 其次将静态 Trie 前缀树中的 location 配置与请求的 URI 匹配
+1. the `server_name` configuration in the static hash table is matched to the requested `Host` domain name
+2. Next, the location in the static Trie prefix tree is configured to match the requested URI
- 
+ ! [Matching process for location prefix tree 2](https://static.apiseven.com/202108/1631170657240-31bb3ff3-ee3b-4831-99ff-77cab1d6e298.png)
-3. 在上述两个过程中,如果含有正则表达式,则基于数组顺序(在 nginx.conf 中出现的次序)依次匹配。
+3. In both of these processes, if there are regular expressions, they are matched in order based on the order of the arrays (the order they appear in nginx.conf).
-上述过程虽然执行效率极高,却是写死在 find_config 阶段及 Nginx HTTP 框架中的,一旦变更必须在 nginx -s reload 后才能生效。因此,Apache APISIX 索性完全抛弃了上述流程。
+Although these procedures are very efficient, they are written to die in the find_config phase and in the Nginx HTTP framework, and changes must be made after nginx -s reload to take effect. For this reason, Apache APISIX has abandoned this process altogether.
-从 nginx.conf 中可以看到,访问任意域名、URI 的请求都会匹配到 `http_access_phase` 这个 lua 函数:
+As you can see in nginx.conf, requests to any domain name, URI, or domain name will match the `http_access_phase` lua function.
```conf
server {
@@ -483,13 +483,13 @@ server {
location / {
access_by_lua_block {
apisix.http_access_phase()
- }
- proxy_pass $upstream_scheme://apisix_backend$upstream_uri;
+ access_by_lua_block { apisix.http_access_phase() }
+ proxy_pass $upstream_scheme://apisix_backend$upstream_uri;
}
}
```
-而在 `http_access_phase` 函数中,将会基于 1 个用 C 语言实现的基数前缀树匹配 Method、域名和 URI(仅支持通配符,不支持正则表达式),这个库就是 [lua-resty-radixtree](https://github.com/api7/lua-resty-radixtree)。每当路由规则发生变化,Lua 代码就会重建这棵基数树:
+The `http_access_phase` function will match Method, domain and URI based on a base prefix tree implemented in C (only wildcards are supported, no regular expressions), the library is [lua-resty-radixtree](https://github.com/api7/lua -resty-radixtree). Whenever the routing rules change, the Lua code rebuilds this base tree: the
```lua
function _M.match(api_ctx)
@@ -501,16 +501,16 @@ function _M.match(api_ctx)
end
```
-这样,路由变化后就可以不 reload 而使其生效。Plugin 启用、参数及顺序调整的规则与此类似。
+The rules for Plugin enablement, parameter and order adjustment are similar.
-最后再提下 Script,它与 Plugin 是互斥的。之前的动态调整改的只是配置,事实上 Lua JIT 的及时编译还提供了另外一个杀手锏 loadstring,它可以将字符串转换为 Lua 代码。因此,在 etcd 中存储 Lua 代码并设置为 Script 后,就可以将其传送到 Nginx 上处理请求了。
+Finally, Script is mutually exclusive with Plugin. In fact, Lua JIT's just-in-time compilation provides another killer feature, loadstring, which converts strings to Lua code. So, after storing Lua code in etcd and setting it to Script, you can pass it to Nginx to process requests.
-## 总结
+## Summary
-Nginx 集群的管理必须依赖中心化配置组件,而高可靠又具备 watch 推送机制的 etcd 无疑是最合适的选择!虽然当下 Resty 生态没有 gRPC 客户端,但每个 Worker 进程直接通过 HTTP/1.1 协议同步 etcd 配置仍不失为一个好的方案。
+Nginx cluster management must rely on a centralized configuration component, and etcd, which is highly reliable and has a watch push mechanism, is the perfect choice! Although the Resty ecosystem does not have a gRPC client, it is still a good idea for each worker process to synchronize etcd configuration directly via the HTTP/1.1 protocol.
-动态修改 Nginx 配置的关键在于 2 点:Lua 语言的灵活度远高于 nginx.conf 语法,而且 Lua 代码可以通过 loadstring 从外部数据中导入。当然,为了保障路由匹配的执行效率,Apache APISIX 通过 C 语言实现了前缀基数树,基于 Host、Method、URI 进行请求匹配,在保障动态性的基础上提升了性能。
+The key to dynamically modifying the Nginx configuration is 2 things: the Lua language is much more flexible than the nginx.conf syntax, and Lua code can be imported from external data via loadstring. Of course, to ensure efficient execution of route matching, Apache APISIX implements a prefix base tree in C to match requests based on Host, Method, and URI, improving performance while maintaining dynamism.
-Apache APISIX 拥有许多优秀的设计,本文仅讨论了 Nginx 集群的动态管理。
+Apache APISIX has many good designs, and this article only discusses the dynamic management of Nginx clusters.
-[点此查看原文链接](https://www.taohui.tech/2021/08/10/%E5%BC%80%E6%BA%90%E7%BD%91%E5%85%B3APISIX%E6%9E%B6%E6%9E%84%E5%88%86%E6%9E%90/#more)
+[click here for the link to the original article](https://www.taohui.tech/2021/08/10/%E5%BC%80%E6%BA%90%E7%BD%91%E5%85%B3APISIX%E6%9E%B6%E6%9E%84%E5%88%86%E6%9E%90/#more )
diff --git a/website/blog/2021/08/11/interview-TuZhengsong.md b/website/blog/2021/08/11/interview-TuZhengsong.md
index 8b9885c..79811e6 100644
--- a/website/blog/2021/08/11/interview-TuZhengsong.md
+++ b/website/blog/2021/08/11/interview-TuZhengsong.md
@@ -1,145 +1,145 @@
---
-title: "从新手村出来,我在 Apache APISIX 社区发出了第一个 PR"
-author: "Apache APISIX 社区"
+title: I issued my first PR in the Apache APISIX community
+author: Apache APISIX
authorURL: "https://github.com/Yangxiamao"
authorImageURL: "https://avatars.githubusercontent.com/u/47442074?v=4"
keywords:
-- API 网关
+- API Gateway
- APISIX
- Apache APISIX
-- 开源社区
-- 开源项目
-description: 这篇采访稿讲述了屠正松从开源社区小白成长为 Apache 顶级开源项目 APISIX committer 的历程。屠正松(GitHub ID:tzssangglass)因深度参与 Apache APISIX 的开发,在社区中贡献很多,2021 年 7 月 22 日被推选为 Apache APISIX committer。
+- Community
+- Open Source
+description: "This interview is about Zhengsong Tu's journey from an open source community nerd to an APISIX committer for Apache's top open source project. Zhengsong Tu (GitHub ID: tzssangglass) was elected as an Apache APISIX committer on July 22, 2021 for his deep involvement in Apache APISIX development and his many contributions to the community."
tags: [Interview]
---
-> 这篇采访稿讲述了屠正松从开源社区小白成长为 Apache 顶级开源项目 APISIX committer 的历程。屠正松(GitHub ID:tzssangglass)因深度参与 Apache APISIX 的开发,在社区中贡献很多,2021 年 7 月 22 日被推选为 Apache APISIX committer。
+> This interview is about Zhengsong Tu's journey from an open source community nerd to an APISIX committer for Apache's top open source project. Zhengsong Tu (GitHub ID: tzssangglass) was elected as an Apache APISIX committer on July 22, 2021 for his deep involvement in Apache APISIX development and his many contributions to the community.
-<!--truncate-->
+<! --truncate -->
-> 当我看到那个 issue 后,就有种强烈的想要参与到社区的冲动。看了社区的新手指南后,我像从新手村出来的勇者,准备打怪。
+> When I saw that issue, I had a strong urge to get involved in the community. After reading the community's newbie guide, I was like a brave man coming out of the newbie village, ready to fight.
>
-> —— Apache APISIX committer 屠正松
+> -- Zhengsong Tu, Apache APISIX committer
-历时 282 天,屠正松(GitHub ID:tzssangglass)从开源社区的小白成长为了 Apache APISIX 的 committer。
+In 282 days, Zhengsong Tu (GitHub ID: tzssangglass) has grown from an open source community nerd to an Apache APISIX committer.
-
+! [Apache APISIX committer tzssangglass github](/img/blog_img/2021-08-11-1.webp)
-屠正松因深度参与 Apache APISIX 的开发,在社区中贡献很多,2021 年 7 月 22 日被推选为 Apache APISIX committer。
+Zhengsong Tu was elected as Apache APISIX committer on July 22, 2021 for his deep involvement in Apache APISIX development and many contributions in the community.
-在一个平淡的下午,我们和正松连线聊了聊。因为疫情关系,居住在南京的他已经多日未外出。在没有和他聊天之前,我没有想到,胡子拉碴的他,竟然走过了这么曲折的路。
+On an uneventful afternoon, we chatted with Zhengsong by phone. Because of the epidemic, he has not been out for many days in Nanjing. Before I talked to him, I didn't expect that the bearded man had traveled such a winding road.
-## 大学,我的大学
+## University, my university
-> 我大学的时候学的是通信工程,每天最开心的事就是踢球。现在有时候会想,如果能带着现在的记忆回到大学时光就好了。
+> When I was in college, I studied communication engineering, and the happiest thing I did every day was to play soccer. Now sometimes I think that it would be nice to go back to my college days with the memories I have now.
-正松在大学期间里面其实没怎么接触过编程,他当年其实有 C 语言的编程课,但是因为忙着踢球,挂科了。可是,他挂科之后的补考也没过,导致重修。最尴尬的是,他重修也没过,后来怎么办呢?毕业之前还有毕业清考。这可不能再挂了,于是正松就去图书馆去借了一本 C 语言的书来看。
+Zhengsong actually didn't have much contact with programming during his college years, he actually had a C programming class, but he failed it because he was too busy playing soccer. However, he failed a make-up exam after failing the class, resulting in a retake. The most embarrassing thing is that he failed the retake as well, so what did he do afterwards? There was a graduation clearing exam before graduation. This can not be failed again, so Masatsu went to the library to borrow a C [...]
-“我当时心想,C 语言真的这么难吗?”正松说。
+"I was thinking, "Is C really that hard?" Masamatsu said.
-然后他就一直看一直看,看着看着就突然发现编程好像有那么点意思,他看懂了!最后他在毕业前顺利通过了考试。在毕业之后,找到了一份做程序员的工作。
+Then he kept reading and reading and reading, and suddenly he realized that programming seemed to have some meaning, and he understood it! He finally passed the exam before graduating. After graduation, he found a job as a programmer.
-“我本来都准备毕业回家找个厂上班了。”,他半开玩笑地说。
+"I was ready to graduate and go home and find a factory to work." , he said half-jokingly.
-彼时,他可能不会想到如今的他会成为数个知名开源项目的 developer,参与一些支撑着千万级并发流量的基础设施的开发。
+At that time, he probably wouldn't have thought that today he would be the developer of several well-known open source projects, and involved in the development of some infrastructure that supports millions of concurrent traffic.
-## 出象牙塔记
+## Out of the Ivory Tower
-> 在工业界,真实的业务场景和学校里学的很不一样的
+> In industry, the real business scenario is very different from what you learn in school.
-正松的第一份工作就职于一家做穿戴设备的创业公司,从事智能手环的研发工作。正松和他的前同事们需要通过处理从智能手环上的获取的各种传感器数据,来完成对用户的心率、运动量、血压等的监测。
+Masatsu's first job was at a wearable device startup, working on the development of smart bracelets. Masamatsu and his former colleagues had to process various sensor data from the smart bracelet to monitor the user's heart rate, exercise, blood pressure and so on.
-“工作蛮好玩的,因为在工业界,真实的业务场景和学校里学的很不一样的,很多东西都得从头开始学”,正松说。
+"It was fun because in industry, the real business scenario is very different from what you learn in school, and a lot of things have to be learned from scratch," Masatsu said.
-有一天下班之后,这家公司的老板娘突然发了一条信息,说公司的员工暂时休假,什么时候上班等通知。
+One day after work, the owner of this company suddenly sent a message saying that the company's employees were on temporary leave and that they would wait to be notified when to work.
-正松当时就觉得不对劲,怎么好好的上着班,突然就休假了?然后他立马打开招聘软件,开始找新的工作。后来才知道,公司的老板跟供应商有合同纠纷,公司短暂停摆了。
+Masatsu felt something was wrong at that time, how to work well, suddenly on vacation? Then he immediately opened the recruitment software and started looking for a new job. Later, he found out that the owner of the company had a contract dispute with the supplier, and the company was briefly shut down.
-然后,正松便到另外一家公司从事后端业务开发的工作,学习业界规范、进一步增进技术。过了快一年,因为正松比较喜欢 Nginx、OpenResty、Netty 这类简洁和高性能的技术,他进入一家大公司的开发团队,从事中间件相关开发工作。
+Then, Masatsu went to another company to engage in back-end business development work, to learn the industry norms and further improve technology. After almost a year, he joined the development team of a large company to work on middleware-related development because he liked the simplicity and high performance of technologies like Nginx, OpenResty, and Netty.
-“在这家大公司,我做的离业务稍微远那么一点点,更偏向技术一些。“正松说。
+"In this big company, I did a little bit far from the business, more technically oriented. "Masatsu said.
-正松接触 Apache APISIX 的时间是 2020 年 9 月份,那时候,他所在的团队使用的是 Kong,但是当时 Kong 无法完全满足他们的需求,于是他们便重新做网关的技术选型,试图寻找更好的方案。正松担任本次技术选型的负责人,于是他关注到了 Apache 基金会的顶级项目 Apache APISIX,进而接触了 Apache APISIX 的社区。
+Masatsu's contact with Apache APISIX was in September 2020, when his team was using Kong, but Kong was not fully meeting their needs, so they redid the technical selection of the gateway to try to find a better solution. Masatsu was in charge of this technical selection, so he came across the Apache Foundation's top project, Apache APISIX, and was introduced to the Apache APISIX community.
-彼时的他,已经毕业三年多了。
+At that time, he had already graduated more than three years ago.
-## 出新手村
+## Out of the newbie village
-> 我可以给 Apache 基金会的顶级项目提交代码了!作为一个技术工作者,这是一种技术上的自信。
+> I can submit code to the Apache Foundation's top projects! As a technical worker, that's a lot of technical confidence.
-正松在开源社区的第一个 PR 是一个 enhancement(功能增强)类型的 PR,这个 PR 让 Apache APISIX 支持了多端口监听。
+Masatsu's first PR in the open source community was an enhancement type PR, which enabled Apache APISIX to support multi-port listening.
-- issue:https://github.com/apache/apisix/issues/1195
-- PR:https://github.com/apache/apisix/pull/2409
+- issue: https://github.com/apache/apisix/issues/1195
+- PR: https://github.com/apache/apisix/pull/2409
-这个功能是正松公司需要的,在 issue 区也早有人提到,但是不知为何一直无人认领。之前,正松正好对这方面的知识有所了解,于是他想:”我可以给 Apache APISIX 提个 PR 来 fix 这个问题。“所以他在 issue 里主动要求把这个问题指派给他。
+This feature is needed by Masatsu and has been mentioned in the issue area for a long time, but for some reason it has been unclaimed. Before that, Masamatsu happened to know something about this, so he thought, "I can propose a PR to Apache APISIX to fix this problem. "So he volunteered to have the issue assigned to him in the issue.
-他说:“当时我有一种强烈的参与社区的冲动,然后我看了一下 Apache APISIX 社区的新手指南,然后就像拿着武器从新手村出来一样,兴致冲冲的准备参与。”
+He says, "I had a strong urge to get involved in the community, and then I looked at the Apache APISIX community's Beginner's Guide and was as excited to get involved as if I were coming out of the Beginner's Village with a weapon."
-选择了这个 issue 之后,正松开始在 GitHub 上面开始跟社区的伙伴讨论细节上的问题,像是配置端口的 style、实现的思路等。在讨论完之后,他开始动手实现。每天晚上下班之后去翻看 Apache APISIX 的代码,测试相关用例。在经历了三四个晚上的奋斗后,测试第一次跑通了!
+After choosing this issue, Masatsu started discussing details with his community partners on GitHub, such as the style of the configuration port, the idea of the implementation, and so on. After the discussion, he started to implement it. Every night after work, he went through the Apache APISIX code and tested the use cases. After three or four nights of struggling, the test ran for the first time!
-当时正松内心非常的兴奋,马上按照那个新手指南的引导把 PR 提上去了。然后接受 Code Review 的意见,进一步修改代码。终于,在 10 月 18 号,PR 顺利地 merge 进了仓库。
+Masatsu was very excited and immediately followed the guide to bring up the PR. Then he accepted the comments from Code Review and further modified the code. Finally, on October 18, the PR was successfully merged into the repository.
-
+! [Apache APISIX committer tzssangglass pr](/img/blog_img/2021-08-11-2.webp)
-“当时我非常的激动,感觉自己终于实质性地参与到开源社区里面去了。我可以给 Apache 基金会的顶级项目提交代码了!作为一个技术工作者,这是一种技术上的自信。”
+"I was very excited and felt like I was finally substantially involved in the open source community. I could submit code to the Apache Foundation's top projects! As a technical worker, it was a technical confidence."
-**这是正松在开源世界的第一个 PR。**
+**This is Masatsu's first PR in the open source world.**
-## 在社区印象深刻的事
+## Things that impressed me in the community
-> 因为 etcd 有 MaxCallRecvMsgSize 的限制,就从 etcd 的源头去解决,这是最优雅,也是最适合的。
+> Because etcd has a MaxCallRecvMsgSize limit, it was most elegant and appropriate to go to the source of etcd.
-当我们问到,正松在社区印象最深刻的事情是什么的时候,正松想了想说,可能是一个和 bug 有关的问题:etcd 的 MaxCallRecvMsgSize 限制。
+When we asked what was the thing that impressed Masatsu most in the community, Masatsu thought about it and said it was probably a bug-related issue: etcd's MaxCallRecvMsgSize limitation.
-正松曾经被 etcd 限制返回体大小的问题折磨过,社区内也多次反映、讨论过这个问题,但在 Apache APISIX 上无论怎么处理都不是很优雅。
+Masatsu had been tormented by etcd's return size limitation problem, and the community had reflected and discussed this problem many times, but it was not very elegant on Apache APISIX no matter how it was handled.
-直到今年 4 月份,支流科技的一位小伙伴给 etcd 提交了 PR,最终解决了这个问题。正松听说这个消息时,感到非常的震撼,当时他没有想过这个事情会以这样的方式去解决。但是现在来看的话,这个方法确实是最适合的。
+In April this year, one of our partners submitted a PR to etcd, which finally solved the problem. When Masatsu heard about this, he was very shocked, he didn't think it would be solved in such a way. But in hindsight, this was the way to go.
-“因为 etcd 有 MaxCallRecvMsgSize 的限制,就从 etcd 的源头去解决,这是最优雅,也是最适合的。这是很棒的跨社区合作的示例”,正松说。
+"Because etcd has a MaxCallRecvMsgSize limit, it's most elegant and appropriate to go to the source of etcd. This is great example of cross-community collaboration," says Masatsu.
## Sir, this way
-> 大家分工合作不同,但是都是在为开源做贡献。
+> We're all working together differently, but we're all contributing to open source.
-正松说,他刚开始参与社区的时候,把当时能看到的 APISIX 文档大部分都过了一遍。所以当时在所在公司工作的时候,同事问他问题,他虽然并不是很清楚,但是他清楚项目的文档分布情况,直接把文档找出来看一下,就大概知道是什么问题了。他认为看文档是熟悉项目的一个合适的方式。
+Masamatsu says that when he first started participating in the community, he went through most of the APISIX documentation he could see at the time. So when he was working in his company, his colleagues asked him questions, and although he was not very clear, he knew the distribution of the project's documentation, so he could look it up directly and know roughly what the problem was. He believes that reading the documentation is an appropriate way to get familiar with the project.
-Apache APISIX 的项目官网上,有完善的包括如何提 PR 的新手指南。如果想参与社区的话,可以先把官网和 Github 上的主要的文档都看一下,对项目有基本的了解,也清楚项目的文档分布情况,后面再按需索引文档。
+The Apache APISIX project website has a good guide for newcomers, including how to raise PR. If you want to participate in the community, you can first read the main documentation on the website and Github to get a basic understanding of the project and the distribution of the project's documentation, and then index the documentation as needed.
-如果想在代码方面做贡献,或者参与设计的话,一些 Ngnix 或者 OpenResty 方面的知识的储备是必要的。包括看他们官方的文档及和代码,学习他们对于相关 feature 的实现等。
+If you want to contribute to the code, or participate in the design, some knowledge of Ngnix or OpenResty is necessary. This includes looking at their official documentation and code, and learning about their implementation of relevant features.
-正松说:“我觉得这一步是无法跳过的。”
+Masamatsu said, "I think this step is impossible to skip."
-当然,你可以以使用者的身份,去参与到社区里。比如说你觉得文档有问题,或者说你按照文档去实践的时候,发现并不是那样,你也可以去提一些 issue 指出这些问题。
+Of course, you can get involved in the community as a user. For example, if you think there is something wrong with the documentation, or if you follow the documentation and find that it is not the case, you can also raise some issues to point out these problems.
-大家分工合作不同,但是都是在为开源做贡献。
+We are all working together, but we are all contributing to open source.
-## 社区欢迎所有人
+## Everyone is welcome in the community
-> 但这样做更好
+> But it's better this way
-正松说,大家都在开源社区,首先要注意的就是要遵守社区的一些规矩,和社区的小伙伴平等交流。
+Masatsu said, we are all in the open source community, the first thing to pay attention to is to comply with some of the community rules, and the community of partners to communicate on an equal footing.
-交流时要注意的点可以分成两种。
+The points to note when communicating can be divided into two kinds.
-第一种是,假如你遇到了一些问题,那你应该尽量准确地描述问题,提供可复现的用例。这个其实是最受欢迎的,或者说最能提高沟通效率的一个方式。如果你能把一个问题描述的很清晰,那大家回答问题的效率自然会非常高。
+The first is that if you encounter some problems, then you should try to accurately describe the problem and provide reproducible use cases. This is actually the most popular, or one of the most effective ways to improve communication. If you can describe a problem very clearly, then people will naturally answer the question very high efficiency.
-第二种是,如果是提出想法,解决问题等,在动手做之前,对于有歧义的点,需要在公开的场合,比如 issue ,邮件列表等上面讨论,在社区内达成一致,取得共识之后,再开始做。
+The second is that if you are proposing ideas, solving problems, etc., before you do it, for points of ambiguity, you need to discuss them in a public forum, such as issue, mailing lists, etc., to reach agreement in the community, and then start doing it after you have achieved consensus.
-## 关于 Apache Way
+## About Apache Way
-> 共识也会更新,它是社区推动项目前进的一种力量。
+> Consensus will also be updated, and it is a force for the community to move the project forward.
-正松理解的 Apache Way,是社区大于代码。
+The Apache Way, as Masatsu understands it, is about community over code.
-他认为,社区本质上是人与人之间的合作,大家分工合作,各司其职。但是在合作和各司其职之前,大家是需要形成一些共识。
+He believes that the community is essentially a collaboration between people, where everyone divides up the work and does their own job. But before we cooperate and do our own work, we need to form some consensus.
-共识是一点点积累起来的。社区参与者们抛出一个个问题,社区内会讨论,辩驳,验证,直至最后解决这些问题。在这个过程中,共识在社区内慢慢形成,共识可能是规范,也可能是边界,或者其他的形式。共识也会更新,它是社区推动项目前进的一种力量。这个过程带有一些理想主义色彩。
+Consensus is built up little by little. The community participants throw out a problem, and the community will discuss, argue, verify, and finally solve these problems. In this process, consensus is slowly formed in the community, and it may be a norm, a boundary, or some other form of consensus. Consensus is also updated, and it is a force for the community to move the project forward. This process has some idealistic overtones.
-社区的共识其实比你做代码贡献更重要,因为有了共识之后,后面去回溯某一个改动的点的时候,会更加清晰,知道这个改动的起源和当时的视角。
+Community consensus is actually more important than you making code contributions, because with consensus, when you go back to a point of change later, it will be clearer to know the origin of the change and the perspective at that time.
-## 最后
+## Finally
-最后在关麦之前,我们请正松给我们推荐一些东西。正松想了想,说:“我推荐了一部德国电影,跟社会工程学相关的《我是谁:没有绝对安全的系统》,和一本书,孔飞力老师的《叫魂:1768 年中国妖术大恐慌》。希望大家在忙碌的工作中,也不要忘了充实自己的精神生活。“
+Finally, before we shut down the mike, we asked Masatsu to recommend something to us. After thinking about it, Masatsu said, "I recommend a German film related to social engineering, Who Am I: No Absolutely Safe System, and a book by Fei-Li Kong, Calling the Spirits: The Great Chinese Demon Panic of 1768. I hope you will not forget to enrich your spiritual life even in the midst of your busy work. "
-这就是这次的采访啦!下回,我们会采访哪位社区的小伙伴呢?快来 Apache APISIX 社区瞧一瞧吧!没准,下一位 committer 就是你!
+That's it for this interview! Which community member will we interview next time? Check out the Apache APISIX community and find out! Maybe you'll be the next committer!
diff --git a/website/blog/2021/08/17/interview-airwallex.md b/website/blog/2021/08/17/interview-airwallex.md
index 447c998..8f8b8f6 100644
--- a/website/blog/2021/08/17/interview-airwallex.md
+++ b/website/blog/2021/08/17/interview-airwallex.md
@@ -1,86 +1,85 @@
---
-title: "Apache APISIX 在 Airwallex 的应用 | 专访 Airwallex 技术平台负责人李杨"
-author: "Apache APISIX 社区"
+title: Apache APISIX in Airwallex | Interview with Yang Li, Head of Airwallex Technology Platform
+author: Apache APISIX
keywords:
- APISIX
- Airwallex
-- 空中云汇
-- 金融
-- 数据主权
-description: 本文采访了 Airwallex 空中云汇 Technical Platform Lead 李杨,李杨负责公司技术平台的演进。采访中详细介绍了 Airwallex 空中云汇在做技术选型时为什么选择 Apache APISIX、Apache APISIX 在 Airwallex 空中云汇的使用场景、Apache APISIX 在生产环境的表现等。
+- Financial
+- Data Sovereignty
+description: In this article, we interviewed Airwallex Technical Platform Lead Yang Li, who is responsible for the evolution of the company's technology platform. In the interview, he introduced in detail why Airwallex chose Apache APISIX when making technology selection, the usage scenarios of Apache APISIX in Airwallex, and the performance of Apache APISIX in production environment.
tags: [Interview]
---
-> 本文采访了 Airwallex 空中云汇 Technical Platform Lead 李杨,李杨负责公司技术平台的演进。采访中详细介绍了 Airwallex 空中云汇在做技术选型时为什么选择 Apache APISIX、Apache APISIX 在 Airwallex 空中云汇的使用场景、Apache APISIX 在生产环境的表现等。
+> This article interviewed Airwallex Technical Platform Lead Yang Li, who is responsible for the evolution of the company's technology platform. The interview details why Airwallex chose Apache APISIX when making the technology selection, the usage scenarios of Apache APISIX in Airwallex, and the performance of Apache APISIX in the production environment.
-<!--truncate-->
+<! --truncate -->
-我们有幸采访到了 Airwallex 的技术平台负责人李杨,在采访中,李杨谈到了为什么在技术选型时选择 Apache APISIX,以及 Apache APISIX 在 Airwallex 的应用。
+We had a chance to interview Yang Li, the technical platform leader of Airwallex. In the interview, Yang Li talked about why he chose Apache APISIX in the technology selection, and the application of Apache APISIX in Airwallex.
-**Q:李博士,您好,请简单介绍一下自己和目前从事的工作。**
+**Q: Hello Dr. Li, please briefly introduce yourself and the work you are currently engaged in.**
-**李杨:** 你好,我叫李杨(Jan Li),哲学博士,Apache APISIX Committer,Airwallex 空中云汇 Technical Platform Lead,负责公司技术平台的演进。在加入 Airwallex 之前,曾在万向区块链领导运链盟。在万向区块链之前,曾在花旗集团领导 OTC 衍生品风控平台。
+**Jan Li:** Hi, my name is Jan Li, PhD, Apache APISIX Committer, Airwallex Technical Platform Lead, responsible for the evolution of the company's technology platform. Prior to joining Airwallex, I led the Ops Chain Alliance at Wanxiang Blockchain. Prior to Wanxiang Blockchain, he led the OTC derivatives risk control platform at Citigroup.
-Airwallex 空中云汇是一家全球金融科技公司,赋能各类规模的企业跨境运营,以此助力全球经济发展。以技术为核心,Airwallex(空中云汇)构建了专有的全球金融基础设施平台,全球支付网络已覆盖 130 多个国家和地区的 50 余种货币,为各类规模的企业提供数字化的金融科技产品,在全球互联的信息化时代,以更高效、安全的方式帮助企业在全世界高速发展。自 2015 年成立以来,Airwallex 空中云汇已获得来自顶级投资机构超 5 亿美元融资,目前在全球共有 12 个办公室及超过 900 名员工。
+Airwallex is a global financial technology company that empowers businesses of all sizes to operate across borders, thereby helping to grow the global economy. With technology at its core, Airwallex has built a proprietary global financial infrastructure platform with a global payment network covering more than 50 currencies in over 130 countries and regions, providing digital fintech products for businesses of all sizes to help them grow at high speed around the world in a more efficien [...]
-
+! [Airwallex LiYang](https://static.apiseven.com/202108/20210816001.png)
-**Q:在做技术选型的时候,是什么原因让您/您的技术团队选择使用 Apache APISIX?**
+**Q: What made you/your technical team choose to use Apache APISIX when making the technology selection?**
-**李杨**:API 网关是极其重要的基础技术组件,在技术选型时我们主要从 6 个维度比较了主要的网关产品:
+**LiYang**: API gateway is an extremely important basic technology component, and we compared the main gateway products in 6 main dimensions during the technology selection.
-- **稳定性**:API 网关的稳定性至关重要,在世界排名前 1000 的网站中,有 62.1% 是 Nginx 系的,这说明 Nginx 系 web server 是经过了生产环境复杂多样场景考验的;Apache APISIX 全动态的设计也使得它能够在修改路由时不必 reload,client 的长链接也得以保持;我们也对 Apache APISIX 进行了压力测试,在 CPU 达到 70% 以上时 Apache APISIX 仍能稳定运转。
+- **Stability**: The stability of the API gateway is critical. 62.1% of the top 1000 websites in the world are Nginx-based, which means that the Nginx-based web server has been tested in complex and diverse scenarios in production environments; Apache APISIX's fully dynamic design also allows it to modify routes without having to reload, and the client's long links are maintained. The fully dynamic design of Apache APISIX also allows it to maintain long links to clients without having to [...]
-- **性能**:每个 API 请求都会经过 API 网关,减小网关性能损耗能大大降低公司 API 整体响应时间。在 PoC 中我们比较了主要的网关产品,Apache APISIX 的响应延迟比其它网关低 50% 以上;Apache APISIX 数据面的设计也使集群中的每一个实例都相互独立,这也使得它天生支持水平扩展。
+- **Performance**: Every API request passes through the API gateway, and reducing gateway performance loss can greatly reduce the overall response time of the company's API. In our PoC comparison of the major gateway products, Apache APISIX has more than 50% lower response latency than other gateways; the design of the Apache APISIX data plane also makes each instance in the cluster independent of each other, which also makes it inherently support horizontal scaling.
-- **可扩展性**: API 网关模式是非常重要的微服务架构模式,符合 API 网关模式的 API 网关必须支持企业复杂的鉴权、权限控制、服务发现、限流、降级、负载均衡、白名单、动态路由等功能,所以支持怎样的定制是选择 API 网关时非常关键的考量。
+- **Scalability**: The API gateway model is a very important microservice architecture model, and API gateways that conform to the API gateway model must support complex enterprise features such as authentication, permission control, service discovery, flow restriction, degradation, load balancing, whitelisting, dynamic routing, etc. So what kind of customization is supported is a very critical consideration when choosing an API gateway.
-- **社区活跃度**:新的技术与需求层出不穷,一个活跃的社区是 API 网关跟上技术演进步伐的关键。早在 Apache APISIX 还是 Apache 孵化项目时,其社区就已经非常活跃,从 contributor 数量、issue 响应时间、Pull Request 数量三个指标来看都是非常活跃的社区。
+- **Community Activity**: New technologies and requirements are emerging all the time, and an active community is key for API gateways to keep pace with the evolution of technology. As early as when Apache APISIX was an Apache incubation project, its community was already very active, in terms of contributor count, issue response time, and Pull Request count.
-- **私有部署**:API 网关作为企业核心技术架构组件,企业应该把它部署在自己的私有网络边缘。Apache APISIX 具有良好的环境适应性,能够被轻易地部署在包括云计算平台在内的各种环境上。
+- **Private Deployment**: As a core technology architecture component, API gateways should be deployed at the edge of an enterprise's private network. Apache APISIX has good environmental adaptability and can be easily deployed on various environments, including cloud computing platforms.
-- **开源协议**:Apache 2.0 赋予了定制 APISIX 的企业相当大的技术自由度。
+- **Open Source Protocol**: Apache 2.0 gives considerable technical freedom to enterprises that customize APISIX.
-**Q:Apache APISIX 用在了哪些场景?解决了哪些问题?**
+**Q: What scenarios is Apache APISIX used in? What problems have been solved?**
-**李杨**:我们把 Apache APISIX 用作微服务网关模式的核心组件,它被部署在网络边缘,为所有进入 Airwallex 的流量提供通用网关功能,解决的问题包括:
+**Yang Lee**: We use Apache APISIX as a core component of our microservice gateway model, which is deployed at the edge of the network to provide common gateway functionality for all traffic coming into Airwallex, solving problems such as
-- 数据主权问题:对于跨国运营的金融基础设施,数据主权是非常关键的监管要求。为此,我们利用 Apache APISIX 动态上游选择的功能开发了符合监管的动态路由插件。动态路由能够根据用户请求的特征智能选择上游来进行请求分发,将复杂的多数据中心协同问题从服务层抽象到网关层。动态路由实质是要回答两个问题:如何对上游进行分组?如何匹配请求与分组。
+- Data sovereignty issues: Data sovereignty is a very critical regulatory requirement for financial infrastructures that operate across borders. To this end, we developed a regulatory compliant dynamic routing plug-in using the Apache APISIX dynamic upstream selection feature. Dynamic routing can intelligently select upstreams for request distribution based on the characteristics of user requests, abstracting the complex multi-data center collaboration problem from the service layer to t [...]
-- 微服务隔离:Airwallex 希望各微服务的工程团队能够自主控制自己的服务,有效降低沟通协调的成本,提高工程效能。这一架构理念要求被各团队共享的基础架构组件,比如: API Gateway 都能支持多租户隔离。在保证整个系统的强壮性和成本可控的同时,允许业务团队根据自身的需要对网关功能进行配置和扩展,保持微服务团队与服务的独立性。
+- Microservice Isolation: Airwallex wants the engineering teams of each microservice to have autonomous control over their own services, effectively reducing the cost of communication and coordination and improving engineering effectiveness. This architectural concept requires that infrastructure components shared by teams, such as API Gateway, support multi-tenant isolation. While ensuring the robustness and cost control of the whole system, it allows business teams to configure and ext [...]
-- 租户级限流:在多租户环境中,每个租户的流量特征是不同的。对不同的租户进行同样的限流无法满足商业上的需求,租户级限流能够根据用户特征做更恰当的限流。
+- Tenant-level flow restriction: In a multi-tenant environment, the traffic characteristics of each tenant are different. The same flow restriction for different tenants cannot meet the business needs, and tenant-level flow restriction can do more appropriate flow restriction based on user characteristics.
-- 租户级白名单:在多租户环境中,每个租户的访问 IP 是不同的。单一的白名单控制无法满足租户级安全管理的需要,租户级白名单使得每个租户可以控制自己的白名单,也不用担心白名单中的其它用户访问自己的资源。
+- Tenant-level whitelisting: In a multi-tenant environment, each tenant's access IP is different. Single whitelist control cannot meet the needs of tenant-level security management. Tenant-level whitelisting allows each tenant to control its own whitelist and not worry about other users in the whitelist accessing its own resources.
-- Authentication:API 网关不仅要支持请求 authentication,还需要支持动态更新密钥,经常更新密钥是保证用户资源安全的关键一环。
+- Authentication: API gateways should not only support request authentication, but also support dynamic key update, which is a key part of ensuring the security of user resources.
-- Authorization:企业级应用的权限管理是非常复杂的,不同的应用场景有着截然不同的权限管理模型。API 网关可以根据路由配置验证请求用户是否有足够的权限访问接口,第一时间拦截非法的流量。
+- The API gateway can verify whether the requesting user has sufficient authority to access the interface according to the routing configuration and intercept illegal traffic in the first place.
-
+! [Airwallex arch](https://static.apiseven.com/202108/20210816002.png)
-内容比较多简化一下,可以更清楚:
+It's a bit more involved and can be simplified to make it clearer: !
-
+! [Airwallex arch](https://static.apiseven.com/202108/20210816003.png)
-**Q:在 Apache APISIX 升级过程中是否顺利?分享一下升级过程中的感受或者故事。**
+**Q:Did you have a smooth upgrade process in Apache APISIX? Share your feelings or stories about the upgrade process.**
-为了能够随时升级到新版本的 Apache APISIX,我们把主要的功能都实现为定制化插件。这意味着我们的代码库不可能与 Apache APISIX 主 Repo 核心代码产生冲突,这帮助我们避免了可能遇到的代码冲突。但有时我们也需要修改核心代码,此时我们会尽量在开源社区实现这些功能。在开源社区讨论这些功能的时候,社区的小伙伴们非常热心参与讨论,在大多数情况下都能很快解决我们的问题。
+In order to be able to upgrade to new versions of Apache APISIX at any time, we implemented the main features as custom plugins. This means that our code base is unlikely to conflict with the core Apache APISIX main Repo code, which helps us avoid code conflicts we might encounter. However, there are times when we need to modify the core code, at which point we try to implement these features in the open source community. When we discuss these features in the open source community, the c [...]
-**Q:Apache APISIX 在生产环境运行多久了?在线上表现如何?**
+**Q: How long has Apache APISIX been running in a production environment? How does it perform online?**
-**李杨**:生产环境运行了 15 个月了,在开启动态路由、租户级限流、租户级白名单、Authentication、Authorization 等功能的情况下 99% 响应延迟在 23ms 以内,整体表现非常稳定。得益于 Apache APISIX 优秀的插件机制,可以保障我们在几乎不修改它核心代码情况下,增加符合业务需求的私有插件。完备的测试体系也进一步保障了软件质量,可以放心增加插件个性化要求的同时,保证不破坏原有核心逻辑。
+**Yang Li**: The production environment has been running for 15 months, and 99% of the response latency is within 23ms with dynamic routing, tenant-level flow restriction, tenant-level whitelisting, Authentication, Authorization, etc. The overall performance is very stable. Thanks to the excellent plug-in mechanism of Apache APISIX, we can add private plug-ins that meet business requirements with little modification to its core code. The complete testing system also further guarantees th [...]
-**Q:Apache APISIX 有哪些不足,希望社区一起建设完善?**
+**Q: What are the shortcomings of Apache APISIX and what do you hope the community will build together to improve?**
-**李杨**:Apache APISIX 的数据面设计为它带来了无损的水平扩展和极致的性能,但这也使得路由配置很难做到向前兼容,为新版本的发布带来了一些协调上的困难。
+**LI Yang**: Apache APISIX's data-plane design brings it lossless horizontal scaling and extreme performance, but it also makes the routing configuration difficult to achieve forward compatibility, which brings some coordination difficulties for the release of new versions.
-**Q:后续有什么计划?**
+**Q: What are the follow-up plans?**
-**李杨**:后续计划主要包括三个方面:
+**Yang Li**: The follow-up plan includes three main areas.
-1. 用多层网络将不同的网关逻辑拆分到不同的分层中,比如根据数据主权分发流量与其它网关逻辑属于不同的网络分层;
-2. 易读易用的路由管理对 API 网关的成败非常关键,虽然网关的功能会不断迭代与增加,但路由管理需要对开发者友好,让开发者能够轻易理解网关能为他做什么、该怎么配置、怎么发布。
-3. 用请求染色帮助实现生产环境测试。用 API 网关请求染色实现生产环境测试能为我们带来灵活性与易用性。
+1. using multi-layer networks to split different gateway logic into different tiers, such as distributing traffic based on data sovereignty with other gateway logic belonging to a different network tier.
+2. easy-to-read and easy-to-use route management is critical to the success or failure of the API gateway, although the gateway features will continue to iterate and increase, but the route management needs to be developer-friendly so that developers can easily understand what the gateway can do for him, how to configure and how to publish.
+3. Use request staining to help implement production environment testing. Implementing production environment testing with API gateway request staining can bring us flexibility and ease of use.
-**Q:感谢李博士,期待 Apache APISIX 在 Airwallex 有更多的使用场景,发挥的更多作用。**
+Thank you, Dr. Li, and we look forward to more use cases and roles for Apache APISIX in Airwallex.
diff --git a/website/blog/2021/08/18/Auth-with-Casbin-in-Apache-APISIX.md b/website/blog/2021/08/18/Auth-with-Casbin-in-Apache-APISIX.md
index 093590a..688b551 100644
--- a/website/blog/2021/08/18/Auth-with-Casbin-in-Apache-APISIX.md
+++ b/website/blog/2021/08/18/Auth-with-Casbin-in-Apache-APISIX.md
@@ -1,48 +1,48 @@
---
-title: "在 Apache APISIX 中使用 Casbin 进行授权"
-author: "Casbin 社区 & Apache APISIX 社区"
+title: Licensing with Casbin in Apache APISIX
+author: Casbin & Apache APISIX
keywords:
-- API 网关
+- API Gateway
- APISIX
- Apache APISIX
- Casbin
- RBAC
-description: 当我们在使用 Apache APISIX 时,可能想要在应用里添加复杂的授权逻辑。在此篇文章中,我们将使用 Apache APISIX 的内置 Casbin 插件(authz-casbin)来实现基于角色的访问控制(RBAC)模型。
+description: When we are using Apache APISIX, we may want to add complex authorization logic to our application. In this article, we will use the built-in Casbin plugin (authz-casbin) of Apache APISIX to implement the role-based access control (RBAC) model.
tags: [Practical Case]
---
-> 当我们在使用 Apache APISIX 时,可能想要在应用里添加复杂的授权逻辑。在此篇文章中,我们将使用 Apache APISIX 的内置 Casbin 插件(authz-casbin)来实现基于角色的访问控制(RBAC)模型。
+> When we are using Apache APISIX, we may want to add complex authorization logic to our application. In this post, we will use the built-in Casbin plugin (authz-casbin) for Apache APISIX to implement a role-based access control (RBAC) model.
-<!--truncate-->
+<! --truncate-->
-## 介绍
+## Introduction
### Apache APISIX
-[Apache APISIX](https://github.com/apache/apisix) 是一个动态、实时、高性能的 API 网关, 提供负载均衡、动态上游、灰度发布、精细化路由、限流限速、服务降级、服务熔断、身份认证、可观测性等数百项功能。你可以使用 Apache APISIX 来处理传统的南北向流量,以及服务间的东西向流量, 也可以当做 [k8s ingress controller](https://github.com/apache/apisix-ingress-controller) 来使用。
+[Apache APISIX](https://github.com/apache/apisix) is a dynamic, real-time, high-performance API gateway that provides load balancing, dynamic upstream, grayscale publishing, fine-grained routing, flow and speed limiting, service degradation, service meltdown, authentication, observability, and hundreds of other features. You can use Apache APISIX for traditional north-south traffic, as well as east-west traffic between services, or as a [k8s ingress controller](https://github.com/apache/ [...]
### Casbin
-[Casbin](https://casbin.org/zh-CN/) 是一个强大的、高效的开源访问控制框架,其权限管理机制支持多种访问控制模型。
+[Casbin](https://casbin.org/zh-CN/) is a powerful and efficient open source access control framework with a permission management mechanism that supports multiple access control models.
-### authz-casbin 插件介绍
+### authz-casbin plugin introduction
-在 Apache APISIX 的使用中,路由匹配和请求授权之间有个隐含的矛盾点:为了更高细粒度的权限控制,需要配置更高细粒度的路由,来精准识别请求并对请求进行授权。在复杂的授权模型场景下,这将导致路由数量成倍增加,加剧了运维复杂度。
-[authz-casbin](https://github.com/apache/apisix/blob/d9b928321fcdd12eef024df8c7c410424c1e0c8b/docs/en/latest/plugins/authz-casbin.md) 是一个基于 lua-casbin 的 Apache APISIX 插件,支持基于各种访问模型的强大授权。Casbin 是一个强大的、高效的开源访问控制框架,支持 ACL、RBAC、ABAC 等访问控制模型,lua-casbin 是 Casbin 访问控制框架的 Lua 版本实现。
-authz-casbin 插件可以把路由匹配和请求授权这两个功能很好地进行解耦,你可以将各种授权访问模型加载到 Apache APISIX 中,借助 lua-casbin 实现高效复杂的授权模式。
+In the use of Apache APISIX, there is an implicit tension between route matching and request authorization: for higher granularity access control, higher granularity routes need to be configured to accurately identify requests and authorize them. In complex authorization model scenarios, this leads to an exponential increase in the number of routes, which increases the complexity of operations and maintenance.
+[authz-casbin](https://github.com/apache/apisix/blob/d9b928321fcdd12eef024df8c7c410424c1e0c8b/docs/en/latest/plugins/authz-casbin. md) is a lua-casbin based Apache APISIX plugin that supports powerful authorization based on various access models. casbin is a powerful and efficient open source access control framework that supports ACL, RBAC, ABAC and other access control models. lua-casbin is a Lua version implementation of the Casbin access control framework.
+The authz-casbin plugin can decouple the two functions of route matching and request authorization very well. You can load various authorization access models into Apache APISIX and implement efficient and complex authorization models with the help of lua-casbin.
-**注意**:如果你想要实现身份验证(authentication),你需要使用其他插件或者自己来配置完成验证用户身份,比如 [jwt-auth](https://github.com/apache/apisix/blob/master/docs/zh/latest/plugins/jwt-auth.md) 插件。
+**Note**: If you want to implement authentication, you need to use other plugins or configure yourself to complete the authentication of the user's identity, for example [jwt-auth](https://github.com/apache/apisix/blob/master/docs/zh/ latest/plugins/jwt-auth.md) plugin.
-## authz-casbin 使用指南
+## authz-casbin Usage Guide
-### 创建一个模型
+### Create a model
-authz-casbin 插件使用三个参数来进行授权:subject、object 和 action。subject 是用户名,代指请求中的用户;object 是将要被访问的 URL 链接也就是将被访问的资源;action 是请求授权的行为,比如读操作(read)或者是写操作(write)。
-假如,我们想要创建一个模型来访问三个资源:/,/res1,/res2,我们想要一个类似于这样的模型:
+The authz-casbin plugin uses three parameters for authorization: subject, object and action. subject is the user name, which refers to the user in the request; object is the URL link that will be accessed, i.e. the resource that will be accessed; action is the action that is requested for authorization, such as read or write. (write).
+If we want to create a model to access three resources: /, /res1, /res2, we want a model like this
-
+! [authz-casbin example](/img/blog_img/2021-08-18-1.png)
-在这个模型中,所有的用户,例如 Jack,可以访问主页面(/)。而像 Alice 和 Bob 具有管理员权限的用户则可以访问所有的页面和资源(/res1,/res2,/)。这样,我们就需要来限制没有管理员权限的用户只能使用 GET 请求方法访问特定的资源。所需要的模型如下:
+In this model, all users, such as Jack, have access to the main page (/). And users like Alice and Bob with admin rights have access to all pages and resources (/res1, /res2, /). Thus, we need to restrict users without administrator privileges to access specific resources using the GET request method. The required model is as follows.
```shell
[request_definition]
@@ -61,9 +61,9 @@ e = some(where (p.eft == allow))
m = (g(r.sub, p.sub) || keyMatch(r.sub, p.sub)) && keyMatch(r.obj, p.obj) && keyMatch(r.act, p.act)
```
-### 创建一条策略
+### Create a policy
-从上述的例子来看,策略应该像是这样的:
+From the above example, the policy should look like this.
```shell
p, *, /, GET
@@ -72,15 +72,15 @@ g, alice, admin
g, bob,admin
```
-模型里的 matcher 表明:
+The matcher in the model indicates that.
-1. `(g(r.sub, p.sub) || keyMatch(r.sub, p.sub))`:请求里的 subject 和策略里的 subject 有着相同的角色或者请求里的 subject 和策略里的 subject 可以通过内置的方法 `keyMatch` 匹配。`keyMatch` 作为 Lua Casbin 的内置函数,相关的描述以及更多的函数可跳转 [lua-casbin](https://github.com/casbin/lua-casbin/blob/master/src/util/BuiltInFunctions.lua)。
-2. `keyMatch(r.obj, p.obj)`:请求里的 object 和策略里的 object 可相互匹配(代指 URL 链接)。
-3. `keyMatch(r.act, p.act)`:请求里的 action 和策略里的 action 可相互匹配(代指 HTTP 请求方法)。
+1. `(g(r.sub, p.sub) || keyMatch(r.sub, p.sub))`: The subject in the request and the subject in the policy have the same role or the subject in the request and the subject in the policy can be matched by the built-in method `keyMatch`. `keyMatch` is a built-in function of Lua Casbin, a description of which and more can be found at [lua-casbin](https://github.com/casbin/lua-casbin/blob/master/src/util/BuiltInFunctions. lua). 2.
+2. `keyMatch(r.obj, p.obj)`: the object in the request and the object in the policy can match each other (proxy for URL links). 3.
+3. `keyMatch(r.act, p.act)`: the action in the request and the action in the policy match each other (proxy for the HTTP request method).
-### 在路由上使用插件
+### Using plugins on routes
-一旦你创建了模型和策略,你可以使用 APISIX Admin API 在路由上使用。若想使用,你可以模型和策略的文件路径:
+Once you have created a model and a policy, you can use it on a route using the APISIX Admin API. To use it, you can model and policy file paths to.
```shell
curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
@@ -102,8 +102,8 @@ curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f13
}'
```
-在这里,username 是传递到 subject 里的用户名。例如,你可以设置`"username":"user"`来把你定义的`"user":"alice"`传递到 username ,让 username 成为 Alice。
-同样,你可以将模型和策略直接放到里面:
+In this case, username is the username passed into the subject. For example, you can set `"username": "user"` to pass the `"user": "alice"` you defined to the username, making the username Alice.
+Similarly, you can put models and policies directly into
```shell
curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
@@ -142,9 +142,9 @@ curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f13
}'
```
-### 利用全局模型/策略使用插件
+### Using plugins with global models/policies
-在一些情形中,你可能想要在多个路由中使用相同的模型和策略,你可以首先发送一个 PUT 请求将模型和策略的配置发送到插件的元数据:
+In some cases where you may want to use the same model and policy in multiple routes, you can first send a PUT request to send the model and policy configuration to the plugin's metadata at
```shell
curl <http://127.0.0.1:9080/apisix/admin/plugin_metadata/authz-casbin> -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -i -X PUT -d '
@@ -166,7 +166,7 @@ g, bob, admin"
}'
```
-然后,你需要使用 Admin API 来发送请求使得多个路由使用相同的模型/策略配置;
+You then need to use the Admin API to send a request to make multiple routes use the same model/policy configuration; the
```shell
curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
@@ -186,10 +186,10 @@ curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f13
}'
```
-这将会将插件的配置动态地添加到路由中。通过向插件的配置数据中发送更新模型和策略的请求,你可以轻松地更新插件的配置。
+This will add the plugin's configuration to the route dynamically. You can easily update the plugin's configuration by sending a request to update the model and policy in the plugin's configuration data.
-## 最后
+## Finally
-感谢 Casbin 和 Apache APISIX 社区的开发者们,从 Casbin 社区的开发者 rushitote 提出 issue,提交 PR,到 Apache APISIX 社区的开发者们积极地 review PR,这个跨社区的合作友好而有序地向前推进,响应 open source makes world better。
+Thanks to the developers of Casbin and Apache APISIX communities, from the Casbin community developers rushitote to raise issues and submit PRs, to the Apache APISIX community developers to actively review PRs, this cross-community collaboration is moving forward in a friendly and orderly way, responding to open source makes the world better.
-来源:[authorization-in-apisix-using-casbin](https://medium.com/@rushitote/authorization-in-apisix-using-casbin-59b693669d6d)
+Source: [authorization-in-apisix-using-casbin](https://medium.com/@rushitote/authorization-in-apisix-using-casbin-59b693669d6d)
diff --git a/website/blog/2021/08/19/go-makes-Apache-APISIX-better.md b/website/blog/2021/08/19/go-makes-Apache-APISIX-better.md
index 1dd7ad2..6892788 100644
--- a/website/blog/2021/08/19/go-makes-Apache-APISIX-better.md
+++ b/website/blog/2021/08/19/go-makes-Apache-APISIX-better.md
@@ -1,35 +1,35 @@
---
-title: "Go 让 Apache APISIX 如虎添翼"
-author: "罗泽轩"
+title: Go gives Apache APISIX a run for its money
+author: Zexuan Luo
authorURL: "https://github.com/spacewander"
authorImageURL: "https://avatars.githubusercontent.com/u/4161644?v=4"
keywords:
- Go
- APISIX
-- APISIX Go 插件
+- Go Plugin
- APISIX Go plugin
- apisix-go-plugin-runner
- Golang
tags: [Practical Case]
---
-> 这篇文章将详细讲解如何用 Go 来开发 Apache APISIX 插件。通过拥抱 Go 的生态圈,为 Apache APISIX 开创一片新天地,希望 Go 能让 Apache APISIX 如虎添翼!
+> This article will explain in detail how to use Go to develop Apache APISIX plugins. By embracing the Go ecosystem and breaking new ground for Apache APISIX, we hope that Go will make Apache APISIX even better!
-<!--truncate-->
+<! --truncate-->
-## 为什么是 Go
+## Why Go
-[Apache APISIX](https://github.com/apache/apisix) 允许用户通过插件的方式来拓展功能,如鉴权、限流、请求改写等核心功能都是通过插件的方式实现的。虽然 Apache APISIX 核心代码是使用 Lua 编写的,但是 Apache APISIX 支持多语言开发插件,比如 Go 、Java。
+[Apache APISIX](https://github.com/apache/apisix) allows users to extend functionality by way of plugins. Core features such as forensics, flow restriction, request rewriting, etc. are implemented by way of plugins. Although the core code of Apache APISIX is written in Lua, Apache APISIX supports multi-language development of plugins, such as Go, Java.
-这篇文章将详细讲解如何用 Go 来开发 Apache APISIX 插件。通过拥抱 Go 的生态圈,为 Apache APISIX 开创一片新天地,希望 Go 能让 Apache APISIX 如虎添翼!
+This article will explain in detail how to develop Apache APISIX plugins in Go. By embracing the Go ecosystem, we are breaking new ground for Apache APISIX, and we hope that Go will make Apache APISIX even better!
-## 安装
+## Installation
-采用库的方式来使用 Go Runner,[apisix-go-plugin-runner](https://github.com/apache/apisix-go-plugin-runner) 中的 `cmd/go-runner` 官方给出的例子,展示该如何使用 Go Runner SDK。未来也会支持通过 Go Plugin 的机制加载预先编译好的插件。
+To use Go Runner as a library, the official `cmd/go-runner` example in [apisix-go-plugin-runner](https://github.com/apache/apisix-go-plugin-runner) shows how to use the Go Runner SDK. The Go Runner SDK will also support loading pre-compiled plugins via the Go Plugin mechanism in the future.
-## 开发
+## Development
-### 使用 Go Runner SDK 进行开发
+### Developing with the Go Runner SDK
```bash
$ tree cmd/go-runner
@@ -37,12 +37,12 @@ cmd/go-runner
├── main.go
├── main_test.go
├── plugins
-│ ├── say.go
-│ └── say_test.go
+│ ├── say.go
+│ └── say_test.go
└── version.go
-```
+ðŸ™' ðŸ™'
-上面是官方示例的目录结构。`main.go` 是入口,其中最关键的部分在于:
+Above is the directory structure of the official example. ``main.go`` is the entry point, where the most critical part is.
```go
cfg := runner.RunnerConfig{}
@@ -50,22 +50,22 @@ cfg := runner.RunnerConfig{}
runner.Run(cfg)
```
-`RunnerConfig` 可以用来控制日志等级和日志输出位置。
+`RunnerConfig` can be used to control the log level and log output location.
-`runner.Run` 会让应用监听目标位置,接收请求并执行注册好的插件。应用会一直处于这一状态直到退出。
+`runner.Run` will make the application listen to the target location, receive requests and execute the registered plugins. The application will remain in this state until it exits.
-打开 `plugins/say.go`:
+Open `plugins/say.go`.
```go
func init() {
err := plugin.RegisterPlugin(&Say{})
- if err != nil {
+ if err ! = nil {
log.Fatalf("failed to register plugin say: %s", err)
}
}
```
-由于 `main.go` 导入了 plugins 包,
+Since `main.go` imports the plugins package, the
```go
import (
@@ -75,11 +75,11 @@ import (
)
```
-这样就在执行 `runner.Run` 之前通过 `plugin.RegisterPlugin` 注册了 `Say`。
+This registers `Say` with `plugin.RegisterPlugin` before executing `runner.Run`.
-`Say` 需要实现以下方法:
+`Say` needs to implement the following methods.
-`Name` 方法返回插件名。
+The `Name` method returns the plugin name.
```go
func (p *Say) Name() string {
@@ -87,7 +87,7 @@ func (p *Say) Name() string {
}
```
-`ParseConf` 会在插件配置变化的时候调用,解析配置并返回插件特定的配置上下文。
+ParseConf will be called when the plugin configuration changes, parsing the configuration and returning a plugin-specific configuration context.
```go
func (p *Say) ParseConf(in []byte) (interface{}, error) {
@@ -97,79 +97,79 @@ func (p *Say) ParseConf(in []byte) (interface{}, error) {
}
```
-该插件的上下文是这样的:
+The context of the plugin looks like this.
```go
type SayConf struct {
- Body string `json:"body"`
+ Body string `json: "body"`
}
```
-`Filter` 会在每个配置了 say 插件的请求中执行。
+Filter is executed on every request with the say plugin configured.
```go
func (p *Say) Filter(conf interface{}, w http.ResponseWriter, r pkgHTTP.Request) {
- body := conf.(SayConf).Body
+ body := conf.(SayConf).
if len(body) == 0 {
return
}
w.Header().Add("X-Resp-A6-Runner", "Go")
_, err := w.Write([]byte(body))
- if err != nil {
+ if err ! = nil {
log.Errorf("failed to write: %s", err)
}
}
```
-可以看到 Filter 把配置里面的 body 的值作为响应体。如果在插件中直接进行响应,就会中断请求。
+You can see that Filter takes the value of the body inside the configuration as the response body. If the response is made directly in the plugin, it will break the request.
-Go Runner SDK API 文档:https://pkg.go.dev/github.com/apache/apisix-go-plugin-runner
+Go Runner SDK API documentation: https://pkg.go.dev/github.com/apache/apisix-go-plugin-runner
-把应用构建起来后(在示例里面是 `make build`),在运行时需要设置两个环境变量:
+After building the application (`make build` in the example), you need to set two environment variables at runtime.
1. `APISIX_LISTEN_ADDRESS=unix:/tmp/runner.sock`
2. `APISIX_CONF_EXPIRE_TIME=3600`
-像这样:
+Like this.
```go
-APISIX_LISTEN_ADDRESS=unix:/tmp/runner.sock APISIX_CONF_EXPIRE_TIME=3600 ./go-runner run
+APISIX_LISTEN_ADDRESS=unix:/tmp/runner.sock APISIX_CONF_EXPIRE_TIME=3600 . /go-runner run
```
-应用运行时会去监听 `/tmp/runner.sock`。
+The application will listen to `/tmp/runner.sock` when it runs.
-### 设置 Apache APISIX (开发)
+### Setting up Apache APISIX (development)
-首先要安装 Apache APISIX,需要和 Go Runner 位于同一实例上。
+The first step is to install Apache APISIX, which needs to be on the same instance as Go Runner.
-
+! [Apache APISIX work flow](/img/blog_img/2021-08-19-1.png)
-上图左边是 Apache APISIX 的工作流程,右边的 plugin runner 负责运行不同语言编写的外部插件。apisix-go-plugin-runner 就是这样支持 Go 语言的 runner。
+The above diagram shows the workflow of Apache APISIX on the left, and the plugin runner on the right is responsible for running external plugins written in different languages. apisix-go-plugin-runner is such a runner that supports the Go language.
-当你在 Apache APISIX 中配置一个 plugin runner 时,Apache APISIX 会把 plugin runner 作为自己的一个子进程,该子进程与 Apache APISIX 进程属于同一个用户,当我们重启或重新加载 Apache APISIX 时,plugin runner 也将被重启。
+When you configure a plugin runner in Apache APISIX, Apache APISIX treats the plugin runner as a child of itself, which belongs to the same user as the Apache APISIX process, and when we restart or reload Apache APISIX, the plugin runner will be restarted as well.
-如果为一个给定的路由配置了 ext-plugin-* 插件,击中该路由的请求将触发 Apache APISIX 通过 unix socket 向 plugin runner 执行 RPC 调用。调用细分为两个阶段:
+If the ext-plugin-* plugin is configured for a given route, a request to hit that route will trigger Apache APISIX to make an RPC call to the plugin runner over a unix socket. The call is broken down into two phases.
-- ext-plugin-pre-req: 在执行绝大部分 Apache APISIX 内置插件(Lua 语言插件)之前
-- ext-plugin-post-req: 在执行 Apache APISIX 内置插件(Lua 语言插件)之后
+- ext-plugin-pre-req: before executing most of the Apache APISIX built-in plugins (Lua language plugins)
+- ext-plugin-post-req: after the execution of the Apache APISIX built-in plugins (Lua language plugins)
-根据需要配置 plugin runner 的执行时机。
+Configure the timing of plugin runner execution as needed.
-plugin runner 会处理 RPC 调用,在其内部创建一个模拟请求,然后运行其他语言编写的插件,并将结果返回给 Apache APISIX。
+The plugin runner processes the RPC call, creates a simulated request inside it, then runs the plugins written in other languages and returns the results to Apache APISIX.
-这些插件的执行顺序是在 ext-plugin-* 插件配置项中定义的。像其他插件一样,它们可以被启用并在运行中重新定义。
+The order of execution of these plugins is defined in the ext-plugin-* plugin configuration entry. Like other plugins, they can be enabled and redefined on the fly.
-为了展示如何开发 Go 插件,我们先设置 Apache APISIX 进入开发模式。在 config.yaml 中增加以下配置:
+To show how to develop Go plugins, we first set up Apache APISIX to enter development mode. Add the following configuration to config.yaml.
```shell
ext-plugin:
path_for_test: /tmp/runner.sock
```
-这个配置的意思是,命中路由规则后,Apache APISIX 会向 /tmp/runner.sock 发起 RPC 请求。
+This configuration means that after the routing rule is hit, Apache APISIX will make an RPC request to /tmp/runner.sock.
-接下来设置路由规则:
+Next, set up the routing rules.
```shell
curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
@@ -178,7 +178,7 @@ curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f13
"plugins": {
"ext-plugin-pre-req": {
"conf": [
- {"name":"say", "value":"{\"body\":\"hello\"}"}
+ { "name": "say", "value":"{\"body\":\"hello\"}"}
]
}
},
@@ -192,11 +192,11 @@ curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f13
'
```
-注意插件名称配置在 `name` 里面,插件配置(经 JSON 序列化后)放在 `value` 里面。
+Note that the plugin name is configured in `name` and the plugin configuration (after JSON serialization) is placed in `value`.
-如果在开发过程中看到 Apache APISIX 端有 `refresh cache and try again` 的 warning 和 Runner 端有 `key not found` 的 warning,这是因为配置缓存不一致导致的。因为开发状态下,Runner 不是由 Apache APISIX 管理的,所以内部状态会有可能不一致。不用担心,Apache APISIX 会重试。
+If you see `refresh cache and try again` warning on Apache APISIX side and `key not found` warning on Runner side during development, this is due to configuration cache inconsistency. Since the Runner is not managed by Apache APISIX in the development state, the internal state may be inconsistent. Don't worry, Apache APISIX will retry.
-然后我们请求一下:curl 127.0.0.1:9080/get
+Then we request: curl 127.0.0.1:9080/get
```shell
$ curl http://127.0.0.1:9080/get
@@ -211,11 +211,11 @@ Server: APISIX/2.7
hello
```
-可以看到接口返回 hello 而且没有访问到任何上游。
+You can see that the interface returns hello and does not access any upstream.
-### 设置 Apache APISIX (运行)
+### Setting up Apache APISIX (run)
-这里以 go-runner 为例,只需把运行命令行配置在 ext-plugin 里就可以运行了:
+Here is an example of go-runner, which can be run by simply configuring the run command line in ext-plugin: the
```shell
ext-plugin:
@@ -223,15 +223,15 @@ ext-plugin:
cmd: ["/path/to/apisix-go-plugin-runner/go-runner", "run"]
```
-Apache APISIX 会把 plugin runner 作为自己的一个子进程,管理它的整个生命周期。
+Apache APISIX will treat the plugin runner as a child process of its own, managing its entire lifecycle.
-注意:这时就不要配置 path_for_test 了。Apache APISIX 在启动 runner 时会自动分配一个 unix socket 地址供 runner 监听。APISIX_LISTEN_ADDRESS 和 APISIX_CONF_EXPIRE_TIME 这两个环境变量也不用手动设置。
+Note: Do not configure path_for_test at this point. Apache APISIX automatically assigns a unix socket address for the runner to listen to when it starts. You don't need to set them manually.
-## 总结
+## Summary
-目前 Go Plugin Runner 还处于早期开发阶段,我们会陆续完善其功能。成功的开源项目离不开大家的贡献,欢迎各位参与到 apisix-go-plugin-runner 的开发中来,让我们一起共建 Apache APISIX 和 Go 的桥梁!
-点击访问 [apisix-go-plugin-runner](https://github.com/apache/apisix-go-plugin-runner).
+Go Plugin Runner is still in the early stages of development, we will continue to improve its functionality. We welcome you to participate in the development of apisix-go-plugin-runner, and let's build a bridge between Apache APISIX and Go together!
+Click to visit [apisix-go-plugin-runner](https://github.com/apache/apisix-go-plugin-runner).
-## 相关阅读
+## Related reading
-[如何用 Java 编写 Apache APISIX 插件](https://apisix.apache.org/blog/2021/06/21/use-Java-to-write-Apache-APISIX-plugins)
+[How to write Apache APISIX plugins in Java](https://apisix.apache.org/blog/2021/06/21/use-Java-to-write-Apache-APISIX-plugins)
diff --git a/website/blog/2021/08/21/shanghai-meetup.md b/website/blog/2021/08/21/shanghai-meetup.md
index f7e8537..bdda7f0 100644
--- a/website/blog/2021/08/21/shanghai-meetup.md
+++ b/website/blog/2021/08/21/shanghai-meetup.md
@@ -1,99 +1,99 @@
---
-title: "8 月 21 日 Apache APISIX Meetup 上海站,欢迎报名参加!"
+title: August 21 Apache APISIX Meetup Shanghai, welcome to register!
keywords:
-- API 网关
+- API Gateway
- APISIX
- Apache APISIX
- Meetup
-description: 本次 Meetup 由 api7.ai https://www.apiseven.com/ 发起,并邀请爱奇艺、空中云汇等合作伙伴共同为大家呈现。Apache APISIX PMC 成员、贡献者、社区技术专家汇聚一堂,共同探讨 Apache APISIX 社区发展、行业实践等话题。
+description: This Meetup was initiated by api7.ai https://www.apiseven.com/, and invited partners such as Aiki and Air CloudHub to present it. Apache APISIX PMC members, contributors, and community technical experts gathered to discuss Apache APISIX community development, industry practices, and other topics.
tags: [Events]
---
-> 本次 Meetup 由 [api7.ai](https://www.apiseven.com/) 发起,并邀请爱奇艺、空中云汇等合作伙伴共同为大家呈现。Apache APISIX PMC 成员、贡献者、社区技术专家汇聚一堂,共同探讨 Apache APISIX 社区发展、行业实践等话题。
+> This Meetup is initiated by [api7.ai](https://www.apiseven.com/), and invited partners such as Aiki and Air CloudHub to present it. Apache APISIX PMC members, contributors, and community technical experts gathered to discuss Apache APISIX community development, industry practices, and other topics.
-<!--truncate-->
+<! --truncate-->
-#### 时间:2021 年 8 月 21 日 13:30
+#### Time: August 21, 2021, 13:30
-#### 地点:上海市黄浦区中区广场 6 楼静和岛二期
+#### Location: Jinghe Island II, 6th Floor, Central Plaza, Huangpu District, Shanghai
-#### 参加本次 Meetup,你可以
+#### By attending this Meetup, you can
-- 共同探讨 Apache APISIX 社区的前世今生
-- 听爱奇艺科学家讲述,爱奇艺是如何使用 Apache APISIX 支撑起千万级调用量的服务
-- 空中云汇是如何在使用 Apache APISIX 时兼顾用户体验、整洁架构与数据主权
-- 了解集中式身份认证的优点以及如何在 APISIX 上进行集中式身份认证
+- Discuss the past and present of the Apache APISIX community
+- Hear from Akiyo scientists about how Akiyo uses Apache APISIX to support a service with 10 million calls
+- How AirCloudHub uses Apache APISIX to balance user experience, clean architecture and data sovereignty
+- Learn about the benefits of centralized authentication and how to do it on APISIX
-如果你感兴趣的话,千万不要错过,**扫描活动海报二维码报名吧!**
+If you're interested, don't miss it, **scan the event poster for QR code to register!**
-tips:疫情防控不放松,我们将会控制现场活动规模,名额有限,报名从速!
+Tips: We will control the size of the event as the epidemic is not relaxed, so registration is limited.
-## 活动安排
+## Event Schedule
-
+The event schedule! [Apache APISIX Meetup](/img/blog_img/2021-08-21-1.jpg)
-## 议题介绍
+## Introduction to the topic
-### 基于 Apache APISIX,爱奇艺 API 网关的落地实践
+### Apache APISIX based, Aiki API gateway implementation practice
-#### 分享嘉宾
+#### Sharing Guests
-蒋文杰 / 爱奇艺科学家
+Wenjie Jiang / Scientist, Aiki
-#### 议题详情
+#### Topic Details
-API 网关已经成为微服务架构中不可或缺的一环。它既承担着服务对外的唯一门户,又需要满足许多应用的共性功能。爱奇艺作为一家在线视频公司,每天需要承载千万级的调用量,并且对数据的安全、用户请求响应时效、系统的稳定都有着极其严格的要求,因此公司需要打造一个高性能、高可用的 API 网关。本文简单介绍爱奇艺 API 网关的架构以及实现的功能,包括请求分发、条件路由、API 管理、限流熔断、安全三防、监控报警以及全链路追踪等。
+API gateway has become an indispensable part of microservice architecture. It is the only portal for services to the outside world, but also needs to meet the common functions of many applications. As an online video company, Aqiyi needs to carry tens of millions of calls every day and has extremely strict requirements for data security, user request response time, and system stability, so the company needs to build a high-performance and highly available API gateway. This article briefl [...]
-### 如何使用 Apache APISIX 进行集中式身份认证
+### How to use Apache APISIX for centralized authentication
-#### 分享嘉宾
+#### Sharing Guests
-朱欣欣 / api7.ai 工程师,Apache APISIX Committer
+Xinxin Zhu / api7.ai Engineer, Apache APISIX Committer
-#### 议题详情
+#### Topic Details
-身份认证是零信任架构中非常重要的一环。通过身份认证可以有效保护服务,避免未经授权的恶意访问,数据泄漏以及黑客攻击。APISIX 作为一个动态、实时、高性能的 API 网关,支持丰富的身份认证插件,本次分享将介绍集中式身份认证的优点和如何在 APISIX 上进行集中式身份认证。
+Authentication is a very important part of zero-trust architecture. APISIX is a dynamic, real-time, high-performance API gateway that supports a rich set of authentication plugins.
-### 数据主权与 Apache APISIX 网关落地实践
+### Data Sovereignty and Apache APISIX Gateway Landing Practice
-#### 分享嘉宾
+#### Sharing Guests
-李杨 / 空中云汇技术平台负责人
+Yang Li / Head of AirCloudHub Technology Platform
-#### 议题详情
+#### Topic Details
-数据无处不在,每时每刻都有海量数据在世界各地被处理、传输、存储。然而数据世界不是法外之地,数据的收集与处理必须遵照各国法律执行。这为企业的技术架构提出了巨大的挑战,如何兼顾用户体验、整洁架构与数据主权?API 网关在企业架构中具有特殊地位,也因此能在数据主权场景下起到特殊重要的作用。
+Data is everywhere, and massive amounts of data are being processed, transmitted, and stored all over the world every moment. However, the world of data is not a place outside the law, and the collection and processing of data must comply with the laws of each country. The API gateway has a special position in the enterprise architecture and therefore plays a special role in the data sovereignty scenario.
-### 独行者速,众行者远,Apache APISIX 感恩有你
+### The One Who Walks Alone Goes Fast, The Many Who Walk Far, Apache APISIX Thanks to You
-#### 分享嘉宾
+#### Sharing Guests
-王院生 / api7.ai 联合创始人 & CTO
+Yansheng Wang / Co-founder & CTO of api7.ai
-#### 议题详情
+#### Topic Details
-Apache APISIX 从开源第一天就以社区方式成长,短短两年时间产品多项技术指标包揽第一,迅速成为全世界最活跃 API 网关项目,并确定了专属于 Apache APISIX 的道路:统一 7 层流量处理。一个人可能走的很快,一群人才能走的更远,Apache APISIX 成长之路感恩有你。
+Apache APISIX has been growing as a community since the first day of open source. In just two years, the product has won the first place in many technical indicators and quickly become the most active API gateway project in the world, and has defined the path that belongs to Apache APISIX: unified 7-layer traffic processing. One person can go fast, but a group of people can go farther, and we are grateful to you for the growth of Apache APISIX.
-## 周边福利
+## Peripheral Benefits
-参加 Meetup,与讲师互动,有机会获得 Apache APISIX 最新周边:超大鼠标垫、精致马克杯、Apache APISIX 徽章、定制雨伞。
+Join the Meetup, interact with the instructors, and get a chance to win the latest Apache APISIX peripherals: oversized mouse pads, delicate mugs, Apache APISIX badges, and custom umbrellas.
-
+! [Apache APISIX Gift](/img/blog_img/2021-08-21-4.jpg)
-## 参与方式
+## How to participate
-### 现场报名
+### On-site registration
-扫描上方活动海报二维码即可报名!
+Scan the event poster QR code above to sign up!
-### 线上直播
+### Online Live Streaming
-如果不能到现场参加 Meetup,关注 Apache APISIX 视频号观看直播。
+If you can't make it to the Meetup, follow the Apache APISIX video to watch the live stream.
-
+Live! [Apache APISIX Live](/img/blog_img/2021-08-21-2.png)
-## 入群交流
+## Join the group to communicate
-欢迎关注 Apache APISIX 公众号,在后台回复关键字“上海”,加入 Apache APISIX 上海交流群。
+Follow the Apache APISIX public page and reply with the keyword "Shanghai" in the background to join the Apache APISIX Shanghai group.
-
+! [Apache APISIX wechat](/img/blog_img/2021-08-21-3.png)
diff --git a/website/blog/2021/08/23/ApacheCon-Asia-2021.md b/website/blog/2021/08/23/ApacheCon-Asia-2021.md
index 75086d0..3a88d9a 100644
--- a/website/blog/2021/08/23/ApacheCon-Asia-2021.md
+++ b/website/blog/2021/08/23/ApacheCon-Asia-2021.md
@@ -1,121 +1,120 @@
---
-title: "ApacheCon Asia 2021"
+title: ApacheCon Asia 2021
keywords:
- APISIX
- ApacheCon
- Apache Way
-- 孵化
-- 商业化
-description: ApacheCon 是 Apache 软件基金会的官方全球系列会议。自 1998 年以来,ApacheCon 一直吸引着各个层次的参与者,在 350 多个 Apache 项目及其不同的社区中探索 “明日的技术”。ApacheCon Asia 是 ApacheCon 组委会针对亚太地区举办的 ApacheCon 在线会议,主要目标在于更好地服务亚太地区快速增长的 Apache 用户和贡献者。ApacheCon Asia 2021 于 2021 年 8 月 6-8 日在线举办。Apache APISIX 社区积极参与本次年度开源盛会,共提报了 8 个 API/微服务技术相关的议题,内容丰富。
+- Commercial
+description: ApacheCon is the official global conference series of the Apache Software Foundation. Since 1998, ApacheCon has been attracting participants at all levels to explore the "technologies of tomorrow" across more than 350 Apache projects and their diverse communities. ApacheCon Asia 2021 was held online from August 6-8, 2021. The Apache APISIX community actively participated in this annual open source event, presenting a total of eight API/microservices technology-related topics [...]
tags: [Events]
---
-> ApacheCon 是 Apache 软件基金会的官方全球系列会议。自 1998 年以来,ApacheCon 一直吸引着各个层次的参与者,在 350 多个 Apache 项目及其不同的社区中探索 “明日的技术”。ApacheCon Asia 是 ApacheCon 组委会针对亚太地区举办的 ApacheCon 在线会议,主要目标在于更好地服务亚太地区快速增长的 Apache 用户和贡献者。ApacheCon Asia 2021 于 2021 年 8 月 6-8 日在线举办。
+> ApacheCon is the official global conference series of the Apache Software Foundation. Since 1998, ApacheCon has been attracting participants at all levels to explore the "technologies of tomorrow" in more than 350 Apache projects and their diverse communities. ApacheCon Asia is an online ApacheCon conference with the primary goal of better serving the rapidly growing number of Apache users and contributors in the Asia-Pacific region. ApacheCon Asia 2021 takes place online August 6-8, 2021.
-<!--truncate-->
+<! --truncate-->
-Apache APISIX 社区积极参与本次年度开源盛会,共提报了 8 个 API/微服务技术相关的议题,内容丰富。
+The Apache APISIX community actively participated in this annual open source event, presenting a rich set of 8 API/microservices technology-related topics.
-## 使用 Apache APISIX 实现限流限速
+## Implementing Flow Limiting with Apache APISIX
-分享者:陈军旭
+Shared by: Junxu Chen
-谈到限流限速,人们往往最先想到的是 Nginx 。然而 Nginx 通过配置文件的方式实现,每次变更都需要 reload ,这让运维工作极其繁杂。另一方面,限速的条件被限制在 Nginx 的变量范围内,使得 Nginx 难以实现业务上精细化的限流限速需求。本次分享将带来如何使用 Apache APISIX 来实现动态、精细化、分布式的限流限速,以及如何通过插件编排来实现更符合业务需求的限流限速。
+Nginx is often the first thing that comes to mind when it comes to limiting speed. However, Nginx is implemented through a configuration file, which requires reloading every time you make a change, making it extremely cumbersome to run and maintain. On the other hand, speed limiting conditions are limited to Nginx variables, making it difficult to achieve fine-grained speed limiting for business purposes. This session will show how to use Apache APISIX to achieve dynamic, fine-grained, a [...]
-[**查看分享**](/articles/Speed-Limiting-With-Apache-APISIX)
+[**View Share**](/articles/Speed-Limiting-With-Apache-APISIX)
-## 用 Chaos Mesh 测试 Apache APISIX 的恢复能力
+## Testing Apache APISIX resilience with Chaos Mesh
-分享者:吴舒旸
+Shared by: Yang Wu Shu
-Apache APISIX 是领先的 API 网关 OSS 之一。为了确保一切按计划进行,APISIX 使用了不同种类的测试,包括单元、e2e 和模糊测试。然而,我们仍然不确定,当一些不正常但不可避免的情况发生时,例如网络故障、IO 压力或 Pods 故障,APISIX 会如何表现。因此,在这里我们使用 Chaos Mesh,一个基于 Kubernetes 的混沌工程平台,可以顺利地注入不同种类的混沌,并将其整合到我们的 CI 管道中。在这个讲座的最后,听众会了解到混沌工程会在哪些方面给 API 网关带来好处,以及如何将混沌网整合到你自己的测试管道中。
+Apache APISIX is one of the leading API gateways OSS. To make sure everything is going as planned, APISIX uses different kinds of tests, including unit, e2e, and fuzzy tests. However, we are still not sure how APISIX will behave when some abnormal but unavoidable circumstances occur, such as network failure, IO stress or Pods failure. So here we use Chaos Mesh, a Kubernetes-based chaos engineering platform that can smoothly inject different kinds of chaos and integrate them into our CI p [...]
-[**查看分享**](/articles/Test-Apache-APISIX-Resilience-With-Chaos-Mesh)
+[**View Share**](/articles/Test-Apache-APISIX-Resilience-With-Chaos-Mesh)
-## 使用 Apache APISIX 进行认证和授权
+## Authentication and authorization with Apache APISIX
-分享者:朱欣欣
+Shared by: Xinxin Zhu
-认证和授权是 API 网关中非常必要的功能。这样一来,位于网关后面的服务就可以得到保护,避免未经授权或恶意的访问、数据泄露和黑客攻击。Apache APISIX 是一个动态、实时、高性能的 API 网关。而且它提供了许多插件,包括像 key-auth、Open-ID、wolf-RBAC 等认证和授权。本提案介绍了如何使用 APISIX 来进行认证和授权。
+Authentication and authorization are very essential features in API gateways. This way, services located behind the gateway are protected from unauthorized or malicious access, data leakage, and hacking. Apache APISIX is a dynamic, real-time, high-performance API gateway. And it offers a number of plug-ins, including authentication and authorization like key-auth, Open-ID, wolf-RBAC, etc. This proposal describes how to use APISIX for authentication and authorization.
-[**查看分享**](/articles/Using-Apache-APISIX-To-Do-Authentication-and-Authorization)
+[**View Share**](/articles/Using-Apache-APISIX-To-Do-Authentication-and-Authorization)
-## 依托社区让 Apache APISIX 高速发展
+## Relying on the community to get Apache APISIX up to speed
-分享者:王院生
+Shared by: Wang Yansheng
-在过去的一年里,APISIX 已经成为全世界最活跃的 API 网关项目,除了自身技术先进外,更得意于社区的高度活跃。截止目前,已经有来自世界各地 225 位贡献者参与贡献,并且还在保持高速增长。 本次分享会介绍 APISIX 在践行“社区重于代码”过程的一些心得。作为一个理想主义创业者,又是如何与 Apache 文化结合,让创业公司也能高速发展。
+In the past year, APISIX has become the most active API gateway project in the world, not only because of its advanced technology, but also because of the highly active community. As of today, there are 225 contributors from all over the world, and the number is still growing rapidly. This session will introduce APISIX's experience in practicing "community over code". As an idealistic startup, how to combine with Apache culture to make the startup grow fast.
-[**查看分享**](/articles/Relying-On-The-Community-To-Get-Apache-APISIX-Up-Speed)
+[**View Share**](/articles/Relying-On-The-Community-To-Get-Apache-APISIX-Up-Speed)
-## Apache APISIX 从开源项目到商业化之路
+## Apache APISIX from open source project to the road to commercialization
-分享者:温铭
+Shared by: Wen Ming
-温铭,api7.ai 创始人,Apache APISIX PMC 主席,Apache 基金会 member,他演讲的题目是“Apache APISIX 从开源项目到商业化之路”。
+Ming Wen, Founder of api7.ai, Chairman of Apache APISIX PMC, and member of Apache Foundation, will speak on "Apache APISIX from Open Source to Commercialization".
-[**查看分享**](/articles/Apache-APISIX-From-OpenSource-Commercialization)
+[**View Share**](/articles/Apache-APISIX-From-OpenSource-Commercialization)
-## 使用 Echarts 呈现社区活动的渲染图
+## Using Echarts to render renderings of community events
-分享者:孙毅
+Shared by: Sun Yi
-通过以下方式分析了开源资源库的情况:1.贡献者增长曲线;2.每月的贡献者活动;3.来反映开源项目的健康状况,这里我们分享一些关于如何制作这两张图的经验和一些有趣的事情。
+The open source repository was analyzed by 1. contributor growth curve; 2. monthly contributor activity; 3. to reflect the health of the open source project, here we share some experiences and some interesting things about how to make these two graphs.
-[**查看分享**](/articles/Rendering-Community-Events-Using-ECharts)
+[**View Share**](/articles/Rendering-Community-Events-Using-ECharts)
-## 按照 Apache Way 运作开源商业化公司,这行得通吗
+## Running an open source commercialization company according to the Apache Way, does it work
-分享者:温铭
+Shared by: Wen Ming
-Apache Way 是被无数开源项目证实的社区成功之道,那么对于开源商业公司而言,Apache Way 是否可行呢?它在商业社会是否行得通? 通过 2 年开源商业公司的经营,支流科技希望用公司的切身经历来回答这个问题。
+The Apache Way is a proven community success for countless open source projects, so does the Apache Way work for open source commercial companies? Does it work in the business world? Through 2 years of operating as an open source commercial company, Tributary Technologies hopes to answer this question with the company's personal experience.
-[**查看分享**](/articles/Apache-APISIX-From-OpenSource-Commercialization-by-Apache-Way)
+[**View Share**](/articles/Apache-APISIX-From-OpenSource-Commercialization-by-Apache-Way)
-## 开源的魅力
+## The appeal of open source
-分享者:琚致远
+Shared by: Ju Zhiyuan
-Apache 软件基金会顶级项目 Apache APISIX 以及子项目,在过去 30 天中共合并了 250+ PRs,贡献者趋势也十分乐观。除此之外,高质量的邮件列表、活跃的、QQ 群 与 GitHub 也吸引众多社区的关注。作为 Apache APISIX PMC,从我的视角来分享 Apache APISIX 做了哪些事情,催化出活跃的社区?
+The Apache Software Foundation's top project, Apache APISIX, and its subprojects have merged 250+ PRs in the last 30 days, and the contributor trend is very positive. In addition, the high quality mailing list, active QQ groups and GitHub are attracting a lot of community attention. As the Apache APISIX PMC, what are some of the things Apache APISIX has done to catalyze an active community from my perspective?
-[**查看分享**](/articles/The-Appeal-of-OpenSource)
+[**View Share**](/articles/The-Appeal-of-OpenSource)
-## Apache APISIX 在移动云对象存储 EOS 的应用与实践
+## Apache APISIX Application and Practice in Mobile Cloud Object Storage EOS
-分享者:陈焱山
+Shared by: Yanshan Chen
-该演讲主题主要是讲述 Apache APISIX 在中国移动公有云对象存储 EOS 中的应用与实践经验分享。首先介绍了中国移动公有云建设规划及对象存储产品发展演进历程,然后阐述了我们为什么选择 Apache APISIX 作为负载均衡网关,并对 EOS 流量治理架构演进三个阶段进行进行了详细介绍。同时,我们还分享了基于 Apache APISIX 我们解决了哪些实际生产问题,做了哪些方案及开发工作,最后对我们未来的演进做了一些规划说明。
+This talk is about the application and practice of Apache APISIX in China Mobile's public cloud object storage EOS. Firstly, we introduced China Mobile's public cloud construction plan and the evolution of object storage products, then we explained why we chose Apache APISIX as the load balancing gateway, and introduced the three phases of EOS traffic management architecture evolution in detail. At the same time, we also share what practical production problems we have solved based on Ap [...]
-[**查看分享**](/articles/Apache-APISIX-in-China-Mobile-Cloud)
+[**View Share**](/articles/Apache-APISIX-in-China-Mobile-Cloud)
-## 如何将 Apache APISIX 扩展为一个服务网格的边车
+## How to extend Apache APISIX as a service grid side car
-分享者:张超
+Shared by: Chao Zhang
-在这个主题中,我将介绍 apisix-mesh-agent 项目,它有一些能力将 Apache APISIX 扩展为服务网格场景中的边车程序,更重要的是,它使用 xDS 协议从 Istio、Kuma 等控制平面获取配置。之后,我将介绍关于在服务网中使用 Apache APISIX 的未来计划和期望。
+In this topic, I will introduce the apisix-mesh-agent project, which has some capabilities to extend Apache APISIX as a sidecar program in a service grid scenario, and more importantly, it uses the xDS protocol to get configuration from control planes like Istio, Kuma, etc. After that, I will present future plans and expectations regarding the use of Apache APISIX in service grids.
-[**查看分享**](/articles/How-To-Extend-Apache-APISIX-into-a-Service-Mesh-Sidecar)
+[**View Share**](/articles/How-To-Extend-Apache-APISIX-into-a-Service-Mesh-Sidecar)
-## Apache APISIX 的演变
+## The Evolution of Apache APISIX
-分享者:罗泽轩
+Shared by: Luo Zexuan
-在这个主题中,我将介绍一下 Apache APISIX 的发展,包括:1.我们所做的好决定;2.我们所做的不好的决定;3.我们的未来计划
+In this topic, I will introduce the evolution of Apache APISIX, including: 1. The good decisions we made; 2. The bad decisions we made; 3. Our future plans
-[**查看分享**](/articles/The-Evolution-of-Apache-APISIX)
+[**View Share**](/articles/The-Evolution-of-Apache-APISIX)
-## 基于 Apache APISIX 的 Kubernetes Ingress 的实现
+## Implementation of Kubernetes Ingress based on Apache APISIX
-分享者:金卫
+Shared by: Jin Wei
-介绍基于 Apache APISIX 的 Kubernetes Ingress 的优势以及 Apache APISIX Ingress 的特点。
+Introducing the advantages of Apache APISIX-based Kubernetes Ingress and the features of Apache APISIX Ingress.
-[**查看分享**](/articles/Apache-APISIX-Kubernetes-Ingress)
+[**View Share**](/articles/Apache-APISIX-Kubernetes-Ingress)
-## Apache APISIX 的孵化器之旅
+## Apache APISIX's Incubator Tour
-分享者:温铭
+Shared by: Wen Ming
-Apache APISIX 的孵化器之旅
+The Incubator Journey of Apache APISIX
-[**查看分享**](/articles/Apache-APISIX-Incubator-Journey)
+[**View Share**](/articles/Apache-APISIX-Incubator-Journey)
diff --git a/website/blog/2021/08/24/shanghai-meetup-recap.md b/website/blog/2021/08/24/shanghai-meetup-recap.md
index e1620a4..0e90272 100644
--- a/website/blog/2021/08/24/shanghai-meetup-recap.md
+++ b/website/blog/2021/08/24/shanghai-meetup-recap.md
@@ -1,62 +1,60 @@
---
-title: "Apache APISIX Meetup 上海站全程回顾"
-author: "Apache APISIX 社区"
+title: Apache APISIX Meetup in Shanghai
+author: Apache APISIX
keywords:
-- API 网关
+- API Gateway
- APISIX
- Meetup
-- 上海站
-- 回顾
-description: 活动回顾:Apache APISIX Meetup 上海站议题分享及视频回顾。
+description: "Event Review: Apache APISIX Meetup Shanghai Topic Sharing and Video Review."
tags: [Events]
---
-> 活动回顾:Apache APISIX Meetup 上海站议题分享及视频回顾。
+> Event review: Apache APISIX Meetup Shanghai topic sharing and video review.
-<!--truncate-->
+<! --truncate-->
-Apache APISIX Meetup 上海站已于上周六(8 月 21 日)顺利举办🎉🎉🎉
+Apache APISIX Meetup Shanghai was successfully held last Saturday (August 21) 🎉🎉🎉🎉
-本次 Meetup 由 [API7.AI](https://www.apiseven.com/zh) 发起,邀请了爱奇艺、AirWallex 空中云汇等合作伙伴,与 Apache APISIX 技术大咖、Apache APISIX PMC 成员、社区技术专家汇聚一堂,共同探讨了关于 Apache APISIX 社区发展、行业实践等话题。
+The Meetup was initiated by [API7.AI](https://www.apiseven.com/zh), and invited partners such as Akiyon, AirWallex, and other partners to come together with Apache APISIX technical experts, Apache APISIX PMC members, and community technical experts to discuss about The conference was a great opportunity to discuss Apache APISIX community development, industry practices and other topics.
-一起来回顾下大会中令人难忘的精彩演讲吧!
+Let's take a look back at some of the most memorable talks from the conference!
-## 基于 Apache APISIX,爱奇艺 API 网关的落地实践
+## Apache APISIX-based Aiki API Gateway Implementation Practice
-**讲师**:何聪
+**Instructor**: He Cong
-**个人介绍**:高级研发工程师,IIG 基础架构部-计算云,主要负责爱奇艺网关开发和运维工作。
+**Personal Introduction**: Senior R&D Engineer, IIG Infrastructure Department - Compute Cloud, mainly responsible for Aikii Gateway development and operation and maintenance.
-**议题详情**:API 网关已经成为微服务架构中不可或缺的一环。它既承担着服务对外的唯一门户,又需要满足许多应用的共性功能。爱奇艺作为一家在线视频公司,每天需要承载千万级的调用量,并且对数据的安全、用户请求响应时效、系统的稳定都有着极其严格的要求,因此公司需要打造一个高性能、高可用的 API 网关。本次分享简单介绍爱奇艺 API 网关的架构以及实现的功能,包括请求分发、条件路由、Api 管理、限流熔断、安全三防、监控报警以及全链路追踪等。
+**Detail of Topic**: API gateway has become an indispensable part of the microservice architecture. It bears the sole gateway for services to the outside world, but also needs to meet the common functions of many applications. As an online video company, Aikiy has to carry tens of millions of calls every day, and has extremely strict requirements for data security, user request response time, and system stability, so the company needs to build a high-performance, highly available API gat [...]
-**视频回顾**:[爱奇艺基于 Apache APISIX 的 API 网关落地实践](https://www.bilibili.com/video/BV1Qq4y1M7bK)
+**Video Review**: [Akiyoshi's Apache APISIX-based API Gateway Implementation Practice](https://www.bilibili.com/video/BV1Qq4y1M7bK)
-## 如何使用 Apache APISIX 进行集中式身份认证
+## How to use Apache APISIX for centralized authentication
-**讲师**:朱欣欣
+**Instructor**: Xinxin Zhu
-**个人介绍**:API7 工程师,Apache APISIX Committer
+**Personal Introduction**: API7 Engineer, Apache APISIX Committer
-**议题详情**:身份认证是零信任架构中非常重要的一环。通过身份认证可以有效保护服务,避免未经授权的恶意访问,数据泄漏以及黑客攻击。APISIX 作为一个动态、实时、高性能的 API 网关,支持丰富的身份认证插件,本次分享将介绍集中式身份认证的优点和如何在 APISIX 上进行集中式身份认证。
+**Detail of Topic**: Authentication is a very important part of zero-trust architecture. Authentication can effectively protect services from unauthorized malicious access, data leakage, and hacker attacks. APISIX, as a dynamic, real-time, high-performance API gateway, supports rich authentication plugins, and this sharing will introduce the benefits of centralized authentication and how to perform centralized authentication on APISIX.
-**视频回顾**:[使用 API 网关 APISIX 来进行集中式身份认证](https://www.bilibili.com/video/BV1WA411c7pa)
+**Video Review**: [Using API Gateway APISIX for Centralized Authentication](https://www.bilibili.com/video/BV1WA411c7pa)
-## 数据主权与 Apache APISIX 网关落地实践
+## Data Sovereignty and Apache APISIX Gateway Landing Practices
-**讲师**:李杨
+**Instructor**: Yang Li
-**个人介绍**:AirWallex 空中云汇技术平台负责人
+**Personal Introduction**: Head of AirWallex AirCloudHub Technology Platform
-**议题详情**:数据无处不在,每时每刻都有海量数据在世界各地被处理、传输、存储。然而数据世界不是法外之地,数据的收集与处理必须遵照各国法律执行。这为企业的技术架构提出了巨大的挑战,如何兼顾用户体验、整洁架构与数据主权?API 网关在企业架构中具有特殊地位,也因此能在数据主权场景下起到特殊重要的作用。
+**Detail of Topic**: Data is everywhere, and massive amounts of data are processed, transmitted, and stored all over the world every moment. However, the world of data is not a place outside the law, the collection and processing of data must comply with the laws of each country. The API gateway has a special position in the enterprise architecture and therefore plays a special role in the data sovereignty scenario.
-**视频回顾**:[Apache APISIX 与数据主权的落地实践](https://www.bilibili.com/video/BV1GL4y1Y7sR)
+**Video Review**: [Apache APISIX and Data Sovereignty in Practice](https://www.bilibili.com/video/BV1GL4y1Y7sR)
-## 独行者速,众行者远,Apache APISIX 感恩有你
+## The one who travels alone travels fast, the one who travels with many travels far, Apache APISIX is grateful to have you
-**讲师**:王院生
+**Instructor**: Wang Yansheng
-**个人介绍**:API7.AI 联合创始人 & CTO
+**Personal Introduction**: Co-founder & CTO of API7.AI
-**议题详情**:Apache APISIX 从开源第一天就以社区方式成长,短短两年时间产品多项技术指标包揽第一,迅速成为全世界最活跃 API 网关项目,并确定了专属于 Apache APISIX 的道路:统一 7 层流量处理。一个人可能走的很快,一群人才能走的更远,Apache APISIX 成长之路感恩有你。
+**Details**: Apache APISIX has been growing as a community since the first day of open source, and has quickly become the most active API gateway project in the world by winning the first place in many technical indicators in just two years, and defining the path that belongs exclusively to Apache APISIX: unified 7-layer traffic processing. One person may go fast, a group of people can go farther, Apache APISIX growth road thanks to you.
-**视频回顾**:[独行者速,众行者远,Apache APISIX 感恩有你](https://www.bilibili.com/video/BV1Hh411q7eB)
+**Video Review**: [The One Who Walks Alone Goes Fast, The Many Who Walk Far, Apache APISIX Thanks to You](https://www.bilibili.com/video/BV1Hh411q7eB)
diff --git a/website/blog/2021/08/25/Using-the-Apache-APISIX-OpenID-Connect-Plugin-for-Centralized-Authentication.md b/website/blog/2021/08/25/Using-the-Apache-APISIX-OpenID-Connect-Plugin-for-Centralized-Authentication.md
index 61f1b20..6f58f04 100644
--- a/website/blog/2021/08/25/Using-the-Apache-APISIX-OpenID-Connect-Plugin-for-Centralized-Authentication.md
+++ b/website/blog/2021/08/25/Using-the-Apache-APISIX-OpenID-Connect-Plugin-for-Centralized-Authentication.md
@@ -1,207 +1,207 @@
---
-title: "使用 Apache APISIX 的 OpenID Connect 插件进行集中身份认证"
-author: "朱欣欣"
+title: Centralized authentication using the OpenID Connect plug-in for Apache APISIX
+author: Xinxin Zhu
authorURL: "https://github.com/starsz"
authorImageURL: "https://avatars.githubusercontent.com/u/25628854?v=4"
keywords:
-- API 网关
+- API Gateway
- APISIX
- Apache APISIX
- Okta
-- 集中认证
-description: 本文展示了使用 Apache APISIX OpenID Connect Plugin 进行 Okta 集中认证的过程。 本文包含了对 Apache APISIX 和 Okta 集中认证的概念介绍,展示了在 Apache APISIX 中直接建立来自 Okta 的集中式身份认证的过程。这种集中认证的方法减少了开发者的学习和维护成本,提供了安全和精简的用户体验。
+- Authorization
+description: This article demonstrates the process of centralized Okta authentication using the Apache APISIX OpenID Connect Plugin. This article contains a conceptual introduction to Apache APISIX and Okta centralized authentication, showing the process of establishing centralized authentication from Okta directly in Apache APISIX. This centralized authentication approach reduces learning and maintenance costs for developers and provides a secure and streamlined user experience.
tags: [Practical Case]
---
-> 相比较传统认证模式,集中认证模式下有如下优点:第一,简化应用开发流程,降低开发应用工作量和维护成本,避免各个应用重复开发身份认证代码;第二,提高业务的安全性,集中身份认证模式在网关层面能够及时拦截未经身份认证的请求,保护后端的应用。
+> Compared with the traditional authentication mode, the centralized authentication mode has the following advantages: first, it simplifies the application development process, reduces the development application workload and maintenance costs, and avoids repeated development of authentication code for each application; second, it improves business security, and the centralized authentication mode can intercept unauthenticated requests at the gateway level in time to protect back-end app [...]
-<!--truncate-->
+<! --truncate -->
-## 什么是 Apache APISIX
+## What is Apache APISIX
-[Apache APISIX](https://apisix.apache.org/) 是一个动态、实时、高性能的 API 网关,提供负载均衡、动态上游、灰度发布、服务熔断、身份认证、可观测性等丰富的流量管理功能。Apache APISIX 不仅支持插件动态变更和热插拔,而且拥有众多实用的插件。Apache APISIX 的 OpenID Connect 插件支持 OpenID,用户可以使用该插件将身份认证从传统认证模式替换为集中认证模式。
+[Apache APISIX](https://apisix.apache.org/) is a dynamic, real-time, high-performance API gateway that provides rich traffic management features such as load balancing, dynamic upstream, grayscale publishing, service meltdown, authentication, observability, and more. Apache APISIX's OpenID Connect plug-in supports OpenID, which allows users to replace authentication from traditional authentication mode to centralized authentication mode.
-## 什么是身份认证
+## What is authentication
-身份认证是指通过一定的手段,对用户的身份进行验证。应用通过身份认证识别用户身份,并根据用户身份 ID 从身份提供方(Identity Provider)获取详细的用户元数据,并以此判断用户是否拥有访问指定资源的权限。身份认证模式分为两大类:**传统认证模式**和**集中认证模式**。
+Authentication refers to the verification of a user's identity through certain means. The application identifies the user through authentication and obtains detailed user metadata from the Identity Provider based on the user identity ID, and uses it to determine whether the user has access to the specified resources. Authentication modes are divided into two categories: **Traditional Authentication Mode** and **Centralized Authentication Mode**.
-### 传统认证模式
+### Traditional authentication mode
-在传统认证模式下,各个应用服务需要单独支持身份认证,例如当用户未登录时访问登录接口,接口返回 301 跳转页面。应用需要开发维护 Session 以及和身份提供商的认证交互等逻辑。传统认证模式的流程如下图所示:首先由用户发起请求(request),然后由网关接收请求并将其转发至对应的应用服务,最后由应用服务与身份提供方对接,完成身份认证(authorization)。
+In traditional authentication mode, each application service needs to support authentication separately, such as accessing the login interface when the user is not logged in, and the interface returns a 301 jump page. The application needs to develop the logic for maintaining the Session and the authentication interaction with the identity provider. The flow of the traditional authentication model is shown in the figure below: first, the user initiates a request, then the gateway receive [...]
-
+! [Flowchart of traditional authentication mode](/img/blog_img/2021-08-16-1.png)
-### 集中认证模式
+### Centralized authentication mode
-与传统认证模式不同,集中身份认证模式把用户认证从应用服务中抽离了出来,以 Apache APISIX 为例,集中认证的流程如下图所示:首先由用户发起请求(request),然后由前置的网关负责用户认证流程,与身份提供方对接,向身份提供方发送身份认证(authorization)请求。身份提供方返回用户身份信息(user info)。网关完成用户身份识别后,将用户身份信息通过请求头的形式转发至后端应用。
+Unlike the traditional authentication model, the centralized authentication model takes user authentication out of the application service. Take Apache APISIX as an example, the centralized authentication process is shown in the following diagram: first, the user initiates a request, and then the front gateway is responsible for the user authentication process, interfacing with the identity provider and sending the identity provider an authorization) request to the identity provider. The [...]
-
+! [Flow chart of centralized authentication mode](/img/blog_img/2021-08-16-2.png)
-相比较传统认证模式,集中认证模式下有如下优点:
+Compared with the traditional authentication mode, the centralized authentication mode has the following advantages.
-1. 简化应用开发流程,降低开发应用工作量和维护成本,避免各个应用重复开发身份认证代码。
-2. 提高业务的安全性,集中身份认证模式在网关层面能够及时拦截未经身份认证的请求,保护后端的应用。
+1. simplify the application development process, reduce the development of application workload and maintenance costs, to avoid the repeated development of each application authentication code.
+2. improve business security, centralized authentication mode at the gateway level to intercept unauthenticated requests in time to protect the back-end applications.
-## 什么是 OpenID
+## What is OpenID
-OpenID 是一种集中认证模式,它是一个去中心化的身份认证系统。使用 OpenID 的好处是,用户只需要在一个 OpenID 身份提供方的网站上注册和登录,使用一份账户密码信息即可访问不同应用。Okta 是一个常见的 OpenID 身份提供方,Apache APISIX OpenID Connect 插件支持 OpenID,所以用户可以使用该插件将传统认证模式替换为集中认证模式。
+OpenID is a centralized authentication model, which is a decentralized identity system. The benefit of using OpenID is that users only need to register and log in with one OpenID identity provider's website and use one account password information to access different applications. okta is a common OpenID identity provider and the Apache APISIX OpenID Connect plugin supports OpenID so users can use the plugin to to replace the traditional authentication model with a centralized authentica [...]
-### OpenID 认证过程
+### OpenID Authentication Process
-OpenID 认证过程有以下 7 个步骤,如下图所示。
+The OpenID authentication process has the following 7 steps, as shown in the figure below. 1.
-1. APISIX 向 Identity Provider 发起认证请求。
-2. 用户在 Identity Provider 上登录并认证身份。
-3. Identity Provider 携带 Authorization Code 返回 APISIX。
-4. APISIX 使用从请求参数中提取到的 Code 请求 Identity Provider。
-5. Identity Provider 向 APISIX 发送应答消息,里面包含了 ID Token 和 Access Token。
-6. APISIX 将 Access Token 发送到 Identity Provider 的 User Endpoint,以进行获取用户身份。
-7. 通过认证后,User Endpoint 将 User info 发送到 APISIX,完成身份验证。
+1. APISIX initiates an authentication request to Identity Provider. 2.
+2. The user logs in and authenticates on the Identity Provider. 3.
+3. The Identity Provider returns to APISIX with the Authorization Code. 4.
+4. APISIX requests the Identity Provider with the Code extracted from the request parameters. 5.
+5. The Identity Provider sends an answer message to APISIX containing the ID Token and Access Token. 6.
+6. APISIX sends the Access Token to the Identity Provider's User Endpoint to obtain the user's identity.
+7. After authentication, the User Endpoint sends the User info to APISIX to complete the authentication.
-
+! [OpenID Authentication Flowchart](/img/blog_img/2021-08-16-3.png)
-## 如何使用 Apache APISIX 的 OpenID Connect 插件配置 Okta 认证
+## How to configure Okta authentication using the OpenID Connect plugin for Apache APISIX
-使用 Apache APISIX OpenID Connect 插件配置 Okta 认证的过程非常简单,只需三步即可完成 Okta 配置 ,从传统身份认证模式切换到集中身份认证模式。下文讲述了使用 Apache APISIX 的 OpenID Connect 插件配置 Okta 认证的操作步骤。
+Configuring Okta authentication using the Apache APISIX OpenID Connect plug-in is a simple three-step process that allows you to switch from traditional to centralized authentication mode. The following section describes the steps to configure Okta authentication using the OpenID Connect plug-in for Apache APISIX.
-### 前提条件
+### Prerequisites
-已有 Okta 账号。
+An Okta account already exists.
-### 步骤一:配置 Okta
+### Step 1: Configure Okta
-1. 登录你的 Okta 账号,并创建一个 Okta 应用,选择 OIDC 登录模式以及 Web Application 应用类型。
- 
- 
-2. 设置登录和登出的跳转 URL。
-其中 “Sign-in redirect URIs” 为登录成功允许跳转的链接地址,“Sign-out redirect URIs” 表示登出之后跳转的链接地址。在这个示例中,我们将登录成功跳转和登出之后跳转的链接地址都设置为 `http://127.0.0.1:9080/`。
- 
-3. 完成设置以后,单击“Save”保存修改。
- 
-4. 访问应用的 General 页面,获取以下配置,配置 Apache APISIX OpenID Connect 时需要提供这些信息:
+Login to your Okta account and create an Okta application, select the OIDC login mode and the Web Application application type.
+ ! [Create an Okta application](/img/blog_img/2021-08-16-4.png)
+ ! [Select OIDC login mode and Web Application application type](/img/blog_img/2021-08-16-5.png) 2.
+Set the login and logout jump URLs.
+The "Sign-in redirect URIs" are the links that are allowed to be redirected after successful login, and the "Sign-out redirect URIs" are the links that are redirected after logging out. In this example, we set both the sign-in redirect and sign-out redirect URLs to `http://127.0.0.1:9080/`.
+ ! [Set the login and logout URL](/img/blog_img/2021-08-16-6.png)
+3. Click "Save" to save the changes after finishing the settings.
+ ! [Save Changes](/img/blog_img/2021-08-16-7.png)
+Visit the General page of the application to get the following configuration, which is required to configure Apache APISIX OpenID Connect.
-- Client ID:OAuth client ID,即应用的 ID,与下文的 `client_id` 和 `{YOUR_CLIENT_ID}` 对应。
-- Client secret:OAuth client secret,即应用密钥,与下文的 `client_secret` 和 `{YOUR_CLIENT_SECRET}` 对应。
-- Okta domain:应用使用的域名,与下文的 discovery 中的 `{YOUR_ISSUER}` 对应。
+- Client ID: OAuth client ID, which is the ID of the application, corresponding to `client_id` and `{YOUR_CLIENT_ID}` below.
+- Client secret: OAuth client secret, i.e. application key, corresponds to `client_secret` and `{YOUR_CLIENT_SECRET}` below.
+- Okta domain: The domain name used by the application, corresponds to `{YOUR_ISSUER}` in discovery below.
-
+! [Get configuration info](/img/blog_img/2021-08-16-8.png)
-### 安装 Apache APISIX
+### Installing Apache APISIX
-你可以通过源码包、Docker、Helm Chart 等多种方式来安装 Apache APISIX。
+You can install Apache APISIX in a variety of ways such as through source packages, Docker, Helm Chart, etc.
-#### 安装依赖
+#### Installing dependencies
-Apache APISIX 的运行环境需要依赖 NGINX 和 etcd,所以在安装 Apache APISIX 前,请根据您使用的操作系统安装对应的依赖。我们提供了 CentOS7、Fedora 31 & 32 、Ubuntu 16.04 & 18.04、 Debian 9 & 10 和 MacOS 上的依赖安装操作步骤,详情请参考[安装依赖](https://apisix.apache.org/zh/docs/apisix/install-dependencies/)。
+The Apache APISIX runtime environment requires dependencies on NGINX and etcd, so before installing Apache APISIX, please install the corresponding dependencies according to the operating system you are using. We have provided steps for installing dependencies on CentOS7, Fedora 31 & 32, Ubuntu 16.04 & 18.04, Debian 9 & 10 and MacOS, please refer to [Installing dependencies](https://apisix.apache.org/zh/docs/apisix/install) for details. -dependencies/).
-通过 Docker 或 Helm Chart 安装 Apache APISIX 时,已经包含了所需的 NGINX 和 etcd,请参照各自对应的文档。
+When installing Apache APISIX via Docker or Helm Chart, the required NGINX and etcd are already included, please refer to the respective documentation.
-#### 通过 RPM 包安装(CentOS 7)
+#### Installation via RPM package (CentOS 7)
-这种安装方式适用于 CentOS 7 操作系统,请运行以下命令安装 Apache APISIX。
+This installation method is available for CentOS 7 operating system, please run the following command to install Apache APISIX.
```shell
sudo yum install -y https://github.com/apache/apisix/releases/download/2.7/apisix-2.7-0.x86_64.rpm
```
-#### 通过 Docker 安装
+#### Installation via Docker
-详情请参考:[使用 Docker 安装 Apache APISIX](https://hub.docker.com/r/apache/apisix)。
+For details, please refer to: [Installing Apache APISIX with Docker](https://hub.docker.com/r/apache/apisix).
-#### 通过 Helm Chart 安装
+#### Installation via Helm Chart
-详情请参考:[使用 Helm Chart 安装 Apache APISIX](https://github.com/apache/apisix-helm-chart)。
+For details, please refer to: [Installing Apache APISIX with Helm Chart](https://github.com/apache/apisix-helm-chart).
-#### 通过源码包安装
+#### Installation via source package
-1. 创建一个名为 `apisix-2.7` 的目录:
+1. Create a directory named ``apisix-2.7``.
```shell
mkdir apisix-2.7
```
-2. 下载 Apache APISIX Release 源码包:
+2. Download the Apache APISIX Release source package.
```shell
wget https://downloads.apache.org/apisix/2.7/apache-apisix-2.7-src.tgz
```
- 您也可以通过 Apache APISIX 官网下载 Apache APISIX Release 源码包。 Apache APISIX 官网也提供了 Apache APISIX、APISIX Dashboard 和 APISIX Ingress Controller 的源码包,详情请参考 [Apache APISIX 官网-下载页](https://apisix.apache.org/zh/downloads)。
+ You can also download the Apache APISIX Release source package from the Apache APISIX official website. The Apache APISIX official website also provides source packages for Apache APISIX, APISIX Dashboard, and APISIX Ingress Controller, see [Apache APISIX official website - download page](https://apisix.apache.org/zh/ For details, please refer to the [Apache APISIX official-downloads page](https://apisix.apache.org/downloads).
-3. 解压 Apache APISIX Release 源码包:
+3. Unpack the Apache APISIX Release source package.
```shell
tar zxvf apache-apisix-2.7-src.tgz -C apisix-2.7
```
-4. 安装运行时依赖的 Lua 库:
+4. install the runtime dependencies of the Lua library:
```shell
- # 切换到 apisix-2.7 目录
+ # Switch to the apisix-2.7 directory
cd apisix-2.7
- # 创建依赖
+ # Create dependencies
make deps
```
-#### 初始化依赖
+#### Initializing dependencies
-运行以下命令初始化 NGINX 配置文件和 etcd。
+Run the following command to initialize the NGINX configuration file and etcd.
```shell
# initialize NGINX config file and etcd
make init
```
-### 启动 Apache APISIX 并配置对应的路由
+### Start Apache APISIX and configure the corresponding routes
-1. 运行以下命令,启动 Apache APISIX。
+1. Run the following command to start Apache APISIX. 2.
-2. 创建路由并配置 OpenID Connect 插件。
+2. Create routes and configure the OpenID Connect plug-in.
-OpenID Connect 配置列表如下:
+The OpenID Connect configuration list is as follows.
-|字段|默认值|描述|
+|fields|default|description|
| :------| :------------ | :------- |
-|client_id|""|OAuth 客户端 ID|
-|client_secret|""|OAuth 客户端密钥|
-|discovery|""|身份提供商的服务发现端点|
-|scope|openid|需要访问资源范围|
-|relm|apisix|指定 WWW-Authenticate 响应头验证信息|
-|bearer_only|false|是否检查请求头中的 token|
-|logout_path|/logout|登出的 URI|
-|redirect_uri|request_uri|身份提供商跳转回来的 URI,默认为请求地址|
-|timeout|3|请求超时时间,单位为秒|
-|ssl_verify|false|是否身份提供商的校验 ssl 证书|
-|introspection_endpoint|""|身份提供商的令牌验证端点的 URL,不填则将从 discovery 响应中提取|
-|introspection_endpoint_auth_method|client_secret_basic|令牌自省的认证方法名称|
-|public_key|""|验证令牌的公钥|
-|token_signing_alg_values_expected|""|验证令牌的算法|
-|set_access_token_header|true|是否在请求头中携带 access token|
-|access_token_in_authorization_header|false|true 时将 access token 放置在 Authorization 头中,false 时将 access token 放置在 X-Access-Token 头中|
-|set_id_token_header|true|是否将 ID token 携带至 X-ID-Token 请求头|
-|set_userinfo_header|true|是否将用户信息携带至 X-Userinfo 请求头|
-
-以下代码示例通过 Apache APISIX Admin API 进行创建路由,设置路由的上游为 httpbin.org。httpbin.org 是一个简单的用于接收请求和响应请求的后端服务,下文将使用 httpbin.org 的 get 页面,参考 [http bin get](http://httpbin.org/#/HTTP_Methods/get_get)。
-
-具体配置项请参考 [Apache APISIX OpenID Connect Plugin](https://apisix.apache.org/zh/docs/apisix/plugins/openid-connect/)。
+|client_id|""|OAuth client ID|
+|client_secret|""|OAuth client key|
+|discovery|""|the identity provider's service discovery endpoint|
+|scope|openid|scope of resources to be accessed|
+|relm|apisix|specifies the WWW-Authenticate response header authentication information|
+|bearer_only|false|whether to check the token in the request header|
+|logout_path|/logout|logout URI|
+|redirect_uri|request_uri|The URI that the identity provider jumped back to, defaulting to the request address|
+|timeout|3|The request timeout in seconds|
+|ssl_verify|false|whether the identity provider verifies the ssl certificate|
+|introspection_endpoint|""|the URL of the identity provider's token verification endpoint, which will be extracted from the discovery response if not filled|
+|introspection_endpoint_auth_method|client_secret_basic|the name of the token's default authentication method|
+|public_key|""|public key of the authentication token|
+|token_signing_alg_values_expected|""|the algorithm for authenticating tokens|
+|set_access_token_header|true|whether to carry the access token in the request header|
+|access_token_in_authorization_header|false|Place the access token in the Authorization header if true, or in the X-Access-Token header if false|
+|set_id_token_header|true|whether to carry the ID token in the X-ID-Token request header|
+|set_userinfo_header|true|whether to carry user information in the X-Userinfo request header|
+
+The following code example creates a route through the Apache APISIX Admin API, setting the route upstream to httpbin.org. httpbin.org is a simple backend service for receiving and responding to requests, and the get page of httpbin.org is used below, see [http bin get]( http://httpbin.org/#/HTTP_Methods/get_get).
+
+Please refer to [Apache APISIX OpenID Connect Plugin](https://apisix.apache.org/zh/docs/apisix/plugins/openid-connect/) for specific configuration items.
```shell
-curl -XPOST 127.0.0.1:9080/apisix/admin/routes -H "X-Api-Key: edd1c9f034335f136f87ad84b625c8f1" -d '{
+curl -XPOST 127.0.0.1:9080/apisix/admin/routes -H "X-Api-Key: edd1c9f034335f136f87ad84b625c8f1" -d '{
"uri":"/*",
"plugins":{
"openid-connect":{
"client_id":"{YOUR_CLIENT_ID}",
"client_secret":"{YOUR_CLIENT_SECRET}",
- "discovery":"https://{YOUR_ISSUER}/.well-known/openid-configuration",
- "scope":"openid profile",
+ "discovery": "https://{YOUR_ISSUER}/.well known/openid-configuration",
+ "scope": "openid profile",
"bearer_only":false,
- "realm":"master",
- "introspection_endpoint_auth_method":"client_secret_post",
- "redirect_uri":"http://127.0.0.1:9080/"
+ "realm": "master",
+ "introspection_endpoint_auth_method": "client_secret_post",
+ "redirect_uri": "http://127.0.0.1:9080/"
}
},
"upstream":{
- "type":"roundrobin",
+ "type": "roundrobin",
"nodes":{
"httpbin.org:80":1
}
@@ -209,50 +209,50 @@ curl -XPOST 127.0.0.1:9080/apisix/admin/routes -H "X-Api-Key: edd1c9f034335f136
}'
```
-### 步骤四:访问 Apache APISIX
+### Step 4: Accessing Apache APISIX
-1. 访问 http://127.0.0.1:9080/get ,因为开启了 OpenID Connect 插件,所以页面被重定向到 Okta 登录页面。
+1. Visit http://127.0.0.1:9080/get and the page is redirected to the Okta login page because the OpenID Connect plugin is turned on.
-
+! [visit Okta login page](/img/blog_img/2021-08-16-9.png)
-2. 输入用户在 Okta 注册的账号密码,单击“Sign in”,登录 Okta 账户。
+2. Enter the password you registered with Okta and click "Sign in" to log in to your Okta account. 3.
-3. 登录成功之后,能成功访问到 httpbin.org 中的 get 页面。该 httpbin.org/get 页面将返回请求的数据如下:
+3. After successful login, you can successfully access the get page in httpbin.org. The httpbin.org/get page will return the requested data as follows.
```sh
- "X-Access-Token": "******Y0RPcXRtc0FtWWVuX2JQaFo1ZVBvSlBNdlFHejN1dXY5elV3IiwiYWxnIjoiUlMyNTYifQ.***TVER3QUlPbWZYSVRzWHRxRWh2QUtQMWRzVDVGZHZnZzAiLCJpc3MiOiJodHRwczovL3FxdGVzdG1hbi5va3RhLmNvbSIsImF1ZCI6Imh0dHBzOi8vcXF0ZXN0bWFuLm9rdGEuY29tIiwic3ViIjoiMjgzMDE4Nzk5QHFxLmNvbSIsImlhdCI6MTYyODEyNjIyNSwiZXhwIjoxNjI4MTI5ODI1LCJjaWQiOiIwb2ExMWc4ZDg3TzBGQ0dYZzY5NiIsInVpZCI6IjAwdWEwNWVjZEZmV0tMS3VvNjk1Iiwic2NwIjpbIm9wZW5pZCIsInByb2Zpb***.****iBshIcJhy8QNvzAFD0fV4gh7OAdTXFMu5k0hk0JeIU6Tfg_Mh-josfap3 [...]
- "X-Id-Token": "******aTdDRDJnczF5RnlXMUtPZUtuSUpQdyIsImFtciI6WyJwd2QiXSwic3ViIjoiMDB1YTA1ZWNkRmZXS0xLdW82OTUiLCJpc3MiOiJodHRwczpcL1wvcXF0ZXN0bWFuLm9rdGEuY29tIiwiYXVkIjoiMG9hMTFnOGQ4N08wRkNHWGc2OTYiLCJuYW1lIjoiUGV0ZXIgWmh1IiwianRpIjoiSUQuNGdvZWo4OGUyX2RuWUI1VmFMeUt2djNTdVJTQWhGNS0tM2l3Z0p5TTcxTSIsInZlciI6MSwicHJlZmVycmVkX3VzZXJuYW1lIjoiMjgzMDE4Nzk5QHFxLmNvbSIsImV4cCI6MTYyODEyOTgyNSwiaWRwIjoiMDBvYTA1OTFndHAzMDhFbm02OTUiLCJub25jZSI6ImY3MjhkZDMxMWRjNGY3MTI4YzlmNjViOGYzYjJkMDgyIiwiaWF0IjoxN [...]
- "X-Userinfo": "*****lfbmFtZSI6IlpodSIsImxvY2FsZSI6ImVuLVVTIiwicHJlZmVycmVkX3VzZXJuYW1lIjoiMjgzMDE4Nzk5QHFxLmNvbSIsInVwZGF0ZWRfYXQiOjE2MjgwNzA1ODEsInpvbmVpbmZvIjoiQW1lcmljYVwvTG9zX0FuZ2VsZXMiLCJzdWIiOiIwMHVhMDVlY2RGZldLTEt1bzY5NSIsImdpdmVuX25hbWUiOiJQZXRlciIsIm5hbWUiOiJQZXRl****"
+ "X-Access-Token": "******Y0RPcXRtc0FtWWVuX2JQaFo1ZVBvSlBNdlFHejN1dXY5elV3IiwiYWxnIjoiUlMyNTYifQ.*** TVER3QUlPbWZYSVRzWHRxRWh2QUtQMWRzVDVGZHZnZzAiLCJpc3MiOiJodHRwczovL3FxdGVzdG1hbi5va3RhLmNvbSIsImF1ZCI6Imh0dHBzOi8vcXF0ZXN0bWFuLm9rdGEuY29tIiwic3ViIjoiMjgzMDE4Nzk5QHFxLmNvbSIsImlhdCI6MTYyODEyNjIyNSwiZXhwIjoxNjI4MTI5ODI1LCJjaWQiOiIwb2ExMWc4ZDg3TzBGQ0dYZzY5NiIsInVpZCI6IjAwdWEwNWVjZEZmV0tMS3VvNjk1Iiwic2NwIjpbIm9wZW5pZCIsInByb2Zpb ***. ****iBshIcJhy8QNvzAFD0fV4gh7OAdTXFMu5k0hk0JeIU6Tfg_Mh-josf [...]
+ "X-Id-Token": "****** aTdDRDJnczF5RnlXMUtPZUtuSUpQdyIsImFtciI6WyJwd2QiXSwic3ViIjoiMDB1YTA1ZWNkRmZXS0xLdW82OTUiLCJpc3MiOiJodHRwczpcL1wvcXF0ZXN0bWFuLm9rdGEuY29tIiwiYXVkIjoiMG9hMTFnOGQ4N08wRkNHWGc2OTYiLCJuYW1lIjoiUGV0ZXIgWmh1IiwianRpIjoiSUQuNGdvZWo4OGUyX2RuWUI1VmFMeUt2djNTdVJTQWhGNS0tM2l3Z0p5TTcxTSIsInZlciI6MSwicHJlZmVycmVkX3VzZXJuYW1lIjoiMjgzMDE4Nzk5QHFxLmNvbSIsImV4cCI6MTYyODEyOTgyNSwiaWRwIjoiMDBvYTA1OTFndHAzMDhFbm02OTUiLCJub25jZSI6ImY3MjhkZDMxMWRjNGY3MTI4YzlmNjViOGYzYjJkMDgyIiwiaWF0Ijox [...]
+ "X-Userinfo": "***** lfbmFtZSI6IlpodSIsImxvY2FsZSI6ImVuLVVTIiwicHJlZmVycmVkX3VzZXJuYW1lIjoiMjgzMDE4Nzk5QHFxLmNvbSIsInVwZGF0ZWRfYXQiOjE2MjgwNzA1ODEsInpvbmVpbmZvIjoiQW1lcmljYVwvTG9zX0FuZ2VsZXMiLCJzdWIiOiIwMHVhMDVlY2RGZldLTEt1bzY5NSIsImdpdmVuX25hbWUiOiJQZXRlciIsIm5hbWUiOiJQZXRl ****"
```
-其中:
+where.
-**X-Access-Token**:Apache APISIX 将从用户提供商获取到的 access token 放入 X-Access-Token 请求头,可以通过插件配置中的 access_token_in_authorization_header 来选择是否放入 Authorization 请求头中。
+**X-Access-Token**: Apache APISIX puts the access token obtained from the user provider into the X-Access-Token request header, which can be optionally put into the Authorization request header via access_token_in_authorization_header in the plugin configuration.
-
+! [X-Access-Token](/img/blog_img/2021-08-16-10.png)
-**X-Id-Token**:Apache APISIX 将从用户提供商获取到的 ID token 通过 base64 编码之后放入 X-Id-Token 请求头,可以通过插件配置中的 set_id_token_header 来选择是否开启该功能,默认为为开启状态。
+**X-Id-Token**: Apache APISIX will put the ID token obtained from the user provider into the X-Id-Token request header after base64 encoding, you can choose whether to enable this feature by using the set_id_token_header in the plugin configuration.
-
+! [X-Id-Token](/img/blog_img/2021-08-16-11.png)
-**X-Userinfo**: Apache APISIX 将从用户提供商获取到的用户信息,通过 base64 编码之后放入 X-Userinfo,你可以通过插件配置中的 set_userinfo_header 来选择是否开启该功能,默认为开启状态。
+**X-Userinfo**: Apache APISIX will get the user information from the user provider and put it into X-Userinfo after base64 encoding, you can choose whether to turn it on or not by using set_userinfo_header in the plugin configuration, the default is on.
-
+! [X-Userinfo](/img/blog_img/2021-08-16-12.png)
-由此可以看到,Apache APISIX 将会携带 X-Access-Token,X-Id-Token,X-Userinfo 三个请求头传递至上游。上游可以通过解析这几个头部,从而获取到用户 ID 信息和用户的元数据。
+As you can see, Apache APISIX will carry the X-Access-Token, X-Id-Token, and X-Userinfo request headers to the upstream. The upstream can parse these headers to get the user ID information and user metadata.
-我们展示了在 Apache APISIX 中直接建立来自 Okta 的集中式身份认证的过程。只要注册一个免费的 Okta 开发者账户就可以轻松开始了。这种集中认证的方法减少了开发者的学习和维护成本,提供了安全和精简的用户体验。
+We show the process of setting up centralized authentication from Okta directly in Apache APISIX. It is easy to get started by signing up for a free Okta developer account. This centralized approach to authentication reduces learning and maintenance costs for developers and provides a secure and streamlined user experience.
-## 关于 Okta
+## About Okta
-Okta 是一个可定制的、安全的集中身份认证解决方案。Okta 可以为您的应用程序添加认证和授权。不需要自己编写代码,即可在您的应用程序中直接获得可扩展的认证。您可以将应用程序连接到 Okta,并定义用户的登录方式。每次用户尝试认证时,Okta 都会验证他们的身份,并将所需信息发回给您的应用程序。
+Okta is a customizable, secure centralized authentication solution. Okta can add authentication and authorization to your application. Get scalable authentication directly in your application without writing your own code. You can connect your application to Okta and define how users log in. Each time a user tries to authenticate, Okta verifies their identity and sends the required information back to your application.
-## 关于 Apache APISIX
+## About Apache APISIX
-Apache APISIX 是一个动态、实时、高性能的 API 网关,提供负载均衡、动态上游、灰度发布、服务熔断、身份认证、可观测性等丰富的流量管理功能。你可以使用 Apache APISIX 处理传统的南北向流量,以及服务间的东西向流量,也可以当做 [Kubernetes Ingress Controller](https://github.com/apache/apisix-ingress-controller) 来使用。
+Apache APISIX is a dynamic, real-time, high-performance API gateway that provides load balancing, dynamic upstream, grayscale publishing, service meltdown, authentication, observability, and other rich traffic management features. You can use Apache APISIX for traditional north-south traffic, as well as east-west traffic between services, or as a [Kubernetes Ingress Controller](https://github.com/apache/apisix-ingress-controller) .
-全球已有数百家企业使用 Apache APISIX 处理关键业务流量,涵盖金融、互联网、制造、零售、运营商等等,比如美国航空航天局(NASA)、欧盟的数字工厂、中国航信、中国移动、腾讯、华为、微博、网易、贝壳找房、360、泰康、奈雪的茶等等。
+Hundreds of enterprises worldwide have used Apache APISIX to handle business-critical traffic, covering finance, Internet, manufacturing, retail, carriers, and more, such as NASA, the EU's Digital Factory, China Airlines, China Mobile, Tencent, Huawei, Weibo, NetEase, Shell Housing, 360, Taikang, Nespresso's Tea, and more.
-Github:https://github.com/apache/apisix
+Github: https://github.com/apache/apisix
-官网:https://apisix.apache.org
+Official website: https://apisix.apache.org
diff --git a/website/blog/2021/08/30/Ingress-Meeting.md b/website/blog/2021/08/30/Ingress-Meeting.md
index 9ffd5f7..90293e0 100644
--- a/website/blog/2021/08/30/Ingress-Meeting.md
+++ b/website/blog/2021/08/30/Ingress-Meeting.md
@@ -1,46 +1,46 @@
---
-title: "社区会议| 周三下午 2 点,Apache APISIX Ingress 社区会议与你不见不散"
+title: Webinar| See you at the Apache APISIX Ingress Community Meeting on Wednesday at 2pm!
author: "Apache APISIX 社区"
keywords:
- API 网关
- APISIX
- Ingress
-description: Apache APISIX Ingress 社区会议,建立与社区用户和开发者们的沟通渠道,帮助大家了解 Apache APISIX Ingress 的发展方向和开发计划。
+description: Apache APISIX Ingress community meetings to establish a channel of communication with community users and developers and to help everyone understand the direction and development plans for Apache APISIX Ingress.
tags: [Events]
---
-> 随着 [Apache APISIX Ingress Controller 1.0 版本](https://apisix.apache.org/blog/2021/06/18/first-GA-version-v1.0-of-Apache-APISIX-Ingress-Controller-released) 发布,越来越多的开发者开始关注 Apache APISIX Ingress 方案,Apache APISIX 社区希望能够建立与社区用户和开发者们更直接的沟通渠道,帮助大家了解 Apache APISIX Ingress 的发展方向和开发计划,希望每一位用户、每一位开发者的声音都可以被听见。 因此,Apache APISIX 社区开始组织每两周线上社区会议。
+> With the release of [Apache APISIX Ingress Controller version 1.0](https://apisix.apache.org/blog/2021/06/18/first-GA-version-v1.0-of-Apache-APISIX-Ingress- Controller-released), more and more developers have started to pay attention to the Apache APISIX Ingress solution. The Apache APISIX community hopes to establish a more direct communication channel with users and developers in the community to help them understand the development direction and development plans of Apache APISIX In [...]
-<!--truncate-->
+<! --truncate-->
-## 会议时间
+## Meeting times
-每两周 (周三)下午 2 点,每次会议约 1 小时。
+Every two weeks (Wednesdays) at 2pm, each meeting is about 1 hour.
-## 会议地址
+## Meeting address
-[腾讯会议](https://meeting.tencent.com/s/eTvhm052verD) ID:377 1555 2043
+[Tencent Conference](https://meeting.tencent.com/s/eTvhm052verD) ID: 377 1555 2043
-## 会议周报
+## Weekly Meeting Report
-可以[此文档](https://docs.qq.com/doc/DSEhMeGJ0UXdydFJy)提前留下你想讨论的议题
+You can [this document](https://docs.qq.com/doc/DSEhMeGJ0UXdydFJy) to leave the topics you want to discuss in advance
-## 每期会议的议题可能是
+## Topics for each session may be
-- 某些新功能需求的讨论
-- 技术架构设计的分享
-- Bug 的反馈
-- 自己或所在团队使用 Apache APISIX Ingress Controller 过程中的经验分享和踩坑
-- 对 Apache APISIX Ingress Controller 的肯定或吐槽
+- Discussion of some new feature requirements
+- Sharing of technical architecture design
+- Feedback on bugs
+- Experiences and pitfalls in using Apache APISIX Ingress Controller by yourself or your team
+- Testimonials or complaints about Apache APISIX Ingress Controller
-当然也十分欢迎大家对 Apache APISIX 社区的建设提出中肯意见或贡献各种奇思妙想,如果大家对会议有建议、有想法,欢迎到此 [issue](https://github.com/apache/apisix-ingress-controller/issues/614) 下回复哦~
+Of course, you are also very welcome to give your opinions or contribute your ideas to the construction of the Apache APISIX community, if you have suggestions and ideas for the meeting, please feel free to [issue](https://github.com/apache/apisix-ingress-controller/issues/) 614) and reply to it!
-欢迎大家参与会议,一同探讨 Apache APISIX Ingress 方案,更欢迎小伙伴们加入社区开发者的队伍中,一起打造一款更好用的 Apache APISIX Ingress Controller。
+We welcome you to join us to discuss the Apache APISIX Ingress solution, and we welcome you to join the community of developers to build a better Apache APISIX Ingress Controller.
-如果你对 Apache APISIX 的技术方向感兴趣,希望一同开发,或者有其他建议或意见,可以通过以下渠道参与:
+If you are interested in the technical direction of Apache APISIX, want to develop it together, or have other suggestions or comments, you can participate through the following channels: 1.
-1. 订阅并发送邮件至 dev@apisix.apache.org
-以 Apache Way 的方式参与社区,订阅方式见官网[订阅指南](https://apisix.apache.org/docs/general/subscribe-guide)。邮件列表是 Apache 社区最常用的沟通方式,社区会积极回复邮件列表中的问题。
+1. subscribe and send an email to dev@apisix.apache.org
+Participate in the community the Apache Way way by subscribing to the [Subscription Guide](https://apisix.apache.org/docs/general/subscribe-guide). The mailing list is the most common way for the Apache community to communicate, and the community will actively respond to questions on the mailing list.
-2. 在 Apache APISIX Github discussion 发起讨论
-欢迎大家在 GitHub discussion 讨论,[discussion](https://github.com/apache/apisix/discussions) 区非常活跃哦。我们也会不定期的将一些常见问题在 discussion 中进行汇总和答复,方便大家查找。
+2. Start a discussion in the Apache APISIX Github discussion
+The [discussion](https://github.com/apache/apisix/discussions) area is very active. From time to time, we'll also include a summary of frequently asked questions in the discussion to make them easier to find.
diff --git a/website/blog/2021/08/30/weekly-report.md b/website/blog/2021/08/30/weekly-report.md
index b142254..185c540 100644
--- a/website/blog/2021/08/30/weekly-report.md
+++ b/website/blog/2021/08/30/weekly-report.md
@@ -1,89 +1,89 @@
---
-title: "Apache APISIX 社区周报 | 2021 8.23-8.29"
+title: Apache APISIX Community Weekly Report | 2021 8.23-8.29
keywords:
- APISIX
-- 社区周报
-- 贡献者
+- Community Weekly
+- Contributor
- Good first issue
-description: “独行者速,众行者远”。Apache APISIX 社区周报希望可以帮助社区小伙伴们更好地掌握 Apache APISIX 社区的每周进展,方便大家参与到 Apache APISIX 社区中来。
+description: The Apache APISIX Community Weekly Newsletter hopes to help community members better understand the weekly progress of the Apache APISIX community and facilitate your participation in the Apache APISIX community.
tags: [Events]
---
<!--truncate-->
-## 导语
+## Introduction
-Apache APISIX 从开源第一天就以社区方式成长,迅速成为全世界最活跃的开源 API 网关项目。这些成就,离不开社区小伙伴们的共同奋斗。
+Apache APISIX has grown as a community from the first day of open source and has quickly become the most active open source API gateway project in the world. These achievements cannot be achieved without the joint efforts of our community partners.
-“独行者速,众行者远”。Apache APISIX 社区周报希望可以帮助社区小伙伴们更好地掌握 Apache APISIX 社区的每周进展,方便大家参与到 Apache APISIX 社区中来。
+"The Apache APISIX Community Weekly Newsletter hopes to help community members better grasp the weekly progress of the Apache APISIX community and facilitate your participation in the Apache APISIX community.
-我们还整理了一些适合新来社区的小伙伴们参加的 issue !感兴趣的同学们,走过路过不要错过!
+We've also put together some issues for those new to the community! If you are interested, don't miss them!
-## 贡献者统计
+## Contributor statistics
-
+! [Number of new contributors](https://static.apiseven.com/202108/1630393952402-4965d35c-6b05-4f71-9966-2fea7f7939d3.JPG)
-
+! [New contributors this week](https://static.apiseven.com/202108/1630393952406-9f61c39b-ea9e-4451-bd26-ab845a32a222.JPG)
## Good first issue
### Issue #4241
-**链接**:https://github.com/apache/apisix/issues/4241
+**Link**: https://github.com/apache/apisix/issues/4241
-**问题描述**:现在在将 jwt-auth 插件添加到一个 service/route 时,jwt 令牌未包含“key”声明。
+**Problem Description**: Now when adding the jwt-auth plugin to a service/route, the jwt token does not contain a "key" declaration.
```shell
{
- "iss":"http://127.0.0.1",
- "client_id":"application1",
+ "iss": "http://127.0.0.1",
+ "client_id": "application1",
"sub": "1234567890",
"iat": 1516239022
}
```
-
+! [Screenshot of issue description](https://static.apiseven.com/202108/1630393952407-b6a26364-6c36-47f6-82c2-81514c31f20b.PNG)
### Issue #4441
-**链接**:[Issue #4441](https://github.com/apache/apisix/issues/4441)
+**Link**: [Issue #4441](https://github.com/apache/apisix/issues/4441)
-**问题描述**:现在 APISIX stream_routes 的参数 "remote_addr"只支持单个 ip,需要支持多个 ip 或者像 "192.168.0.0/16 "这样的匹配规则,就像 http 路由参数 "remote_addr"一样。
+**Issue Description**: Now APISIX stream_routes parameter "remote_addr" only support single ip, need to support multiple ip or match rule like "192.168.0.0/16", like http routing parameter "remote_addr".
### Issue #3601
-**链接**:[Issue #3601](https://github.com/apache/apisix/issues/3601)
+**Link**: [Issue #3601](https://github.com/apache/apisix/issues/3601)
-**问题描述**:目前 APISIX 只有请求-响应 gRPC 代理的单元测试,没有流式 gRPC 的相关测试。需要为其添加流式 gRPC 的测试用例。
+**Issue Description**: Currently APISIX only has unit tests for request-response gRPC proxies, and no tests related to streaming gRPC. Need to add test cases for streaming gRPC to it.
### Issue #3931
-**链接**:[Issue #3931](https://github.com/apache/apisix/issues/3931)
+**Link**: [Issue #3931](https://github.com/apache/apisix/issues/3931)
-**问题描述**:重定向插件中的 http_to_https 缺乏 curl 测试,需要为重定向插件中的 http_to_https 添加 curl 测试,并更新文档 [Apache APISIX 重定向插件](http://apisix.apache.org/docs/apisix/plugins/redirect)。
+**Issue Description**: http_to_https in the redirect plugin lacks curl tests, need to add curl tests for http_to_https in the redirect plugin and update the documentation [Apache APISIX redirect plugin](http://apisix.apache.org/docs/ apisix/plugins/redirect).
-## 本周功能特性亮点
+## Feature highlights of the week
-- uri-blocker 支持匹配请求 URI 时忽略大小写
- - **相关 PR**:https://github.com/apache/apisix/pull/4868
- - **贡献者**:[okaybase](https://github.com/okaybase)
+- uri-blocker support for ignoring case when matching request URIs
+ - **Related PR**: https://github.com/apache/apisix/pull/4868
+ - **Contributor**: [okaybase](https://github.com/okaybase)
-- kafka-logger 支持配置 kafka 生产者的 acks 参数
- - **相关 PR**:https://github.com/apache/apisix/pull/4878
- - **贡献者**:[okaybase](https://github.com/okaybase)
+- kafka-logger Support for configuring acks parameters for kafka producers
+ - **Related PR**: https://github.com/apache/apisix/pull/4878
+ - **Contributors**: [okaybase](https://github.com/okaybase)
-- kafka-logger 支持配置 cluster name 参数
- - **相关 PR**:https://github.com/apache/apisix/pull/4876
- - **贡献者**:[tzssangglass](https://github.com/tzssangglass)
+- kafka-logger supports configuring the cluster name parameter
+ - **Related PR**: https://github.com/apache/apisix/pull/4876
+ - **contributor**: [tzssangglass](https://github.com/tzssangglass)
-- referer-restriction 支持配置 blacklist
- - **相关 PR**:https://github.com/apache/apisix/pull/4916
- - **贡献者**:[okaybase](https://github.com/okaybase)
+- referer-restriction Support for configuring blacklist
+ - **Related PR**: https://github.com/apache/apisix/pull/4916
+ - **Contributor**: [okaybase](https://github.com/okaybase)
-## 本周博文推荐
+## Recommended blog posts of the week
-- [使用 Apache APISIX 的 OpenID Connect 插件进行集中身份认证](https://apisix.apache.org/blog/2021/08/25/Using-the-Apache-APISIX-OpenID-Connect-Plugin-for-Centralized-Authentication/):Apache APISIX 是一个动态、实时、高性能的 API 网关,提供负载均衡、动态上游、灰度发布、服务熔断、身份认证、可观测性等丰富的流量管理功能。Apache APISIX 不仅支持插件动态变更和热插拔,而且拥有众多实用的插件。Apache APISIX 的 OpenID Connect 插件支持 OpenID,用户可以使用该插件将身份认证从传统认证模式替换为集中认证模式。
+- [Centralized Authentication with the OpenID Connect Plugin for Apache APISIX](https://apisix.apache.org/blog/2021/08/25/Using-the-Apache-APISIX-OpenID-Connect-Plugin- for-Centralized-Authentication/): Apache APISIX is a dynamic, real-time, high-performance API gateway that provides rich traffic management features such as load balancing, dynamic upstream, grayscale publishing, service meltdown, authentication, observability, etc. Apache APISIX not only supports plug-in dynamic changes [...]
-- [为什么 APISIX 选择 Nginx + Lua 这个技术栈?](https://apisix.apache.org/blog/2021/08/25/Why-Apache-APISIX-chose-Nginx-and-Lua):介绍 APISIX 选用 Nginx + Lua 这个技术栈的历史背景和优势,指出“高性能 + 灵活”是 APISIX 能够从众多网关中脱颖而出的重要原因。
+- Why did APISIX choose the Nginx + Lua technology stack?] (https://apisix.apache.org/blog/2021/08/25/Why-Apache-APISIX-chose-Nginx-and-Lua): Provides the historical background and advantages of the Nginx + Lua technology stack chosen by APISIX, noting that " High performance + flexibility" is what makes APISIX stand out from other gateways.
-- [Apache APISIX 2.9 正式发布,带来更多新功能!](https://apisix.apache.org/blog/2021/08/27/release-apache-apisix-2.9/):Apache APISIX 2.9 版本正式发布!该版本有 30+ 开发者参与,共提交了 100+ PR,新增了 2 个新功能,进一步完善了对插件的支持,快来了解 Apache APISIX 2.9 版本的新特性吧!
+- [Apache APISIX 2.9 Released with More New Features!] (https://apisix.apache.org/blog/2021/08/27/release-apache-apisix-2.9/): Apache APISIX version 2.9 is released! With 30+ developers, 100+ PR submissions, 2 new features, and improved support for plugins, find out what's new in Apache APISIX 2.9!
diff --git "a/website/blog/2021/08/31/Apache APISIX \303\227 KubeSphere-a-better-gateway-and-K8S-Ingress-Controller.md" "b/website/blog/2021/08/31/Apache APISIX \303\227 KubeSphere-a-better-gateway-and-K8S-Ingress-Controller.md"
index 5523eb0e..8ac006f 100644
--- "a/website/blog/2021/08/31/Apache APISIX \303\227 KubeSphere-a-better-gateway-and-K8S-Ingress-Controller.md"
+++ "b/website/blog/2021/08/31/Apache APISIX \303\227 KubeSphere-a-better-gateway-and-K8S-Ingress-Controller.md"
@@ -1,105 +1,105 @@
---
-title: "Apache APISIX × KubeSphere:提供更好用的网关及 K8S Ingress Controller"
-author: "张晋涛"
+title: "Apache APISIX × KubeSphere: Providing a better gateway and K8S Ingress Controller"
+author: Jintao Zhang
authorURL: "https://github.com/tao12345666333"
authorImageURL: "https://avatars.githubusercontent.com/u/3264292?v=4"
keywords:
-- API 网关
+- API Gateway
- APISIX
- KubeSphere
- Ingress
-description: 本文介绍了在 KubeSphere 中使用 Apache APISIX 的官方 Helm 仓库直接部署 Apache APISIX 和 APISIX Ingress Controller 。并且 Apache APISIX 可通过作为网关,或者 APISIX Ingress Controller 的数据面来承载业务流量。
+description: This article describes the direct deployment of Apache APISIX and APISIX Ingress Controller in KubeSphere using the official Apache APISIX Helm repository. And Apache APISIX can be used as a gateway or as a data plane for APISIX Ingress Controller to carry business traffic.
tags: [Practical Case]
---
-> 本文介绍了在 KubeSphere 中使用 Apache APISIX 的官方 Helm 仓库直接部署 Apache APISIX 和 APISIX Ingress Controller 。并且 Apache APISIX 可通过作为网关,或者 APISIX Ingress Controller 的数据面来承载业务流量。
+> This article describes the direct deployment of Apache APISIX and APISIX Ingress Controller in KubeSphere using the official Apache APISIX Helm repository. And Apache APISIX can be used as a gateway or a data plane for APISIX Ingress Controller to carry business traffic.
-<!--truncate-->
+<! --truncate -->
-## KubeSphere 介绍
+## Introduction to KubeSphere
-[KubeSphere](https://kubesphere.io/) 是在 Kubernetes 之上构建的面向云原生应用的系统,完全开源,支持多云与多集群管理,提供全栈的 IT 自动化运维能力,简化企业的 DevOps 工作流。它的架构可以非常方便地使第三方应用与云原生生态组件进行即插即用 (plug-and-play) 的集成。
+[KubeSphere](https://kubesphere.io/) is a cloud-native application-oriented system built on top of Kubernetes, fully open source, supporting multi-cloud and multi-cluster management, providing full-stack IT automation capabilities, and simplifying enterprise DevOps workflows. Its architecture makes it easy to integrate third-party applications with cloud-native eco-components in a plug-and-play fashion.
-作为全栈的多租户容器平台,KubeSphere 提供了运维友好的向导式操作界面,帮助企业快速构建一个强大和功能丰富的容器云平台。KubeSphere 为用户提供构建企业级 Kubernetes 环境所需的多项功能,例如多云与多集群管理、Kubernetes 资源管理、DevOps、应用生命周期管理、微服务治理(服务网格)、日志查询与收集、服务与网络、多租户管理、监控告警、事件与审计查询、存储管理、访问权限控制、GPU 支持、网络策略、镜像仓库管理以及安全管理等。
+As a full-stack, multi-tenant container platform, KubeSphere provides an operations-friendly, wizard-based interface to help organizations quickly build a powerful and feature-rich container cloud platform. DevOps, application lifecycle management, microservice governance (service grid), log query and collection, service and networking, multi-tenant management, monitoring and alerting, event and audit queries, storage management, access control, GPU support, network policies, image repos [...]
-## Apache APISIX 介绍
+## Introduction to Apache APISIX
-[Apache APISIX](https://github.com/apache/apisix) 是一款开源的高性能、动态云原生网关,由深圳支流科技有限公司于 2019 年捐赠给 Apache 基金会,当前已经成为 Apache 基金会的顶级开源项目,也是 GitHub 上最活跃的网关项目。Apache APISIX 当前已经覆盖了 API 网关,LB,Kubernetes Ingress,Service Mesh 等多种场景。
+[Apache APISIX](https://github.com/apache/apisix) is an open source, high-performance, dynamic cloud-native gateway donated to the Apache Foundation by Shenzhen Tributary Technology Co. Apache APISIX currently covers API gateways, LB, Kubernetes Ingress, Service Mesh, and many other scenarios.
-## 前置条件
+## Prerequisites
-将现有 Kubernetes 集群已纳入 KubeSphere 管理。
+Existing Kubernetes clusters already managed in KubeSphere.
-## 部署 Apache APISIX 和 Apache APISIX Ingress Controller
+## Deploy Apache APISIX and Apache APISIX Ingress Controller
-我们可以参考 KubeSphere 的文档启用 KubeSphere 的 [AppStore](https://kubesphere.io/docs/pluggable-components/app-store/),或者使用使用 Apache APISIX 的 [Helm 仓库](https://charts.apiseven.com)来进行部署。这里,我们直接使用 Apache APISIX 的 Helm 仓库进行部署。
+We can either enable KubeSphere's [AppStore](https://kubesphere.io/docs/pluggable-components/app-store/) by referring to KubeSphere's documentation, or use the [Helm repository](https://kubesphere.io/docs/pluggable-components/app-store/) using Apache APISIX (https://charts.apiseven.com) for deployment. Here, we directly use the Helm repository of Apache APISIX for deployment.
-执行以下命令即可添加 Apache APISIX 的 Helm repo,并完成部署。
+Execute the following command to add the Helm repo for Apache APISIX and complete the deployment.
```shell
-➜ ~ helm repo add apisix https://charts.apiseven.com
+➜ ~ helm repo add apisix https://charts.apiseven.com
"apisix" has been added to your repositories
-➜ ~ helm repo add bitnami https://charts.bitnami.com/bitnami
+➜ ~ helm repo add bitnami https://charts.bitnami.com/bitnami
"bitnami" has been added to your repositories
-➜ ~ helm repo update
-➜ ~ kubectl create ns apisix
+➜ ~ helm repo update
+➜ ~ kubectl create ns apisix
namespace/apisix created
-➜ ~ helm install apisix apisix/apisix --set gateway.type=NodePort --set ingress-controller.enabled=true --namespace apisix
-W0827 18:19:58.504653 294386 warnings.go:70] apiextensions.k8s.io/v1beta1 CustomResourceDefinition is deprecated in v1.16+, unavailable in v1.22+; use apiextensions.k8s.io/v1 CustomResourceDefinition
+➜ ~ helm install apisix apisix/apisix --set gateway.type=NodePort --set ingress-controller.enabled=true --namespace apisix
+W0827 18:19:58.504653 294386 warnings.go:70] apiextensions.k8s.io/v1beta1 CustomResourceDefinition is deprecated in v1.16+, unavailable in v1.22+; use apiextensions.k8s.io/v1 CustomResourceDefinition
NAME: apisix
LAST DEPLOYED: Fri Aug 27 18:20:00 2021
NAMESPACE: apisix
STATUS: deployed
REVISION: 1
TEST SUITE: None
-NOTES:
-1. Get the application URL by running these commands:
+NOTES. 1:
+Get the application URL by running these commands:
export NODE_PORT=$(kubectl get --namespace apisix -o jsonpath="{.spec.ports[0].nodePort}" services apisix-gateway)
export NODE_IP=$(kubectl get nodes --namespace apisix -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
```
-验证是否已经成功部署且运行:
+Verify that it has been successfully deployed and is running.
```shell
-➜ ~ kubectl -n apisix get pods
-NAME READY STATUS RESTARTS AGE
-apisix-77d7545d4d-cvdhs 1/1 Running 0 4m7s
-apisix-etcd-0 1/1 Running 0 4m7s
-apisix-etcd-1 1/1 Running 0 4m7s
-apisix-etcd-2 1/1 Running 0 4m7s
-apisix-ingress-controller-74c6b5fbdd-94ngk 1/1 Running 0 4m7s
+➜ ~ kubectl -n apisix get pods
+NAME READY STATUS RESTARTS AGE
+apisix-77d7545d4d-cvdhs 1/1 Running 0 4m7s
+apisix-etcd-0 1/1 Running 0 4m7s
+apisix-etcd-1 1/1 Running 0 4m7s
+apisix-etcd-2 1/1 Running 0 4m7s
+apisix-ingress-controller-74c6b5fbdd-94ngk 1/1 Running 0 4m7s
```
-可以看到相关的 Pod 均已正常运行。
+You can see that the related Pods are running properly.
-## 部署示例项目
+## Deploying the sample project
-我们使用 `kennethreitz/httpbin` 作为示例项目进行演示。这里也直接在 KubeSphere 中完成部署。
+We use `kennethreitz/httpbin` as a sample project for demonstration purposes. The deployment is also done directly in KubeSphere.
-选择服务 -- 无状态服务,创建即可。
+Just select Services - Stateless Services and create it.
-
+! [KubeSphere APISIX Ingress Controller demo](https://static.apiseven.com/202108/1630404138226-5475c163-d372-414e-af74-5c5a86f19629.png)
-
+! [KubeSphere APISIX Ingress Controller demo](https://static.apiseven.com/202108/1630404173444-9bb73e0d-5bee-428e-a257-4685500344ef.png)
-在 KubeSphere 的服务和负载界面即可看到部署成功,也可以直接在终端下查看是否已经部署成功。
+You can see the successful deployment in KubeSphere's Services and Loads interface, or you can check directly in the terminal to see if the deployment has succeeded.
```shell
-➜ ~ kubectl get pods,svc -l app=httpbin
-NAME READY STATUS RESTARTS AGE
-pod/httpbin-v1-7d6dc7d5f-5lcmg 1/1 Running 0 48s
+➜ ~ kubectl get pods,svc -l app=httpbin
+NAME READY STATUS RESTARTS AGE
+pod/httpbin-v1-7d6dc7d5f-5lcmg 1/1 Running 0 48s
-NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
-service/httpbin ClusterIP 10.96.0.5 <none> 80/TCP 48s
+NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
+service/httpbin ClusterIP 10.96.0.5 <none> 80/TCP 48s
```
-## 使用 Apache APISIX 作为网关代理
+## Using Apache APISIX as a Gateway Proxy
-我们先演示如何使用 Apache APISIX 作为网关代理 Kubernetes 集群中的服务。
+We start by demonstrating how to use Apache APISIX as a gateway to proxy services in a Kubernetes cluster.
```shell
-root@apisix:~$ kubectl -n apisix exec -it `kubectl -n apisix get pods -l app.kubernetes.io/name=apisix -o name` -- bash
+root@apisix:~$ kubectl -n apisix exec -it ``kubectl -n apisix get pods -l app.kubernetes.io/name=apisix -o name` -- bash
bash-5.1# curl httpbin.default/get
{
"args": {},
@@ -113,9 +113,9 @@ bash-5.1# curl httpbin.default/get
}
```
-可以看到在 Apache APISIX 的 Pod 内可正常访问示例项目。接下来使用 Apache APISIX 对该示例项目进行代理。
+As you can see, the sample project can be accessed normally from within the Apache APISIX Pod. Next, use Apache APISIX to proxy the sample project.
-这里我们使用 `curl` 调用 Apache APISIX 的 admin 接口,创建一条路由。将所有 host 头为 `httpbin.org` 的请求转发给 `httpbin.default:80` 这个实际的应用服务上。
+Here we use `curl` to call the admin interface of Apache APISIX and create a route. All requests with host header `httpbin.org` are forwarded to the actual application service `httpbin.default:80`.
```shell
bash-5.1# curl "http://127.0.0.1:9180/apisix/admin/routes/1" -H "X-API-KEY: edd1c9f034335f136f87ad84b625c8f1" -X PUT -d '
@@ -129,10 +129,10 @@ bash-5.1# curl "http://127.0.0.1:9180/apisix/admin/routes/1" -H "X-API-KEY: edd1
}
}
}'
-{"node":{"key":"\/apisix\/routes\/1","value":{"host":"httpbin.org","update_time":1630060883,"uri":"\/*","create_time":1630060883,"priority":0,"upstream":{"type":"roundrobin","pass_host":"pass","nodes":{"httpbin.default:80":1},"hash_on":"vars","scheme":"http"},"id":"1","status":1}},"action":"set"}
+{"node":{"key":"\/apisix\/routes\/1", "value":{"host": "httpbin.org", "update_time":1630060883, "uri":"\/*", "create_time":1630060883," priority":0, "upstream":{"type": "roundrobin", "pass_host": "pass", "nodes":{"httpbin.default:80":1}, "hash_on": "vars", "scheme": "http"}, "id": "1", "status":1}}, "action": "set"}
```
-你会得到类似上面的输出,接下来验证是否代理成功:
+You'll get output similar to the above, next verify that the proxy is successful:
```shell
bash-5.1# curl http://127.0.0.1:9080/get -H "HOST: httpbin.org"
@@ -149,16 +149,16 @@ bash-5.1# curl http://127.0.0.1:9080/get -H "HOST: httpbin.org"
}
```
-得到上面的输出,说明已经通过 Apache APISIX 代理了示例项目的流量。接下来我们试试在集群外通过 Apache APISIX 访问示例项目。
+The above output shows that the traffic of the example project has been proxied through Apache APISIX. Next, let's try to access the sample project outside the cluster via Apache APISIX.
```shell
-root@apisix:~$ kubectl -n apisix get svc -l app.kubernetes.io/name=apisix
-NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
-apisix-admin ClusterIP 10.96.33.97 <none> 9180/TCP 22m
-apisix-gateway NodePort 10.96.126.83 <none> 80:31441/TCP 22m
+root@apisix:~$ kubectl -n apisix get svc -l app.kubernetes.io/name=apisix
+NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
+apisix-admin ClusterIP 10.96.33.97 <none> 9180/TCP 22m
+apisix-gateway NodePort 10.96.126.83 <none> 80:31441/TCP 22m
```
-在使用 Helm chart 部署的时候,默认会将 Apache APISIX 的端口通过 NodePort 的形式暴露出去。我们使用 Node IP + NodePort 的端口进行访问测试。
+When deployed using Helm chart, the Apache APISIX port is exposed by default as a NodePort. We use the Node IP + NodePort port for access testing.
```shell
root@apisix:~$ curl http://172.18.0.5:31441/get -H "HOST: httpbin.org"
@@ -175,36 +175,36 @@ root@apisix:~$ curl http://172.18.0.5:31441/get -H "HOST: httpbin.org"
}
```
-可以看到,**在集群外已经可以通过 Apache APISIX 作为网关代理 Kubernetes 集群内的服务了。**
+As you can see, **it is already possible to proxy services within the Kubernetes cluster outside the cluster via Apache APISIX as a gateway.**
-## 使用 APISIX Ingress Controller 代理服务
+## Proxy services using APISIX Ingress Controller
-我们可以直接在 KubeSphere 中添加应用路由(Ingress) ,Apache APISIX Ingress Controller 会自动将路由规则同步至 Apache APISIX 中,完成服务的代理。
+We can add application routes (Ingress) directly in KubeSphere and Apache APISIX Ingress Controller will automatically sync the routing rules to Apache APISIX to complete the proxy for the service.
-
+! [KubeSphere APISIX Ingress Controller demo](https://static.apiseven.com/202108/1630404265190-585b9b09-72d5-4320-b0fe-9cf8a73c55ea.png)
-
+! [KubeSphere APISIX Ingress Controller demo](https://static.apiseven.com/202108/1630404325747-b92928dc-2c6b-4574-a49d-32b6bcb187f9.png)
-**注意**我们添加了 `kubernetes.io/ingress.class: apisix` 的 annotation 配置,用于支持集群内多 ingress-controller 的场景。
+**Note** We added the annotation configuration of `kubernetes.io/ingress.class: apisix` to support multiple ingress-controller scenarios in the cluster.
-保存后,可看到如下界面:
+After saving, you can see the following screen.
-
+! [KubeSphere APISIX Ingress Controller demo](https://static.apiseven.com/202108/1630404366474-dfe8ae08-f16d-417f-8ef3-3495ebda0f7d.png)
-在终端下测试是否代理成功:
+Test if the proxy is successful under the terminal.
```shell
-root@apisix:~$ curl http://172.18.0.5:31441/get -H "HOST: http-ing.org" { "args": {}, "headers": { "Accept": "*/*", "Host": "http-ing.org", "User-Agent": "curl/7.76.1", "X-Forwarded-Host": "http-ing.org" }, "origin": "10.244.2.1", "url": "http://http-ing.org/get"}
+root@apisix:~$ curl http://172.18.0.5:31441/get -H "HOST: http-ing.org" { "args": {}, "headers": { "Accept": "*/*", "Host": "http-ing.org", "User -Agent": "curl/7.76.1", "X-Forwarded-Host": "http-ing.org" }, "origin": "10.244.2.1", "url": "http://http-ing.org/get"}
```
-可以看到也正常代理了。
+You can see that it is also proxied properly.
-除了以上方式外,Apache APISIX Ingress Controller 通过 CRD 的方式对 Kubernetes 进行了扩展,你也可以通过发布 `ApisixRoute` 等这种自定义资源来完成 Kubernetes 中服务的对外暴露。
+In addition to the above, Apache APISIX Ingress Controller extends Kubernetes by way of CRD, and you can also publish custom resources like `ApisixRoute` to expose services in Kubernetes to the public.
-## 总结
+## Summary
-你可以在 KubeSphere 中使用 Apache APISIX 的官方 Helm 仓库直接部署 Apache APISIX 和 APISIX Ingress Controller 。并且 Apache APISIX 可通过作为网关,或者 APISIX Ingress Controller 的数据面来承载业务流量。
+You can deploy Apache APISIX and APISIX Ingress Controller directly in KubeSphere using the official Apache APISIX Helm repository. And Apache APISIX can be used as a gateway or as a data plane for APISIX Ingress Controller to carry business traffic.
-## 未来展望
+## Future Outlook
-Apache APISIX 已经与 KubeSphere 社区达成合作,你可以直接在 KubeSphere 自带的应用仓库中找到 Apache APISIX ,不需要手动添加 Helm 仓库。
+Apache APISIX has already partnered with the KubeSphere community, so you can find Apache APISIX directly in KubeSphere's own application repository, without having to manually add a Helm repository.