Kong Gateway 구성 동기화
Kong Gateway 구성 동기화 (deck gateway sync)
deck gateway sync 명령어는 선언형 구성 파일에 적힌 값에 맞춰 대상 Kong Gateway의 구성을 그대로 맞춰 주는 도구예요
출처: 문서
본문
제공된 선언형 구성 파일에 없는 Kong Gateway의 구성은
deck gateway sync를 사용할 때 삭제돼요. 부분 구성을 적용하려면 태그를 사용하세요.
deck gateway sync 명령어는 위치 인자로 하나 이상의 파일을 받을 수 있어요:
# Sync a single file
deck gateway sync kong.yaml
위치 인자 외에도, deck gateway sync는 파이프라인에서 사용할 수 있도록 stdin에서 입력을 읽을 수 있어요:
# Remove example-service from the file before syncing
cat kong.yaml | yq 'del(.services[] | select(.name == "example-service"))' | deck gateway sync
여러 파일 동기화하기
여러 파일을 한 번에 동기화하면 decK가 동기화하기 전에 제공된 모든 파일을 하나의 구성으로 병합해요. 구성을 독립적인 단위로 나누려면 태그를 사용하세요.
decK는 단일 파일 대신 디렉터리 안의 여러 JSON 또는 YAML 파일을 결합해서 상태를 구성할 수 있어요.
대부분의 사용 사례에서는 단일 파일로 충분하지만, 다음과 같은 경우에는 여러 파일을 사용하고 싶을 수 있어요:
- 각 Service별로 파일을 정리하고 싶을 때예요. 이 경우 Service마다 파일을 하나씩 두고, 해당 Service와 관련된 Routes, Plugins, 기타 엔티티를 그 파일에 담아둘 수 있어요.
- 구성 파일이 너무 커서 더 작고 이해하기 쉬운 단위로 나누고 싶을 때예요.
# Sync multiple files
deck gateway sync services.yaml consumers.yaml
# Sync a whole directory
deck gateway sync directory/*.yaml
명령어 사용법
Usage:
deck gateway sync [flags] [kong-state-files...]
Flags:
--consumer-group-policy-overrides allow deck to sync consumer-group policy overrides.
This allows policy overrides to work with Kong GW versions >= 3.4
Warning: do not mix with consumer-group scoped plugins
--db-update-propagation-delay db_update_propagation artificial delay (in seconds) that is injected between insert operations
for related entities (usually for Cassandra deployments).
See db_update_propagation in kong.conf.
-W, --errors-as-warnings string Treat the given comma-separated diagnostic codes as warnings.
-h, --help help for sync
--include-plugin-definitions allow deck to sync plugin definitions.
Plugin definitions work with Konnect and Gateway versions >= 3.15.
--json-output generate command execution report in a JSON format
--no-mask-deck-env-vars-value do not mask DECK_ environment variable values at diff output.
--parallelism int Maximum number of concurrent operations. (default 10)
--rbac-resources-only diff only the RBAC resources (Kong Enterprise only).
--select-tag strings only entities matching tags specified via this flag are synced.
When this setting has multiple tag values, entities must match every tag.
All entities in the state file will get the select-tags assigned if not present already.
--silence-events disable printing events to stdout
--skip-ca-certificates do not sync CA certificates.
--skip-consumers do not sync consumers, consumer-groups or any plugins associated with them.
--skip-consumers-with-consumer-groups do not show the association between consumer and consumer-group.
If set to true, deck skips listing consumers with consumer-groups,
thus gaining some performance with large configs.
Usage of this flag without apt select-tags and default-lookup-tags can be problematic.
--skip-hash-for-basic-auth do not sync hash for basic auth credentials.
This flag is only valid with Konnect.
-E, --warnings-as-errors string Treat the given comma-separated diagnostic codes as errors.
-w, --workspace string Sync configuration to a specific workspace (Kong Enterprise only).
This takes precedence over _workspace fields in state files.
--yes yes assume yes to prompts and run non-interactively.
관련 리소스
더 알아보기 (Learn more)
- 선언형 구성의 일부만 적용하고 싶을 때 태그로 구성을 나누는 방법을 소개해요 — use tags
- deck gateway에서 사용할 수 있는 다른 명령어들도 함께 확인해 보세요 — deck gateway commands