리소스 삭제
리소스 삭제 (kongctl delete)
kongctl delete는 선언형 구성 파일에 정의된 모든 리소스를 대상 Konnect 조직에서 삭제하는 명령어예요. 테스트 환경을 초기화하거나 알려진 리소스 집합을 실험할 때 주로 쓰고, 일반적인 선언형 구성 워크플로우에서는 자주 사용되지는 않아요. 이 문서에서는 파일 기반 삭제와 삭제 모드 플랜을 활용한 예시, 그리고 개별 리소스를 삭제하는 하위 명령어들을 소개해요. 실행 전에 삭제 대상 변경 사항을 반드시 검토해야 한다는 주의 사항도 함께 확인할 수 있어요
출처: 문서
본문
알려진 리소스 집합으로 실험하거나 테스트 환경을 초기화할 때는 delete를 사용하세요. 선언형 구성 워크플로에서 흔히 쓰이는 부분은 아니에요.
kongctl delete -f <files>는 입력 파일에 대해 delete 모드의 plan을 생성해 실행하는 것과 같아요.
예제
삭제 대상을 미리 보기:
kongctl diff -f config.yaml --mode delete
파일에 선언된 리소스 삭제하기:
kongctl delete -f config.yaml
주의:
delete는 입력 구성에 지정된 모든 리소스를 삭제하는 계획을 세워요. 실행을 승인하기 전에 항상 변경 사항을 확인하세요.
kongctl은 개별 리소스를 직접 삭제하기 위한 다음 도구들도 제공해요:
kongctl delete konnect
설명: Konnect 토큰을 삭제해요.
kongctl delete organization
설명: Konnect 시스템 계정 리소스를 관리해요.
kongctl delete pat
설명: Konnect 개인 액세스 토큰을 삭제해요.
kongctl delete spat
설명: Konnect 시스템 계정 액세스 토큰을 삭제해요.
명령어 사용법
Usage:
kongctl delete [flags]
kongctl delete [command]
Aliases:
delete, d, D, del, rm, DEL, RM
Examples:
# Delete Konnect resources defined in declarative configuration
kongctl delete -f config.yaml
# Preview deletions before executing them
kongctl delete -f config.yaml --dry-run
# Generate and execute a reviewed delete plan without prompting
kongctl plan --mode delete -f config.yaml --output-file delete-plan.json
kongctl delete --plan delete-plan.json --auto-approve
Available Commands:
konnect Delete Konnect tokens
organization Get current organization information
pat Delete a Konnect personal access token
spat Delete a Konnect system account access token
Flags:
--auto-approve Skip confirmation prompt
--base-dir string Base directory boundary for !file resolution.
Defaults to each -f source root (file: its parent dir, dir: the directory itself). For stdin and URLs, defaults to CWD.
- Config path: [ konnect.declarative.base-dir ]
--base-url string Base URL for Konnect API requests.
- Config path: [ konnect.base-url ]
- Default : [ https://us.api.konghq.com ]
--color-theme string Configures the CLI UI/theme (prompt, tables, TUI elements).
- Config path: [ color-theme ]
- Examples : [ auto, 3024_day, 3024_night, aardvark_blue, abernathy ]
- Reference : [ https://github.com/lrstanley/bubbletint/blob/master/DEFAULT_TINTS.md ] (default "auto")
--config-file string Path to the configuration file to load.
- Environment variable: KONGCTL_CONFIG_FILE (overridden by this flag)
- Default: [ $XDG_CONFIG_HOME/kongctl/config.yaml ]
--dry-run Preview deletions without executing them
--execution-report-file string Save execution report as JSON to file
-f, --filename strings File, directory, URL, or '-' to use to create the resource (can specify multiple)
--force Force deletion even when related resources exist (not configurable)
-h, --help help for delete
--http-retry-backoff-factor float Exponential backoff growth factor for retries (for example: 2.0).
- Config path: [ konnect.http-retry-backoff-factor ]
--http-retry-initial-interval int Initial retry backoff interval in milliseconds (0 = use default).
- Config path: [ konnect.http-retry-initial-interval ]
--http-retry-max-attempts int Maximum total attempts for retryable HTTP requests (0 = use default, 1 disables retries).
- Config path: [ konnect.http-retry-max-attempts ]
--http-retry-max-interval int Maximum retry backoff interval in milliseconds (0 = use default).
- Config path: [ konnect.http-retry-max-interval ]
--http-retry-on-connection-errors Retry selected retryable connection-level errors.
- Config path: [ konnect.http-retry-on-connection-errors ]
--log-file string Write execution logs to the specified file instead of STDERR.
- Config path: [ log-file ]
--log-level string Configures the logging level. Execution logs are written to STDERR.
- Config path: [ log-level ]
- Allowed : [ trace|debug|info|warn|error ] (default "error")
--max-concurrency int Maximum number of concurrent API operations during execution (min 1, max 200).
When the plan contains execution_groups, operations within each group run
concurrently up to this limit. Use 1 for sequential execution.
- Config path: [ konnect.declarative.max-concurrency ] (default 5)
--no-telemetry Disable telemetry for this command invocation. Overrides config and env.
- Config path: [ telemetry.enabled ]
- Env var : [ KONGCTL_NO_TELEMETRY ]
- Default : [ false ]
--no-trunc Preserve full cell widths in static text tables beyond terminal width.
Does not change column selection, UUID formatting, or explicit string slices.
- Config path: [ text.no-trunc ]
- Default : [ false ]
-o, --output string Configures the format of data written to STDOUT.
- Config path: [ output ]
- Allowed : [ json|yaml|text ] (default "text")
--pat string Konnect Personal Access Token (PAT) used to authenticate the CLI.
Setting this value overrides tokens obtained from the login command.
- Config path: [ konnect.pat ]
--plan string Path to existing delete-mode plan file
-p, --profile string Specify the profile to use for this command. (default "default")
-R, --recursive Process the directory used in -f, --filename recursively
--region string Konnect region identifier (for example "eu"). Used to construct the base URL when --base-url is not provided.
- Config path: [ konnect.region ]
--remote-file-auth string Authentication mode for remote -f URL sources (auto|none).
In auto mode, kongctl sends the current Konnect bearer token only to HTTPS Konnect hosts.
- Config path: [ konnect.declarative.remote-file-auth ] (default "auto")
-s, --remote-file-save-dir string Save remote -f URL sources into this local directory before loading
-F, --remote-file-save-force Overwrite existing files when saving remote -f URL sources with --remote-file-save-dir
--require-any-namespace Require explicit namespace on all resources (via kongctl.namespace or _defaults.kongctl.namespace).
Cannot be used with --require-namespace.
- Config path: [ konnect.declarative.require-any-namespace ]
--require-namespace strings Require specific namespaces. Accepts comma-separated list or repeated flags.
Cannot be used with --require-any-namespace.
Examples:
--require-namespace=foo # Allow only 'foo' namespace
--require-namespace=foo,bar # Allow 'foo' or 'bar' (comma-separated)
--require-namespace=foo --require-namespace=bar # Allow 'foo' or 'bar' (repeated flags)
- Config path: [ konnect.declarative.require-namespace ]
--text-id-format string Configure UUID rendering in static text-table ID columns.
- Config path: [ text.id-format ]
- Allowed : [ compact|full ]
- Default : [ compact ]
--text-layout string Configure static text-table column selection.
- Config path: [ text.layout ]
- Allowed : [ compact|auto|wide ]
- Default : [ compact ]
Use "kongctl delete [command] --help" for more information about a command.
관련 리소스
더 알아보기 (Learn more)
- delete는 삭제 모드 플랜 생성 후 실행하는 것과 동일한 동작을 해요 — plan
- 선언형 구성 파일 작성 방법을 전체적으로 이해할 수 있어요 — Declarative configuration with kongctl
- Konnect 토큰을 개별적으로 삭제하는 방법을 확인해요 — kongctl delete konnect
- 조직 리소스를 관리하는 방법을 살펴봐요 — kongctl delete organization
- 개인 액세스 토큰(PAT)을 삭제하는 방법을 알아봐요 — kongctl delete pat
- 시스템 계정 액세스 토큰(SPAT)을 삭제하는 방법을 확인해요 — kongctl delete spat