Pipeline CLI(tkn) 참조


Red Hat OpenShift Pipelines 1.17

OpenShift Pipelines에 대한 tkn CLI 참조

Red Hat OpenShift Documentation Team

초록

이 문서에서는 OpenShift Pipelines용 tkn CLI 툴을 설치, 구성 및 사용하는 방법에 대한 정보를 제공합니다.

1장. tkn 설치

CLI 툴을 사용하여 터미널에서 Red Hat OpenShift Pipelines를 관리합니다. 다른 플랫폼에 CLI 툴을 설치할 수 있습니다.

참고

아카이브와 RPM 모두에 다음과 같은 실행 파일이 포함되어 있습니다.

  • tkn
  • tkn-pac
  • opc
중요

opc CLI 툴을 사용하여 Red Hat OpenShift Pipelines를 실행하는 것은 기술 프리뷰 기능입니다. 기술 프리뷰 기능은 Red Hat 프로덕션 서비스 수준 계약(SLA)에서 지원되지 않으며 기능적으로 완전하지 않을 수 있습니다. 따라서 프로덕션 환경에서 사용하는 것은 권장하지 않습니다. 이러한 기능을 사용하면 향후 제품 기능을 조기에 이용할 수 있어 개발 과정에서 고객이 기능을 테스트하고 피드백을 제공할 수 있습니다.

Red Hat 기술 프리뷰 기능의 지원 범위에 대한 자세한 내용은 기술 프리뷰 기능 지원 범위를 참조하십시오.

1.1. Linux에서 Red Hat OpenShift Pipelines CLI 설치

Linux 배포판의 경우 CLI를 tar.gz 아카이브로 다운로드할 수 있습니다.

  1. 아카이브의 압축을 풉니다.

    $ tar xvzf <file>
  2. tkn , tkn -pac, opc 파일의 위치를 PATH 환경 변수에 추가합니다.
  3. PATH 를 확인하려면 다음 명령을 실행합니다.

    $ echo $PATH

1.2. RPM을 사용하여 Linux에 Red Hat OpenShift Pipelines CLI 설치

RHEL(Red Hat Enterprise Linux) 버전 8의 경우 Red Hat OpenShift Pipelines CLI를 RPM으로 설치할 수 있습니다.

사전 요구 사항

  • Red Hat 계정에 활성 OpenShift Container Platform 서브스크립션이 있어야 합니다.
  • 로컬 시스템에 root 또는 sudo 권한이 있어야 합니다.

프로세스

  1. Red Hat Subscription Manager에 등록합니다.

    # subscription-manager register
  2. 최신 서브스크립션 데이터를 가져옵니다.

    # subscription-manager refresh
  3. 사용 가능한 서브스크립션을 나열하십시오.

    # subscription-manager list --available --matches '*pipelines*'
  4. 이전 명령의 출력에서 OpenShift Container Platform 서브스크립션의 풀 ID를 찾아서 이 서브스크립션을 등록된 시스템에 연결합니다.

    # subscription-manager attach --pool=<pool_id>
  5. Red Hat OpenShift Pipelines에 필요한 리포지터리를 활성화합니다.

    • Linux (x86_64, amd64)

      # subscription-manager repos --enable="pipelines-1.17-for-rhel-8-x86_64-rpms"
    • Linux on IBM zSystems and IBM® LinuxONE (s390x)

      # subscription-manager repos --enable="pipelines-1.17-for-rhel-8-s390x-rpms"
    • Linux on IBM Power (ppc64le)

      # subscription-manager repos --enable="pipelines-1.17-for-rhel-8-ppc64le-rpms"
    • Linux on ARM (aarch64, arm64)

      # subscription-manager repos --enable="pipelines-1.17-for-rhel-8-aarch64-rpms"
  6. openshift-pipelines-client 패키지를 설치합니다.

    # yum install openshift-pipelines-client

CLI를 설치한 후 tkn 명령을 사용할 수 있습니다.

$ tkn version

1.3. Windows에서 Red Hat OpenShift Pipelines CLI 설치

Windows의 경우 CLI를 zip 아카이브로 다운로드할 수 있습니다.

프로세스

  1. CLI 툴 을 다운로드합니다.
  2. ZIP 프로그램으로 아카이브의 압축을 풉니다.
  3. tkn , tkn -pac, opc 파일의 위치를 PATH 환경 변수에 추가합니다.
  4. PATH 를 확인하려면 다음 명령을 실행합니다.

    C:\> path

1.4. macOS에서 Red Hat OpenShift Pipelines CLI 설치

macOS의 경우 CLI를 tar.gz 아카이브로 다운로드할 수 있습니다.

