文章
Michael Lei · 四月 25 阅读大约需 2 分钟

如何在CI/CD Pipeline中管理InterSystems API Manager (Kong GATEWAY)配置?

Kong提供了一个开源的配置管理工具(用Go语言编写),称为decK(代表声明式Kong)

  • 通过deck ping检查deck是否能识别你的Kong Gateway安装
deck ping   
Successfully connected to Kong!
Kong version:  2.3.3.2-enterprise-edition
  • 通过deck dump把 Kong Gateway配置倒出到 "kong.yaml" 文件 
deck dump
  • 修改 kong.yaml以后通过deck diff 通过把区别显示出来
deck diff
updating service alerts  {
   "connect_timeout": 60000,
-  "host": "172.24.156.176",
+  "host": "192.10.10.18",
   "id": "3bdd7db4-0b75-4148-93b3-2ff11e961f64",
   "name": "alerts",
   "path": "/alerts",
   "port": 50200,
   "protocol": "http",
   "read_timeout": 60000,
   "retries": 5,
   "write_timeout": 60000
 }

Summary:
  Created: 0
  Updated: 1
  Deleted: 0
  •  通过 deck sync应用这些变化
deck sync
updating service alerts  {
   "connect_timeout": 60000,
-  "host": "172.24.156.176",
+  "host": "192.10.10.18",
   "id": "3bdd7db4-0b75-4148-93b3-2ff11e961f64",
   "name": "alerts",
   "path": "/alerts",
   "port": 50200,
   "protocol": "http",
   "read_timeout": 60000,
   "retries": 5,
   "write_timeout": 60000
 }

Summary:
  Created: 0
  Updated: 1
  Deleted: 0
deck sync -s workspace1.yaml --workspace workspace1

deck sync -s workspace2.yaml --workspace workspace2

更多信息 :

https://docs.konghq.com/deck/1.11.x/guides/getting-started/

https://docs.konghq.com/deck/1.11.x/guides/best-practices/

0
0 47
讨论 (0)1
登录或注册以继续