文章
Michael Lei · 十月 10, 2022 阅读大约需 2 分钟

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

Kong提供了一个开源的配置管理工具(用Go语言编写),称为decK(即声明式Kong,declarative 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 16
讨论 (0)1
登录或注册以继续