프로세스

  1. 관련 CLI 툴을 다운로드합니다.

  2. 아카이브의 압축을 해제하고 압축을 풉니다.
  3. tkn , tkn -pac, opc 파일의 위치를 PATH 환경 변수에 추가합니다.
  4. PATH 를 확인하려면 다음 명령을 실행합니다.

    $ echo $PATH

2장. OpenShift Pipelines tkn CLI 구성

탭 완료가 활성화되도록 Red Hat OpenShift Pipelines tkn CLI를 구성합니다.

2.1. 탭 완료 활성화

tkn CLI를 설치한 후에는 탭 완료를 활성화하여 자동으로 tkn 명령을 완료하거나 탭을 누를 때 옵션을 제안하도록 할 수 있습니다.

사전 요구 사항

  • tkn CLI 툴이 설치되어 있어야 합니다.
  • 로컬 시스템에 bash-completion이 설치되어 있어야 합니다.

프로세스

Bash 탭 완료를 활성화하는 절차는 다음과 같습니다.

  1. Bash 완료 코드를 파일에 저장합니다.

    $ tkn completion bash > tkn_bash_completion
  2. 파일을 /etc/bash_completion.d/에 복사합니다.

    $ sudo cp tkn_bash_completion /etc/bash_completion.d/

    또는 파일을 로컬 디렉터리에 저장하여 .bashrc 파일에서 소싱할 수도 있습니다.

새 터미널을 열면 탭 완료가 활성화됩니다.

3장. OpenShift Pipelines tkn 참조

이 섹션에는 기본 tkn CLI 명령이 나열됩니다.

3.1. 기본 구문

tkn [command or options] [arguments…​]

3.2. 글로벌 옵션

--help, -h

3.3. 유틸리티 명령

3.3.1. tkn

tkn CLI의 상위 명령입니다.

예: 모든 옵션 표시

$ tkn

3.3.2. completion [shell]

대화형 완료를 제공하려면 평가해야 하는 쉘 완료 코드를 출력합니다. 지원되는 쉘은 bashzsh입니다.

예: bash 쉘 완료 코드

$ tkn completion bash

3.3.3. version

tkn CLI의 버전 정보를 출력합니다.

예: tkn 버전 확인

$ tkn version

3.4. 파이프라인 관리 명령

3.4.1. pipeline

파이프라인을 관리합니다.

예: 도움말 표시

$ tkn pipeline --help

3.4.2. pipeline delete

파이프라인을 삭제합니다.

예: 네임스페이스에서 파이프라인 삭제

$ tkn pipeline delete <pipeline_name> -n <namespace_name>

3.4.3. pipeline describe

파이프라인을 설명합니다.

예: 파이프라인 설명

$ tkn pipeline describe <pipeline_name>

3.4.4. pipeline list

파이프라인 목록을 표시합니다.

예: 파이프라인 목록 표시

$ tkn pipeline list

3.4.5. pipeline logs

특정 파이프라인의 로그를 표시합니다.

예: 파이프라인의 라이브 로그 스트리밍

$ tkn pipeline logs -f <pipeline_name>

3.4.6. pipeline start

파이프라인을 시작합니다.

예: 파이프라인 시작

$ tkn pipeline start <pipeline_name>

3.5. 파이프라인 실행 명령

3.5.1. pipelinerun

파이프라인 실행을 관리합니다.

예: 도움말 표시

$ tkn pipelinerun -h

3.5.2. pipelinerun cancel

파이프라인 실행을 취소합니다.

예: 네임스페이스에서 파이프라인 실행 취소

$ tkn pipelinerun cancel <pipeline_run_name> -n <namespace_name>

3.5.3. pipelinerun delete

파이프라인 실행을 삭제합니다.

예: 네임스페이스에서 파이프라인 실행 삭제

$ tkn pipelinerun delete <pipeline_run_name_1> <pipeline_run_name_2> -n <namespace_name>

예: 가장 최근에 실행한 5개의 파이프라인 실행을 제외하고 네임스페이스에서 모든 파이프라인 실행 삭제

$ tkn pipelinerun delete -n <namespace_name> --keep 5 1

1
5 를 유지하려는 가장 최근에 실행된 파이프라인 실행 수로 바꿉니다.

예: 모든 파이프라인 삭제

$ tkn pipelinerun delete --all

참고

Red Hat OpenShift Pipelines 1.6부터 tkn pipelinerun delete --all 명령은 실행 중 상태인 리소스를 삭제하지 않습니다.

3.5.4. pipelinerun describe

파이프라인 실행을 설명합니다.

예: 네임스페이스에서 파이프라인 실행 설명

$ tkn pipelinerun describe <pipeline_run_name> -n <namespace_name>

