This is an automated email from the ASF dual-hosted git repository.
yilinzeng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-website.git
The following commit(s) were added to refs/heads/master by this push:
new d9c5412 docs: update sina's images (#955)
d9c5412 is described below
commit d9c541299f35ce460555fa896c4be1d4dbdba4b3
Author: yilinzeng <[email protected]>
AuthorDate: Thu Mar 10 17:15:52 2022 +0800
docs: update sina's images (#955)
---
...ina-Weibo-API-gateway-based-on-Apache-APISIX.md | 34 +++++++++++-----------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git
a/website/blog/2021/07/14/the-road-to-customization-of-Sina-Weibo-API-gateway-based-on-Apache-APISIX.md
b/website/blog/2021/07/14/the-road-to-customization-of-Sina-Weibo-API-gateway-based-on-Apache-APISIX.md
index 6dc1b89..a9e9842 100644
---
a/website/blog/2021/07/14/the-road-to-customization-of-Sina-Weibo-API-gateway-based-on-Apache-APISIX.md
+++
b/website/blog/2021/07/14/the-road-to-customization-of-Sina-Weibo-API-gateway-based-on-Apache-APISIX.md
@@ -62,7 +62,7 @@ A complete database of product lines and business lines is
available at the ente
Users, roles and the actual product line of operation are then associated with
the following correspondence.
-
+
A user can be assigned to undertake different operations and maintenance roles
to manage and maintain different product lines of services.
@@ -70,23 +70,23 @@ The administrator role is very easy to understand, the core
role of operation an
### Add Audit Function
-
+
In the open source version, a route can be published directly after it is
created or modified.
In our custom version, after a route is created or modified, it needs to go
through an audit workflow before it can be published, which lengthens the
process, but we think it is more credible to publish after the authorization is
reviewed at the enterprise level.
-
+
When creating routing rules, they must be reviewed by default. To take into
account efficiency, when entering new services, you can choose the no-review,
fast-publishing channel and click the publish button directly.
-
+
When an important API route has problems after a certain adjustment rule
release goes live, you can select the previous version of the routing rule for
a quick roll back, with the granularity of a single route roll back that will
not affect other routing rules.
The internal processing flow of a single route roll back is shown in the
following figure.
-
+
We need to create version database storage for each release of a single route.
This way, when we do a full release after the audit, each release will generate
a version number and the corresponding full configuration data; then the
version list grows. When we need to roll back, go to the version list and
select a corresponding version to rollback; in a sense, the roll back is
actually a special form of full release.
@@ -96,30 +96,30 @@ Our custom-developed canary release feature is different
from what the community
Although canary release is a low-frequency behavior, there is still a state
transition between it and full volume release.
-
+
When the percentage of canary release decreases to 0%, it is the state of full
release; when the canary release rises to 100%, it is the next full release,
and this is its state transition.
The full canary release feature requires some API support exposed on the
gateway instance in addition to the administrative backend support.
-
+
The above screenshot shows the screenshot when operating canary release to
select a specific gateway instance.
The full canary release feature requires some API support exposed on the
gateway instance in addition to the administrative backend support.
-
+
Canary release API fixed URI, the unified path is
/admin/services/gray/{SAAS_ID}/ routes. Different HTTP Method presents
different business meanings, POST means create, DELETE means to stop canary
release, GET means to view.
#### Activation Process
-
+
An API is published from the gateway level, and after receiving the data the
worker process checks the legitimacy of the data sent, and the legitimate data
is broadcast to all worker processes via events. Then the canary release API is
called and the canary release rules are added and take effect when the next
request is processed.
#### Deactivation Process
-
+
The deactivation process is basically the same as the canary release
distribution process. The API for canary release distribution is called by the
DELETE method and broadcasted to all work processes. If it exists in the route
table, delete it and try to restore it from the ETCD. If the canary release is
deactivated, make sure that the original ETCD can be restored without affecting
the normal service.
@@ -135,23 +135,23 @@ By exposing the Go Import HTTP API for the management
backend, the operation eng
Custom development based on the Apache APISIX data surface requires a number
of code path rules to be followed. In particular, the code for the Apache
APISIX gateway and the custom code are stored in separate paths, and the two
work together and can each be iterated independently.
-
+
### Modification of Installation Package
So when packaging, not only custom code, but also dependencies, configuration,
etc. all need to be packaged together for distribution. As for the output
format, you can either choose Docker or type it into a tarball, as required.
-
+
### Custom Development of Code
Some custom modules need to be loaded first when they are initialized, so that
the code intrusion into Apache APISIX becomes minimal, requiring only
modifications to the Nginx.conf file.
-
+
For example, if you need to stuff an upstream object with a saas_id attribute
field, you can call the following method at initialize time.
-
+
You need to be called in the initworker_by_lua* phase to complete the
initialization for similar modifications.
@@ -167,15 +167,15 @@ If you have similar needs in a production environment,
you can refer to the abov
Currently, most of Weibo services use Consul KV as a service registration and
discovery mechanism. Previously, Apache APISIX did not support the Consul KV
method of service discovery mechanism, so a `consul_kv.lua` module needs to be
added to the gateway layer, and a UI interface needs to be provided in the
management backend as follows.
-
+
In the upstream list in the console, everything is filled in at a glance, and
the metadata of all registered nodes is automatically presented when the mouse
is moved over the registered service address, which greatly facilitates the
daily operation of our operation engineers.
-
+
The `consul_kv.lua` module is relatively simple to configure at the gateway
level, supporting multiple connections to different Consul clusters at the same
time, but this is also due to the requirements of the actual environment.
-
+
This code has now been merged into the APISIX master branch and is included in
version 2.4.