You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/03/03 09:07:25 UTC

[GitHub] [apisix-website] hf400159 opened a new pull request #935: docs: add CoreDNS blog

hf400159 opened a new pull request #935:
URL: https://github.com/apache/apisix-website/pull/935


   Fixes: #[Add issue number here]
   
   Changes:
   
   <!-- Add here what changes were made in this pull request and if possible provide links showcasing the changes. -->
   
   Screenshots of the change:
   
   <!-- Add screenshots depicting the changes. -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-website] netlify[bot] edited a comment on pull request #935: docs: add CoreDNS blog

Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #935:
URL: https://github.com/apache/apisix-website/pull/935#issuecomment-1057827843


   ✔️ Deploy Preview for *apache-apisix* ready!
   
   
   🔨 Explore the source changes: ec208afaddf0ec6eff58a9d2c79d77c907326945
   
   🔍 Inspect the deploy log: [https://app.netlify.com/sites/apache-apisix/deploys/6221848e6c53dd000702bf50](https://app.netlify.com/sites/apache-apisix/deploys/6221848e6c53dd000702bf50)
   
   😎 Browse the preview: [https://deploy-preview-935--apache-apisix.netlify.app](https://deploy-preview-935--apache-apisix.netlify.app)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-website] netlify[bot] edited a comment on pull request #935: docs: add CoreDNS blog

Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #935:
URL: https://github.com/apache/apisix-website/pull/935#issuecomment-1057827843


   ✔️ Deploy Preview for *apache-apisix* ready!
   
   
   🔨 Explore the source changes: ae0c75718183a4e136d3ee525a98702c491d83a6
   
   🔍 Inspect the deploy log: [https://app.netlify.com/sites/apache-apisix/deploys/62208543c2ef360008b769d9](https://app.netlify.com/sites/apache-apisix/deploys/62208543c2ef360008b769d9)
   
   😎 Browse the preview: [https://deploy-preview-935--apache-apisix.netlify.app](https://deploy-preview-935--apache-apisix.netlify.app)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-website] netlify[bot] edited a comment on pull request #935: docs: add CoreDNS blog

Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #935:
URL: https://github.com/apache/apisix-website/pull/935#issuecomment-1057827843


   ✔️ Deploy Preview for *apache-apisix* ready!
   
   
   🔨 Explore the source changes: 634dd443112900f78b571f66e7ee72c146471b3f
   
   🔍 Inspect the deploy log: [https://app.netlify.com/sites/apache-apisix/deploys/62208b4d3965fa0007f4b346](https://app.netlify.com/sites/apache-apisix/deploys/62208b4d3965fa0007f4b346)
   
   😎 Browse the preview: [https://deploy-preview-935--apache-apisix.netlify.app](https://deploy-preview-935--apache-apisix.netlify.app)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-website] netlify[bot] edited a comment on pull request #935: docs: add CoreDNS blog

Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #935:
URL: https://github.com/apache/apisix-website/pull/935#issuecomment-1057827843


   👷 Deploy Preview for *apache-apisix* processing.
   
   
   🔨 Explore the source changes: 634dd443112900f78b571f66e7ee72c146471b3f
   
   🔍 Inspect the deploy log: [https://app.netlify.com/sites/apache-apisix/deploys/62208b4d3965fa0007f4b346](https://app.netlify.com/sites/apache-apisix/deploys/62208b4d3965fa0007f4b346)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-website] SylviaBABY commented on a change in pull request #935: docs: add CoreDNS blog

Posted by GitBox <gi...@apache.org>.
SylviaBABY commented on a change in pull request #935:
URL: https://github.com/apache/apisix-website/pull/935#discussion_r819230452



##########
File path: website/blog/2022/03/04/apisix-uses-coredns-enable-service-discovery.md
##########
@@ -0,0 +1,258 @@
+---
+title: "Apache APISIX and CoreDNS open new doors for service discovery"
+authors:
+  - name: "Zijie Chen"
+    title: "Author"
+    url: "https://github.com/CP3cham"
+    image_url: "https://avatars.githubusercontent.com/u/87352162?v=4"
+  - name: "Fei Han"
+    title: "Technical Writer"
+    url: "https://github.com/hf400159"
+    image_url: "https://avatars.githubusercontent.com/u/97138894?v=4"
+keywords: 
+- Apache APISIX
+- API Gateway
+- CoreDNS
+- Service Discovery
+- Service Register
+- Ecosystem
+description: Apache APISIX is a dynamic, real-time, high-performance cloud-native API gateway that provides rich traffic management functions such as load balancing, dynamic upstream, grayscale publishing, service interruption, identity authentication, and observability. As a cloud native API gateway, Apache APISIX also integrates multiple service discovery capabilities. This article will show you how to configure CoreDNS in Apache APISIX.
+tags: [Technology,Ecosystem,Service Discovery]
+---
+
+> Apache APISIX is a dynamic, real-time, high-performance cloud-native API gateway that provides rich traffic management functions such as load balancing, dynamic upstream, grayscale publishing, service interruption, identity authentication, and observability. As a cloud native API gateway, Apache APISIX also integrates multiple service discovery capabilities. This article will show you how to configure CoreDNS in Apache APISIX.
+
+## Background information
+
+In traditional physical machine and virtual machine deployment, calls between various services can be made through fixed **IP + port**. With the advent of the cloud-native era, enterprise business deployment is more inclined to cloud-native containerization. However, in a containerized environment, the startup and destruction of service instances are very frequent. Manual maintenance by operation and maintenance personnel will not only be a heavy workload, but also ineffective. Therefore, a mechanism is needed that can automatically detect the service status, and dynamically bind a new address when the service address changes. The service discovery mechanism came into being.
+
+## Service Discovery
+
+The service discovery mechanism can be split into two parts:
+
+- Service Registry: Store host and port information for services.
+
+If a container provides a service for calculating the average, we use the service name of average as the unique identifier, then it will be stored in the form of a key-value pair (average:192.168.1.21) in the service registry.
+
+- Service Discovery: Allows other users to discover the information stored during the service registration phase. It is divided into client discovery mode and server discovery mode.
+
+### Client Service Discovery Mode
+
+When using the client discovery mode, the client obtains the actual network address of the available service by querying the storage information of the service registry, selects an available service instance through a load balancing algorithm, and sends the request to the service.
+
+- Advantages: Simple architecture, flexible expansion, and easy implementation of load balancing functions.
+- Disadvantages: heavy client, strong coupling, there is a certain development cost.
+
+![error/client service discovery.png](https://static.apiseven.com/202108/1646299277491-53bd8cd0-a984-4fed-bcbd-d251c18f5b7f.png)
+
+The implementation logic of client discovery mode is as follows:
+
+1. When a new service is started, it will actively register with the registration center, and the service registration center will store the service name and address of the new service;
+2. When the client needs this service, it will use the service name to initiate a query to the service registry;
+3. The service registry returns the available addresses, and the client selects one of the addresses to initiate the call according to the specific algorithm.
+
+In this process, in addition to service registration, the work of service discovery is basically completed by the client independently, and the addresses of the registry and the server are also fully visible to the client.
+
+### Server Service Discovery Mode
+
+The client sends a request to the Load Balancer, and the Load Balancer queries the service registry according to the client's request, finds an available service, and forwards the request to the service. Like the client service discovery mode, the service needs to be registered and deregistered in the registry.
+
+- Advantages: The discovery logic of the service is transparent to the client.
+- Disadvantages: Requires additional deployment and maintenance of a Load Balancer.
+
+![error/server service discovery.png](https://static.apiseven.com/202108/1646299327406-0172de7f-94a8-4964-b109-562795941d0e.png)
+
+The implementation logic of server discovery mode is as follows:
+
+1. When a new service is started, it will actively register with the registry, and the service registry will store the service name and address of the new service;
+2. When the client needs a service, it will use the service name to initiate a query to the load balancer;
+3. According to the service name requested by the client, the Load Balancer proxies the client to initiate a request to the service registry;
+4. After the Load Balancer obtains the returned address, it selects one of the addresses to initiate the call according to the specific algorithm.
+
+## Advantages of using CoreDNS
+
+CoreDNS is an open source DNS server written in `Go`, which is commonly used for DNS services and service discovery in multi-container environments due to its flexibility and extensibility. CoreDNS is built on top of Caddy, the HTTP/2 web server, and implements a plug-in chain architecture, abstracting many DNS related logic into layer-by-layer plug-ins, which are more flexible and easy to expand, and user selected plugin It will be compiled into the final executable file, and the running efficiency is also very high. CoreDNS is the first cloud native open source project to join CNCF (Cloud Native Computing Foundation) and has graduated, and it is also the default DNS service in Kubernetes.
+
+Compared with common service discovery frameworks (Zookeeper and Consul), what are the advantages of CoreDNS implementing service discovery?

Review comment:
       ```suggestion
   Compared with common service discovery frameworks (Apache ZooKeeper and Consul), what are the advantages of CoreDNS implementing service discovery?
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-website] SylviaBABY commented on a change in pull request #935: docs: add CoreDNS blog

Posted by GitBox <gi...@apache.org>.
SylviaBABY commented on a change in pull request #935:
URL: https://github.com/apache/apisix-website/pull/935#discussion_r819230561



##########
File path: website/i18n/zh/docusaurus-plugin-content-blog/2022/03/04/apisix-uses-coredns-enable-service-discovery.md
##########
@@ -0,0 +1,259 @@
+---
+title: "API 网关 Apache APISIX 携手 CoreDNS 打开服务发现新大门"
+authors:
+  - name: "陈梓杰"
+    title: "Author"
+    url: "https://github.com/CP3cham"
+    image_url: "https://avatars.githubusercontent.com/u/87352162?v=4"
+  - name: "韩飞"
+    title: "Technical Writer"
+    url: "https://github.com/hf400159"
+    image_url: "https://avatars.githubusercontent.com/u/97138894?v=4"
+keywords: 
+- Apache APISIX
+- API Gateway
+- CoreDNS
+- 服务发现
+- 服务注册
+- Ecosystem
+description: Apache APISIX 是一个动态、实时、高性能的云原生 API 网关,提供了负载均衡、动态上游、灰度发布、服务熔断、身份认证、可观测性等丰富的流量管理功能。作为云原生 API 网关,Apache APISIX 也集成了多种服务发现的能力,本文将为您展示在 Apache APISIX 中如何配置 CoreDNS。
+tags: [Technology,Ecosystem,Service Discovery]
+---
+
+> Apache APISIX 是一个动态、实时、高性能的云原生 API 网关,提供了负载均衡、动态上游、灰度发布、服务熔断、身份认证、可观测性等丰富的流量管理功能。作为云原生 API 网关,Apache APISIX 也集成了多种服务发现的能力,本文将为您展示在 Apache APISIX 中如何配置 CoreDNS。
+
+## 背景信息
+
+在传统的物理机和虚拟机部署中,各个服务之间的调用可以通过固定 **IP + 端口**的方式进行。随着云原生时代的到来,企业业务的部署更倾向于云原生容器化。但是在容器化环境中,服务实例的启动和销毁是非常频繁的,如果通过运维人员手动维护不仅工作量大,而且效果也欠佳。因此需要一种机制可以自动检测服务状态,当服务地址出现变更时,动态绑定新的地址。服务发现机制应运而生。
+
+## 服务发现简介
+
+服务发现机制可以分为两部分:
+
+- 服务注册中心:存储服务的主机和端口信息。
+
+假如某个容器对外提供计算平均值的服务,我们使用 `average` 的服务名作为唯一标识符,那么在服务注册中心就会以键值对(`average:192.168.1.21`)的方式存储。
+
+- 服务发现:允许其他用户发现服务注册阶段存储的信息。分为客户端发现模式和服务端发现模式。
+
+### 客户端服务发现模式
+
+在使用客户端发现模式时,客户端通过查询服务注册中心的存储信息,获取可用服务的实际网络地址后,通过负载均衡算法选择一个可用的服务实例,并将请求发送至该服务。
+
+- 优点:架构简单,扩展灵活,方便实现负载均衡功能。
+- 缺点:重客户端,强耦合,有一定开发成本。
+
+![error/client service discovery.png](https://static.apiseven.com/202108/1646299482001-9bba7b28-1780-44c8-869d-b75bc993c021.png)
+
+客户端发现模式实现逻辑如下:
+
+1. 新服务启动时,主动向注册中心注册,服务注册中心会存储新服务的服务名和地址;
+2. 当客户端需要这个服务时,会使用服务名向服务注册中心发起查询;
+3. 服务注册中心返回可用的地址,客户端再根据具体的算法选择其中一个发起调用。
+
+在这个过程中,除了服务注册,服务发现的工作基本由客户端独立完成,注册中心和服务端的地址对客户端也是完全可见的。
+
+### 服务端服务发现模式
+
+客户端向 Load Balancer 发送请求,Load Balancer 根据客户端的请求查询服务注册中心,找到可用的服务后转发请求到该服务上,和客户端服务发现模式一样,服务都需要在注册中心进行服务注册和注销。
+
+- 优点:服务的发现逻辑对客户端是透明的。
+- 缺点:需要额外部署和维护负载均衡器。
+
+![error/server service discovery.png](https://static.apiseven.com/202108/1646299531288-3ff99279-3ab6-49d7-8abf-68461f50c5c0.png)
+
+服务端发现模式实现逻辑如下:
+
+1. 新服务启动时,主动向注册中心注册,服务注册中心会存储新服务的服务名和地址;
+2. 当客户端需要某个服务时,会使用服务名向负载均衡器发起查询;
+3. 负载均衡器根据客户端请求的服务名,代理客户端向服务注册中心发起请求;
+4. 负载均衡器获得返回的地址后,根据具体的算法选择其中一个发起调用。
+
+## 使用 CoreDNS 的优势
+
+CoreDNS 是一个用 `Go` 语言编写的开源 DNS 服务器,由于它的灵活性和可扩展性,常用于多容器环境中的 DNS 服务和服务发现。CoreDNS 建立在 Caddy 这个 HTTP/2 Web 服务器之上,实现了一个插件链的架构,将很多 DNS 相关的逻辑都抽象成了一层一层的插件,实现起来更灵活和易扩展,用户选择的插件会被编译到最终的可执行文件中,运行效率也非常高。CoreDNS 是首批加入 CNCF(云原生计算基金会)并且是已经毕业的云原生开源项目,也是 Kuberneters 中默认的 DNS 服务。
+
+相比于常见的服务发现框架(Zookeeper 和 Consul),CoreDNS 实现服务发现有哪些优势呢?

Review comment:
       ```suggestion
   相比于常见的服务发现框架(Apache ZooKeeper 和 Consul),CoreDNS 实现服务发现有哪些优势呢?
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-website] netlify[bot] edited a comment on pull request #935: docs: add CoreDNS blog

Posted by GitBox <gi...@apache.org>.
netlify[bot] edited a comment on pull request #935:
URL: https://github.com/apache/apisix-website/pull/935#issuecomment-1057827843


   👷 Deploy Preview for *apache-apisix* processing.
   
   
   🔨 Explore the source changes: ec208afaddf0ec6eff58a9d2c79d77c907326945
   
   🔍 Inspect the deploy log: [https://app.netlify.com/sites/apache-apisix/deploys/6221848e6c53dd000702bf50](https://app.netlify.com/sites/apache-apisix/deploys/6221848e6c53dd000702bf50)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-website] bzp2010 merged pull request #935: docs: add CoreDNS blog

Posted by GitBox <gi...@apache.org>.
bzp2010 merged pull request #935:
URL: https://github.com/apache/apisix-website/pull/935


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-website] netlify[bot] commented on pull request #935: docs: add CoreDNS blog

Posted by GitBox <gi...@apache.org>.
netlify[bot] commented on pull request #935:
URL: https://github.com/apache/apisix-website/pull/935#issuecomment-1057827843


   👷 Deploy Preview for *apache-apisix* processing.
   
   
   🔨 Explore the source changes: ae0c75718183a4e136d3ee525a98702c491d83a6
   
   🔍 Inspect the deploy log: [https://app.netlify.com/sites/apache-apisix/deploys/62208543c2ef360008b769d9](https://app.netlify.com/sites/apache-apisix/deploys/62208543c2ef360008b769d9)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org