3.5.5. pipelinerun list

파이프라인 실행을 나열합니다.

예: 네임스페이스에서 파이프라인 실행 목록 표시

$ tkn pipelinerun list -n <namespace_name>

3.5.6. pipelinerun logs

파이프라인 실행 로그를 표시합니다.

예: 네임스페이스의 모든 작업 및 단계로 파이프라인 실행 로그 표시

$ tkn pipelinerun logs <pipeline_run_name> -a -n <namespace_name>

3.6. 작업 관리 명령

3.6.1. task

작업을 관리합니다.

예: 도움말 표시

$ tkn task -h

3.6.2. task delete

작업을 삭제합니다.

예: 네임스페이스에서 작업 삭제

$ tkn task delete <task_name_1> <task_name_2> -n <namespace_name>

3.6.3. task describe

작업을 설명합니다.

예: 네임스페이스의 작업 설명

$ tkn task describe <task_name> -n <namespace_name>

3.6.4. task list

작업을 나열합니다.

예: 네임스페이스의 모든 작업 나열

$ tkn task list -n <namespace_name>

3.6.5. task start

작업을 시작합니다.

예: 네임스페이스에서 작업 시작

$ tkn task start <task_name> -s <service_account_name> -n <namespace_name>

3.7. 작업 실행 명령

3.7.1. taskrun

작업 실행을 관리합니다.

예: 도움말 표시

$ tkn taskrun -h

3.7.2. taskrun cancel

작업 실행을 취소합니다.

예: 네임스페이스에서 작업 실행 취소

$ tkn taskrun cancel <task_run_name> -n <namespace_name>

3.7.3. taskrun delete

TaskRun을 삭제합니다.

예: 네임스페이스에서 작업 실행 삭제

$ tkn taskrun delete <task_run_name_1> <task_run_name_2> -n <namespace_name>

예: 네임스페이스에서 가장 최근에 실행한 5개의 작업을 모두 삭제합니다.

$ tkn taskrun delete -n <namespace_name> --keep 5 1

1
5 를 유지하려는 가장 최근에 실행된 작업 실행 수로 바꿉니다.

3.7.4. taskrun describe

작업 실행을 설명합니다.

예: 네임스페이스에서 작업 실행 설명

$ tkn taskrun describe <task_run_name> -n <namespace_name>

3.7.5. taskrun list

작업 실행을 나열합니다.

예: 네임스페이스에서 모든 작업 실행 나열

$ tkn taskrun list -n <namespace_name>

3.7.6. taskrun logs

작업 실행 로그를 표시합니다.

예: 네임스페이스에서 작업 실행의 실시간 로그 표시

$ tkn taskrun logs -f <task_run_name> -n <namespace_name>

3.8. 파이프라인 리소스 관리 명령

3.8.1. resource

파이프라인 리소스를 관리합니다.

예: 도움말 표시

$ tkn resource -h

3.8.2. resource create

파이프라인 리소스를 생성합니다.

예: 네임스페이스에서 파이프라인 리소스 생성

$ tkn resource create -n myspace

이 명령은 리소스 이름, 리소스 유형, 리소스 유형 기반 값 입력을 요청하는 대화형 명령입니다.

3.8.3. resource delete

파이프라인 리소스를 삭제합니다.

예: 네임스페이스에서 myresource 파이프라인 리소스 삭제

$ tkn resource delete myresource -n myspace

3.8.4. resource describe

파이프라인 리소스를 설명합니다.

예: myresource 파이프라인 리소스 설명

$ tkn resource describe myresource -n myspace

3.8.5. resource list

파이프라인 리소스를 나열합니다.

예: 네임스페이스의 모든 파이프 라인 리소스 나열

$ tkn resource list -n myspace

3.9. 트리거 관리 명령

3.9.1. eventlistener

EventListener를 관리합니다.

예: 도움말 표시

$ tkn eventlistener -h

3.9.2. eventlistener delete

EventListener를 삭제합니다.

예: 네임스페이스에서 mylistener1mylistener2 EventListener 삭제

$ tkn eventlistener delete mylistener1 mylistener2 -n myspace

3.9.3. eventlistener describe

EventListener를 설명합니다.

예: 네임스페이스의 mylistener EventListener 설명

$ tkn eventlistener describe mylistener -n myspace

3.9.4. eventlistener list

EventListener를 나열합니다.

예: 네임스페이스의 모든 EventListener 나열

$ tkn eventlistener list -n myspace

3.9.5. eventlistener logs

EventListener 로그 표시

예: 네임스페이스의 mylistener EventListener 로그 표시

$ tkn eventlistener logs mylistener -n myspace

3.9.6. triggerbinding

TriggerBinding을 관리합니다.

