开箱即用的云原生微服务网关Kong | 留言送书
Posted 分布式实验室
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了开箱即用的云原生微服务网关Kong | 留言送书相关的知识,希望对你有一定的参考价值。
$ yum install epel-release -- 安装并启用epel 源
$ yum install -y python-pip -- 安装python-pip
$ pip install --upgrade pip -- 更新pip
$ yum -y install python-devel python-subprocess32 -- 安装python-devel/subprocess32
$ pip install docker-compose -- 安装docker-compose
version: '3'
services:
kong-database:
image: postgres:9.6 --镜像postgres
container_name: kong-database
ports:
- 5432:5432 --postgres端口
environment:
- POSTGRES_USER=kong
- POSTGRES_DB=kong
- POSTGRES_PASSWORD=kong
volumes:
- "/opt/kong-db-data-postgres:/var/lib/postgresql/data" –数据目录映射
kong-migrations:
image: kong:2.3 --镜像kong
environment:
- KONG_DATABASE=postgres
- KONG_PG_HOST=kong-database
- KONG_PG_USER=kong
- KONG_PG_PASSWORD=kong
command: kong migrations bootstrap --kong数据库自动初使化
restart: on-failure
depends_on:
- kong-database
kong:
image: kong:2.3 --镜像kong
container_name: kong
environment:
- KONG_DATABASE=postgres
- KONG_PG_HOST=kong-database
- KONG_PG_USER=kong
- KONG_PG_PASSWORD=kong
- KONG_PROXY_ACCESS_LOG=/dev/stdout
- KONG_ADMIN_ACCESS_LOG=/dev/stdout
- KONG_PROXY_ERROR_LOG=/dev/stderr
- KONG_ADMIN_ERROR_LOG=/dev/stderr
- KONG_ADMIN_LISTEN=0.0.0.0:8001, 0.0.0.0:8444 ssl
restart: on-failure
ports:
- 8000:8000 -- kong代理端口
- 8443:8443 -- kong管理端口
- 8001:8001 -- kong SSL代理端口
- 8444:8444 -- kong SSL管理端口
links:
- kong-database:kong-database
depends_on:
- kong-migrations
konga:
image: pantsel/konga:0.14.9 --镜像konga
ports:
- 1337:1337 --konga端口
links:
- kong:kong
container_name: konga
environment:
- NODE_ENV=production
using the "epoll" event method
openresty/1.15.8.3
built by gcc 9.2.0 (Alpine 9.2.0)
OS: Linux 3.10.0-693.el7.x86_64
getrlimit(RLIMIT_NOFILE): 1048576:1048576
start worker processes
Kong代理端口:http://ip:8000
Konga UI管理:http://ip:8001
$ yum install kong-2.3.3.el7.amd64.rpm --nogpgcheck --安装部署
$ wget https://bintray.com/kong/kong-rpm/rpm -O bintray-kong-kong-rpm.repo
$ export major_version=`grep -oE '[0-9]+.[0-9]+' /etc/redhat-release | cut -d "." -f1`
$ sed -i -e 's/baseurl.*/&/centos/'$major_version''/ bintray-kong-kong-rpm.repo
$ sudo mv bintray-kong-kong-rpm.repo /etc/yum.repos.d/
$ sudo yum install -y kong
$ kong config init
database = off
declarative_config = /path/to/kong.yml
$ kong start
YAML manifests
Helm Chart
$ kubectl apply -f https://bit.ly/kong-ingress-dbless
$ helm repo add kong https://charts.konghq.com
$ helm repo update
$ helm install kong/kong
以上是关于开箱即用的云原生微服务网关Kong | 留言送书的主要内容,如果未能解决你的问题,请参考以下文章
2.Kong入门与实战 基于Nginx和OpenResty的云原生微服务网关 --- Kong 的安装和基本概念
3.Kong入门与实战 基于Nginx和OpenResty的云原生微服务网关 --- Kong 的管理运维
5.Kong入门与实战 基于Nginx和OpenResty的云原生微服务网关 --- Kong 的配置详解
9.Kong入门与实战 基于Nginx和OpenResty的云原生微服务网关 --- 高级进阶