calicoctl patch
calicoctl patch 명령어는 기존 Calico 리소스 하나를 제자리에서 부분 업데이트해요. replace처럼 리소스 전체를 넘기지 않고도 특정 필드만 바꿀 수 있습니다. 이 문서는 명령어의 도움말, 예제, 옵션을 소개합니다.
출처: 문서
본문
이 문서는 calicoctl patch 명령어를 설명합니다.
calicoctl 명령어 전체 목록은 calicoctl 커맨드라인 인터페이스 사용자 참조를 읽어보세요.
'calicoctl patch' 명령어 도움말 표시하기
calicoctl patch --help를 실행하면 명령어의 다음 도움말 메뉴가 표시돼요.
Patch a single existing Calico resource in place. Use patch to change specific
fields without supplying the whole resource, as you'd have to with replace.
Usage:
calicoctl patch KIND NAME [flags]
Examples:
# Set a route reflector cluster ID on a node.
calicoctl patch node node-0 --patch '{"spec":{"bgp":{"routeReflectorClusterID":"224.0.0.1"}}}'
Flags:
-c, --config string Path to the file containing connection configuration in YAML or JSON format. (default "/etc/calico/calicoctl.cfg")
-h, --help help for patch
-n, --namespace string Namespace of the resource.
-p, --patch string Spec to use to patch the resource.
-t, --type string Format of patch type: strategic, json, or merge. (default "strategic")
Global Flags:
--allow-version-mismatch Allow client and cluster versions mismatch
--context string The name of the kubeconfig context to use
-l, --log-level string Set the log level (panic, fatal, error, warn, info, debug) (default "panic")
예제
-
IP 풀을 패치해 outgoing NAT를 활성화합니다:
calicoctl patch ippool ippool1 -p '{"spec":{"natOutgoing": true}}'리소스가 성공적으로 패치되었다는 결과가 표시돼요:
Successfully patched 1 'ipPool' resource
옵션
-p, --patch string Spec to use to patch the resource.
-t, --type string Format of patch type: strategic, json, or merge. (default "strategic")
-n, --namespace string Namespace of the resource.
일반 옵션
-c, --config string Path to the file containing connection configuration in YAML or JSON format. (default "/etc/calico/calicoctl.cfg")
함께 보기
- calicoctl 설치하기
- 파일 형식과 스키마를 포함한 모든 유효한 리소스의 자세한 내용은 리소스(Resources)
더 알아보기 (Learn more)
patch는 리소스 전체를 통째로 교체하는 replace와 달리 일부 필드만 바꿀 때 적합해요. strategic, json, merge 세 가지 패치 형식의 차이도 기억해두면 좋습니다.