예: TriggerBinding 도움말 표시

$ tkn triggerbinding -h

3.9.7. triggerbinding delete

TriggerBinding을 삭제합니다.

예: 네임스페이스에서 mybinding1mybinding2 TriggerBinding 삭제

$ tkn triggerbinding delete mybinding1 mybinding2 -n myspace

3.9.8. triggerbinding describe

TriggerBinding을 설명합니다.

예: 네임스페이스의 mybinding TriggerBinding 설명

$ tkn triggerbinding describe mybinding -n myspace

3.9.9. triggerbinding list

TriggerBinding을 나열합니다.

예: 네임스페이스의 모든 TriggerBinding 나열

$ tkn triggerbinding list -n myspace

3.9.10. triggertemplate

TriggerTemplate을 관리합니다.

예: TriggerTemplate 도움말 표시

$ tkn triggertemplate -h

3.9.11. triggertemplate delete

TriggerTemplate을 삭제합니다.

예: 네임스페이스에서 mytemplate1mytemplate2 TriggerTemplate 삭제

$ tkn triggertemplate delete mytemplate1 mytemplate2 -n `myspace`

3.9.12. triggertemplate describe

TriggerTemplate을 설명합니다.

예: 네임스페이스의 mytemplate TriggerTemplate 설명

$ tkn triggertemplate describe mytemplate -n `myspace`

3.9.13. triggertemplate list

TriggerTemplate을 나열합니다.

예: 네임스페이스의 모든 TriggerTemplate 나열

$ tkn triggertemplate list -n myspace

3.9.14. clustertriggerbinding

Manage ClusterTriggerBindings.

예: ClusterTriggerBinding 도움말 표시

$ tkn clustertriggerbinding -h

3.9.15. clustertriggerbinding delete

ClusterTriggerBinding을 삭제합니다.

예: myclusterbinding1myclusterbinding2 ClusterTriggerBinding 삭제

$ tkn clustertriggerbinding delete myclusterbinding1 myclusterbinding2

3.9.16. clustertriggerbinding describe

ClusterTriggerBinding을 설명합니다.

예: myclusterbinding ClusterTriggerBinding 설명

$ tkn clustertriggerbinding describe myclusterbinding

3.9.17. clustertriggerbinding list

ClusterTriggerBinding을 나열합니다.

예: 모든 ClusterTriggerBinding 나열

$ tkn clustertriggerbinding list

3.10. Hub 상호 작용 명령

작업 및 파이프라인과 같은 리소스에 대해 Tekton Hub와 상호 작용합니다.

3.10.1. hub

hub와 상호 작용.

예: 도움말 표시

$ tkn hub -h

예: hub API 서버와 상호 작용

$ tkn hub --api-server https://api.hub.tekton.dev

참고

각 예에서는 해당 하위 명령 및 플래그를 가져오려면 tkn hub <command> --help를 실행합니다.

3.10.2. hub downgrade

설치된 리소스를 다운그레이드합니다.

예: mynamespace 네임스페이스의 mytask 작업을 이전 버전으로 다운그레이드

$ tkn hub downgrade task mytask --to version -n mynamespace

3.10.3. hub get

이름, 종류, 카탈로그, 버전 별로 리소스 매니페스트를 가져옵니다.

예: tekton 카탈로그에서 특정 버전의 myresource 파이프라인 또는 작업에 대한 매니페스트 가져오기

$ tkn hub get [pipeline | task] myresource --from tekton --version version

3.10.4. hub info

이름, 종류, 카탈로그, 버전으로 리소스에 대한 정보를 표시합니다.

예: tekton 카탈로그에서 특정 버전의 mytask 작업에 대한 정보 표시

$ tkn hub info task mytask --from tekton --version version

3.10.5. hub install

종류, 이름 및 버전으로 카탈로그에서 리소스를 설치합니다.

예: mynamespace 네임스페이스의 tekton 카탈로그에서 특정 버전의 mytask 작업 설치

$ tkn hub install task mytask --from tekton --version version -n mynamespace

3.10.6. hub reinstall

리소스 종류와 이름을 사용하여 리소스를 다시 설치합니다.

예: mynamespace 네임스페이스의 tekton 카탈로그에서 특정 버전의 mytask 작업 재설치

$ tkn hub reinstall task mytask --from tekton --version version -n mynamespace

3.10.8. hub upgrade

설치된 리소스를 업그레이드합니다.

예: mynamespace 네임스페이스에 설치된 mytask 작업을 새 버전으로 업그레이드

$ tkn hub upgrade task mytask --to version -n mynamespace

법적 공지

Copyright © 2025 Red Hat, Inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.
Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

© 2024 Red Hat, Inc.