【kong系列一】之 API网关 & kong 概述 港控/mmm° 2022-04-18 01:27 614阅读 0赞 首先了解一下什么是kong,什么是api。 一、API网关 API 网关,即API Gateway,是大型分布式系统中,为了保护内部服务而设计的一道屏障,可以提供高性能、高可用的 API托管服务,从而帮助服务的开发者便捷地对外提供服务,而不用考虑安全控制、流量控制、审计日志等问题,统一在网关层将安全认证,流量控制,审计日志,黑白名单等实现。网关的下一层,是内部服务,内部服务只需开发和关注具体业务相关的实现。网关可以提供API发布、管理、维护等主要功能。开发者只需要简单的配置操作即可把自己开发的服务发布出去,同时置于网关的保护之下。 ![在这里插入图片描述][watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3d1MjcwMDIyMg_size_16_color_FFFFFF_t_70] (▲图片版权来自网络,版权归作者所有。) API Gateway网关使得搭建一个新的应用服务变得简单、快捷、高效,同时,开发者将精力更多放在和业务紧密相关的工作上。 二、kong简介 Kong是一款基于Nginx\_Lua模块写的高可用,易扩展由Mashape公司开源的API Gateway项目。由于Kong是基于Nginx的,所以可以水平扩展多个Kong服务器,通过前置的负载均衡配置把请求均匀地分发到各个Server,来应对大批量的网络请求。 Kong主要有三个组件: Kong Server :基于nginx的服务器,用来接收API请求。 Apache Cassandra/PostgreSQL :用来存储操作数据。 Kong dashboard:官方推荐UI管理工具,当然,也可以使用 restfull 方式 管理admin api。 Kong采用插件机制进行功能定制,插件集(可以是0或n个)在API请求响应循环的生命周期中被执行。插件使用Lua编写,目前已有几个基础功能:HTTP基本认证、密钥认证、CORS( Cross-origin Resource Sharing,跨域资源共享)、TCP、UDP、文件日志、API请求限流、请求转发以及nginx监控。 Kong 官网:[https://getkong.org/][https_getkong.org] 插件介绍,帮助文档等。 Kong 源码:[https://github.com/Mashape/kong][https_github.com_Mashape_kong] Kong UI管理工具:[https://github.com/PGBI/kong-dashboard][https_github.com_PGBI_kong-dashboard] 浏览器UI管理工具 Kong 桌面管理工具:[https://github.com/ajaysreedhar/kongdash][https_github.com_ajaysreedhar_kongdash] 有linux版本,windows版本,mac版本。 社区资源和工具 ## 安装KONG的方式 ## 可以选择不同的方式进行安装 ->重要 * [Kong Docker][]: A Dockerfile for running Kong in Docker. * [Kong Packages][]: Pre-built packages for Debian, Red Hat, and OS X distributions (shipped with each release). * [Kong Vagrant:][Kong Vagrant] A Vagrantfile for provisioning a development ready environment for Kong. * [Kong Homebrew][]: Homebrew Formula for Kong. * [Kong CloudFormation][]: Kong in a 1-click deployment for AWS EC2 * [Kong AWS AMI][]: Kong AMI on the AWS Marketplace. * [Kong on Microsoft Azure][]: Run Kong using Azure Resource Manager. * [Kong on Heroku][]: Deploy Kong on Heroku in one click. * [Kong and Instaclustr][]: Let Instaclustr manage your Cassandra cluster. ## 第三方管理维护工具 ## * [Ansible][] role for Kong on Ubuntu * [Biplane][]: declarative configuration in Crystal Crystal语言版本声明式配置管理工具,利用配置,一键批量执行。 * [Bonobo][]: key management (with Mashery migration scripts) * [Chef cookbook][] * [Django][] Kong Admin: Admin UI in Python Python版本UI界面管理工具 * [Jungle][]: Admin UI in JavaScript JS版本UI界面管理工具 * [Kong Dashboard:][https_github.com_PGBI_kong-dashboard] Admin UI in JavaScript JS版本UI界面管理工具 * [Kong for CanopyCloud][] * [Kong image waiting for Cassandra][] * [Kong image for Tutum][] * [Kong-UI][]: Admin UI in JavaScript JS版本UI界面管理工具 * [Konga][]: CLI Admin tool in JavaScript JS客户端管理工具 * [Konga-docker][] konga的docker镜像 * [Kongfig][]: Declarative configuration in JavaScript JS语言版本声明式配置管理工具,利用配置,一键批量执行。 * [Kongfig on Puppet Forge][] * [Puppet recipe][] * [Puppet module on Puppet Forge][] * [Python-Kong][]: Admin client library for Python Python客户端。 * [.NET-Kong][]: Admin client library for .NET .NET客户端。 * [kong-java-client][]: Admin client library for Java java客户端 -------------------- ## 参考文献 ## 参考文章1:KONG API Gateway-用户指南 [https://github.com/cloudframeworks-apigateway/user-guide-apigateway\#框架说明-业务][https_github.com_cloudframeworks-apigateway_user-guide-apigateway_-] 参考文章2:易观API网关—Kong分享篇https://www.analysys.cn/media/technology/detail/20014914/ 参考文章3: Kong:Nginx支持的API管理解决方案https://sdk.cn/news/1596 [watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3d1MjcwMDIyMg_size_16_color_FFFFFF_t_70]: /images/20220418/e6b218fc6a344423b3b1875b075f3d36.png [https_getkong.org]: https://getkong.org/ [https_github.com_Mashape_kong]: https://github.com/Mashape/kong [https_github.com_PGBI_kong-dashboard]: https://github.com/PGBI/kong-dashboard [https_github.com_ajaysreedhar_kongdash]: https://github.com/ajaysreedhar/kongdash [Kong Docker]: https://github.com/Mashape/docker-kong [Kong Packages]: https://github.com/Mashape/kong/releases [Kong Vagrant]: https://github.com/Mashape/kong-vagrant [Kong Homebrew]: https://github.com/Mashape/homebrew-kong [Kong CloudFormation]: https://github.com/Mashape/kong-dist-cloudformation [Kong AWS AMI]: https://aws.amazon.com/marketplace/pp/B014GHERVU [Kong on Microsoft Azure]: https://github.com/Mashape/kong-dist-azure [Kong on Heroku]: https://github.com/heroku/heroku-kong [Kong and Instaclustr]: https://www.instaclustr.com/solutions/kong/ [Ansible]: https://github.com/Getsidecar/ansible-role-kong [Biplane]: https://github.com/articulate/biplane [Bonobo]: https://github.com/guardian/bonobo [Chef cookbook]: https://github.com/zuazo/kong-cookbook [Django]: https://github.com/vikingco/django-kong-admin [Jungle]: https://github.com/rsdevigo/jungle [Kong for CanopyCloud]: https://github.com/CanopyCloud/cip-kong [Kong image waiting for Cassandra]: https://github.com/articulate/docker-kong-wait [Kong image for Tutum]: https://github.com/Sillelien/docker-kong [Kong-UI]: https://github.com/msaraf/kong-ui [Konga]: https://github.com/Floby/konga-cli [Konga-docker]: https://hub.docker.com/r/pantsel/konga/ [Kongfig]: https://github.com/mybuilder/kongfig [Kongfig on Puppet Forge]: https://forge.puppet.com/mybuilder/kongfig [Puppet recipe]: https://github.com/scottefein/puppet-nyt-kong [Puppet module on Puppet Forge]: https://forge.puppet.com/juniorsysadmin/kong [Python-Kong]: https://pypi.python.org/pypi/python-kong/ [.NET-Kong]: https://www.nuget.org/packages/Kong/0.0.4 [kong-java-client]: https://github.com/vaibhav-sinha/kong-java-client [https_github.com_cloudframeworks-apigateway_user-guide-apigateway_-]: https://github.com/cloudframeworks-apigateway/user-guide-apigateway#%E6%A1%86%E6%9E%B6%E8%AF%B4%E6%98%8E-%E4%B8%9A%E5%8A%A1
还没有评论,来说两句吧...