Kong provides an open source configuration management tool (written in Go), called decK (which stands for declarative Kong)
- Check that decK recognizes your Kong Gateway installation via deck gateway ping
deck gateway ping Successfully connected to Kong! Kong version: 3.4.3.11
- Export Kong Gateway configuration to a file named "kong.yaml" via deck gateway dump
deck gateway dump -o kong.yaml
- After modifying the IP adcresses in kong.yaml file, show the differences via deck gateway diff
deck gateway diff kong.yaml updating service test-iris { "connect_timeout": 60000, "enabled": true, - "host": "192.168.65.1", + "host": "172.24.156.176", "id": "8fc9849d-9e61-402d-bcad-c3e611808892", "name": "test-iris", "port": 9092, "protocol": "http", "read_timeout": 60000, "retries": 5, "write_timeout": 60000 } updating service uct { "connect_timeout": 60000, "enabled": true, - "host": "192.168.65.1", + "host": "172.24.156.176", "id": "96ad587e-8921-4d6c-acb7-3f7f7a7cc072", "name": "uct", "path": "/api/uct/", "port": 9092, "protocol": "http", "read_timeout": 60000, "retries": 5, "write_timeout": 60000 } Summary: Created: 0 Updated: 2 Deleted: 0
- Apply changes via deck gateway sync
deck gateway sync kong.yaml updating service uct { "connect_timeout": 60000, "enabled": true, - "host": "192.168.65.1", + "host": "172.24.156.176", "id": "96ad587e-8921-4d6c-acb7-3f7f7a7cc072", "name": "uct", "path": "/api/uct/", "port": 9092, "protocol": "http", "read_timeout": 60000, "retries": 5, "write_timeout": 60000 } updating service test-iris { "connect_timeout": 60000, "enabled": true, - "host": "192.168.65.1", + "host": "172.24.156.176", "id": "8fc9849d-9e61-402d-bcad-c3e611808892", "name": "test-iris", "port": 9092, "protocol": "http", "read_timeout": 60000, "retries": 5, "write_timeout": 60000 } Summary: Created: 0 Updated: 2 Deleted: 0
- Export the configuration of a workspace via deck gateway dump --workspace myworkspace
deck gateway dump --workspace workspace1
- Deploy a workspace via deck gateway sync workspace1.yaml --workspace workspace1
deck gateway sync workspace1.yaml --workspace workspace1
For more information :
https://docs.konghq.com/deck/get-started