1장. Camel K 통합 관리
Camel K 명령줄을 사용하거나 개발 툴을 사용하여 Red Hat Integration - Camel K 통합을 관리할 수 있습니다. 이 장에서는 명령줄에서 Camel K 통합을 관리하는 방법을 설명하고 VS Code 개발 툴 사용 방법을 설명하는 추가 리소스에 대한 링크를 제공합니다.
1.1. Camel K 통합 관리
Camel K는 명령줄에서 OpenShift 클러스터에서 Camel K 통합을 관리하는 다양한 옵션을 제공합니다. 이 섹션에서는 다음 명령을 사용하는 간단한 예를 보여줍니다.
-
kamel get
-
Kamel describe
-
Kamel 로그
-
Kamel 삭제
사전 요구 사항
- Camel K 개발 환경 설정
- Java 또는 YAML DSL으로 작성된 Camel 통합이 이미 있어야 합니다.
절차
Camel K Operator가 OpenShift 클러스터에서 실행 중인지 확인합니다. 예를 들면 다음과 같습니다.
oc get pod
NAME READY STATUS RESTARTS AGE camel-k-operator-86b8d94b4-pk7d6 1/1 Running 0 6m28s
kamel run
명령을 입력하여 OpenShift의 클라우드에서 통합을 실행합니다. 예를 들면 다음과 같습니다.kamel run hello.camelk.yaml
integration "hello" created
kamel get
명령을 입력하여 통합 상태를 확인합니다.kamel get
NAME PHASE KIT hello Building Kit kit-bqatqib5t4kse5vukt40
kamel describe
명령을 입력하여 통합에 대한 자세한 정보를 출력합니다.kamel describe integration hello
Name: hello Namespace: myproject Creation Timestamp: Fri, 13 Aug 2021 16:23:21 +0200 Phase: Building Kit Runtime Version: 1.7.1.fuse-800025-redhat-00001 Kit: myproject/kit-c4ci6mbe9hl5ph5c9sjg Image: Version: 1.6.6 Dependencies: camel:core camel:log camel:timer mvn:org.apache.camel.k:camel-k-runtime mvn:org.apache.camel.quarkus:camel-quarkus-yaml-dsl Sources: Name Language Compression Ref Ref Key camel-k-embedded-flow.yaml yaml false Conditions: Type Status Reason Message IntegrationPlatformAvailable True IntegrationPlatformAvailable myproject/camel-k IntegrationKitAvailable True IntegrationKitAvailable kit-c4ci6mbe9hl5ph5c9sjg CronJobAvailable False CronJobNotAvailableReason different controller strategy used (deployment) DeploymentAvailable True DeploymentAvailable deployment name is hello KnativeServiceAvailable False KnativeServiceNotAvailable different controller strategy used (deployment) Ready True ReplicaSetReady
kamel log
명령을 입력하여 로그를stdout
에 출력합니다.kamel log hello
... [1] 2021-08-13 14:37:15,860 INFO [info] (Camel (camel-1) thread #0 - timer://yaml) Exchange[ExchangePattern: InOnly, BodyType: String, Body: Hello Camel K from yaml] ...
-
Ctrl-C
를 눌러 터미널에서 로깅을 종료합니다. kamel delete
를 입력하여 OpenShift에 배포된 통합을 삭제합니다.kamel delete hello
Integration hello deleted
추가 리소스
- 로깅에 대한 자세한 내용은 Managing Camel K integration logging levels에서 참조하십시오.
- 배포 전환 시간을 단축하려면 개발 모드에서 Camel K 통합 실행을참조하십시오.
- 통합을 관리하는 개발 툴에 대한 자세한 내용은 VS Code Tooling for Apache Camel K by Red Hat에서 참조하십시오.