This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.5.11.2. Knative CLI를 사용하여 채널 생성
Knative(kn
) CLI를 사용하여 채널을 생성하면 YAML 파일을 직접 수정하는 것보다 더 간소화되고 직관적인 사용자 인터페이스를 제공합니다. kn channel create
명령을 사용하여 채널을 생성할 수 있습니다.
사전 요구 사항
- OpenShift Serverless Operator 및 Knative Eventing이 클러스터에 설치되어 있습니다.
-
Knative(
kn
) CLI가 설치되어 있습니다. - 프로젝트를 생성했거나 OpenShift Container Platform에서 애플리케이션 및 기타 워크로드를 생성하는 데 적절한 역할 및 권한이 있는 프로젝트에 액세스할 수 있습니다.
절차
채널을 생성합니다.
kn channel create <channel_name> --type <channel_type>
$ kn channel create <channel_name> --type <channel_type>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 채널 유형은 선택 사항이지만 지정된 위치는
Group:Version:Kind
형식으로 지정해야 합니다. 예를 들면InMemoryChannel
오브젝트를 생성할 수 있습니다.kn channel create mychannel --type messaging.knative.dev:v1:InMemoryChannel
$ kn channel create mychannel --type messaging.knative.dev:v1:InMemoryChannel
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 출력 예
Channel 'mychannel' created in namespace 'default'.
Channel 'mychannel' created in namespace 'default'.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
검증
채널이 존재하는지 확인하려면 기존 채널을 나열하고 출력을 검사합니다.
kn channel list
$ kn channel list
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 출력 예
kn channel list NAME TYPE URL AGE READY REASON mychannel InMemoryChannel http://mychannel-kn-channel.default.svc.cluster.local 93s True
kn channel list NAME TYPE URL AGE READY REASON mychannel InMemoryChannel http://mychannel-kn-channel.default.svc.cluster.local 93s True
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
채널 삭제
채널을 삭제합니다.
kn channel delete <channel_name>
$ kn channel delete <channel_name>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow