CLI 툴

Red Hat OpenShift Service on AWS 4

AWS에서 Red Hat OpenShift Service에 명령줄 툴 사용 방법 알아보기

Red Hat OpenShift Documentation Team

초록

이 문서에서는 AWS의 Red Hat OpenShift Service에서 명령줄 툴을 설치, 구성 및 사용하는 방법에 대한 정보를 제공합니다. CLI 명령에 대한 참조와 사용 방법에 대한 예도 포함되어 있습니다.

1장. Red Hat OpenShift Service on AWS CLI 툴 개요

사용자는 다음과 같은 ROSA(Red Hat OpenShift Service)에서 작업하는 동안 다양한 작업을 수행합니다.

  • 클러스터 관리
  • 애플리케이션 빌드, 배포 및 관리
  • 배포 프로세스 관리
  • Operator 개발
  • Operator 카탈로그 생성 및 유지 관리

ROSA는 사용자가 터미널에서 다양한 관리 및 개발 작업을 수행할 수 있도록 하여 이러한 작업을 단순화하는 CLI(명령줄 인터페이스) 툴 세트를 제공합니다. 이러한 툴은 애플리케이션을 관리하고 시스템의 각 구성 요소와 상호 작용할 수 있는 간단한 명령을 노출합니다.

1.1. CLI 툴 목록

다음 CLI 도구 세트는 ROSA에서 사용할 수 있습니다.

  • OpenShift CLI(oc): 일반적으로 사용되는 개발자 CLI 툴 중 하나입니다. 클러스터 관리자와 개발자 모두 터미널을 사용하여 ROSA에서 엔드 투 엔드 작업을 수행할 수 있습니다. 웹 콘솔과 달리 사용자는 명령 스크립트를 사용하여 프로젝트 소스 코드로 직접 작업할 수 있습니다.
  • Knative CLI(kn): Knative(kn) CLI 툴은 Knative Serving 및 Eventing과 같은 OpenShift Serverless 구성 요소와 상호 작용하는 데 사용할 수 있는 단순하고 직관적인 터미널 명령을 제공합니다.
  • Pipeline CLI(tkn): OpenShift Pipelines는 내부적으로 Tekton을 사용하는 AWS의 Red Hat OpenShift Service의 CI/CD(지속적 통합 및 지속적 제공) 솔루션입니다. tkn CLI 툴에서는 터미널을 사용하여 OpenShift Pipelines와 상호 작용할 수 있는 간단하고 직관적인 명령을 제공합니다.
  • opm CLI: opm CLI 툴을 사용하면 Operator 개발자와 클러스터 관리자가 터미널에서 Operator 카탈로그를 생성하고 유지 관리할 수 있습니다.
  • Operator SDK: Operator 프레임워크의 구성 요소인 Operator SDK는 Operator 개발자가 터미널에서 Operator를 빌드, 테스트 및 배포하는 데 사용할 수 있는 CLI 툴을 제공합니다. Kubernetes 네이티브 애플리케이션을 빌드하는 프로세스를 단순화하여 애플리케이션별 운영 지식이 필요할 수 있습니다.
  • ROSA CLI( rosa CLI): Roa CLI를 사용하여 ROSA 클러스터 및 리소스를 생성, 업데이트, 관리 및 삭제합니다.

2장. OpenShift CLI(oc)

2.1. OpenShift CLI 시작하기

2.1.1. OpenShift CLI 정보

OpenShift CLI(oc)를 사용하면 터미널에서 애플리케이션을 생성하고 AWS(ROSA) 프로젝트에서 Red Hat OpenShift Service를 관리할 수 있습니다. OpenShift CLI를 사용하기에 적합한 경우는 다음과 같습니다.

  • 직접 프로젝트 소스 코드로 작업하는 경우
  • ROSA 작업 스크립팅
  • 대역폭 리소스가 제한되고 웹 콘솔을 사용할 수 없는 상태에서 프로젝트를 관리하는 경우

2.1.2. OpenShift CLI 설치

OpenShift CLI(oc)는 바이너리를 다운로드하거나 RPM을 사용하여 설치할 수 있습니다.

2.1.2.1. 바이너리를 다운로드하여 OpenShift CLI 설치

명령줄 인터페이스에서 ROSA와 상호 작용하기 위해 OpenShift CLI(oc)를 설치할 수 있습니다. Linux, Windows 또는 macOS에 oc를 설치할 수 있습니다.

중요

이전 버전의 oc 를 설치한 경우 ROSA의 모든 명령을 완료하는 데 사용할 수 없습니다. 새 버전의 oc를 다운로드하여 설치합니다.

Linux에서 OpenShift CLI 설치

다음 절차를 사용하여 Linux에서 OpenShift CLI(oc) 바이너리를 설치할 수 있습니다.

절차

  1. Red Hat 고객 포털에서 AWS의 Red Hat OpenShift Service 다운로드 페이지로 이동합니다.
  2. 제품 변형 드롭다운 목록에서 아키텍처를 선택합니다.
  3. 버전 드롭다운 목록에서 적절한 버전을 선택합니다.
  4. OpenShift v4 Linux Client 항목 옆에 있는 지금 다운로드를 클릭하고 파일을 저장합니다.
  5. 아카이브의 압축을 풉니다.

    $ tar xvf <file>
  6. oc 바이너리를 PATH에 있는 디렉터리에 배치합니다.

    PATH를 확인하려면 다음 명령을 실행합니다.

    $ echo $PATH

검증

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

    $ oc <command>
Windows에서 OpenSfhit CLI 설치

다음 절차에 따라 Windows에 OpenShift CLI(oc) 바이너리를 설치할 수 있습니다.

절차

  1. Red Hat 고객 포털에서 AWS의 Red Hat OpenShift Service 다운로드 페이지로 이동합니다.
  2. 버전 드롭다운 목록에서 적절한 버전을 선택합니다.
  3. OpenShift v4 Windows Client 항목 옆에 있는 지금 다운로드를 클릭하고 파일을 저장합니다.
  4. ZIP 프로그램으로 아카이브의 압축을 풉니다.
  5. oc 바이너리를 PATH에 있는 디렉터리로 이동합니다.

    PATH를 확인하려면 명령 프롬프트를 열고 다음 명령을 실행합니다.

    C:\> path

검증

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

    C:\> oc <command>
macOS에 OpenShift CLI 설치

다음 절차에 따라 macOS에서 OpenShift CLI(oc) 바이너리를 설치할 수 있습니다.

절차

  1. Red Hat 고객 포털에서 AWS의 Red Hat OpenShift Service 다운로드 페이지로 이동합니다.
  2. 버전 드롭다운 목록에서 적절한 버전을 선택합니다.
  3. OpenShift v4 macOS Client 항목 옆에 있는 지금 다운로드를 클릭하고 파일을 저장합니다.

    참고

    macOS arm64의 경우 OpenShift v4 macOS arm64 Client 항목을 선택합니다.

  4. 아카이브의 압축을 해제하고 압축을 풉니다.
  5. oc 바이너리 PATH의 디렉터리로 이동합니다.

    PATH를 확인하려면 터미널을 열고 다음 명령을 실행합니다.

    $ echo $PATH

검증

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

    $ oc <command>

2.1.2.2. 웹 콘솔을 사용하여 OpenShift CLI 설치

웹 콘솔에서 ROSA(Red Hat OpenShift Service on AWS)와 상호 작용하기 위해 OpenShift CLI(oc)를 설치할 수 있습니다. Linux, Windows 또는 macOS에 oc를 설치할 수 있습니다.

중요

이전 버전의 oc 를 설치한 경우 ROSA의 모든 명령을 완료하는 데 사용할 수 없습니다. 새 버전의 oc를 다운로드하여 설치합니다.

2.1.2.2.1. 웹 콘솔을 사용하여 Linux에 OpenShift CLI 설치

다음 절차를 사용하여 Linux에서 OpenShift CLI(oc) 바이너리를 설치할 수 있습니다.

절차

  1. OpenShift Cluster Manager의 다운로드 페이지에서 운영 체제용 oc CLI의 최신 버전을 다운로드합니다.
  2. 다운로드한 아카이브에서 oc 바이너리 파일을 추출합니다.

    $ tar xvf <file>
  3. oc 바이너리를 PATH에 있는 디렉터리로 이동합니다.

    PATH를 확인하려면 다음 명령을 실행합니다.

    $ echo $PATH

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

$ oc <command>
2.1.2.2.2. 웹 콘솔을 사용하여 Windows에 OpenShift CLI 설치

다음 절차에 따라 Windows에 OpenShift CLI(oc) 바이너리를 설치할 수 있습니다.

절차

  1. OpenShift Cluster Manager의 다운로드 페이지에서 운영 체제용 oc CLI의 최신 버전을 다운로드합니다.
  2. 다운로드한 아카이브에서 oc 바이너리 파일을 추출합니다.
  3. oc 바이너리를 PATH에 있는 디렉터리로 이동합니다.

    PATH를 확인하려면 명령 프롬프트를 열고 다음 명령을 실행합니다.

    C:\> path

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

C:\> oc <command>
2.1.2.2.3. 웹 콘솔을 사용하여 macOS에 OpenShift CLI 설치

다음 절차에 따라 macOS에서 OpenShift CLI(oc) 바이너리를 설치할 수 있습니다.

절차

  1. OpenShift Cluster Manager의 다운로드 페이지에서 운영 체제용 oc CLI의 최신 버전을 다운로드합니다.
  2. 다운로드한 아카이브에서 oc 바이너리 파일을 추출합니다.
  3. oc 바이너리 PATH의 디렉터리로 이동합니다.

    PATH를 확인하려면 터미널을 열고 다음 명령을 실행합니다.

    $ echo $PATH

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

$ oc <command>

2.1.2.3. RPM을 사용하여 OpenShift CLI 설치

RHEL(Red Hat Enterprise Linux)의 경우 Red Hat 계정에 활성 AWS(ROSA) 서브스크립션이 있는 경우 OpenShift CLI(oc)를 RPM으로 설치할 수 있습니다.

참고

RHEL(Red Hat Enterprise Linux) 9의 RPM으로 OpenShift CLI(oc)를 설치할 수 없습니다. 바이너리를 다운로드하여 RHEL 9용 OpenShift CLI를 설치해야 합니다.

사전 요구 사항

  • root 또는 sudo 권한이 있어야 합니다.

절차

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

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

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

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

    # subscription-manager attach --pool=<pool_id>
  5. ROSA에 필요한 리포지토리를 활성화합니다.

    # subscription-manager repos --enable="rhocp-4-for-rhel-8-x86_64-rpms"
  6. openshift-clients 패키지를 설치합니다.

    # yum install openshift-clients

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

$ oc <command>

2.1.2.4. Homebrew를 사용하여 OpenShift CLI 설치

macOS의 경우 Homebrew 패키지 관리자를 사용하여 OpenShift CLI(oc)를 설치할 수 있습니다.

사전 요구 사항

  • Homebrew(brew)가 설치되어 있어야 합니다.

절차

  • 다음 명령을 실행하여 openshift-cli 패키지를 설치합니다.

    $ brew install openshift-cli

2.1.3. OpenShift CLI에 로그인

OpenShift CLI (oc) 에 로그인하면 클러스터에 액세스하여 관리할 수 있습니다.

사전 요구 사항

  • ROSA 클러스터에 액세스할 수 있어야 합니다.
  • OpenShift CLI(oc)가 설치되어 있어야 합니다.
참고

HTTP 프록시 서버를 통해서만 액세스할 수 있는 클러스터에 액세스하려면 HTTP_PROXY, HTTPS_PROXYNO_PROXY 변수를 설정할 수 있습니다. oc CLI에서는 이러한 환경 변수를 준수하므로 클러스터와의 모든 통신이 HTTP 프록시를 통해 이루어집니다.

인증 헤더는 HTTPS 전송을 사용하는 경우에만 전송됩니다.

절차

  1. oc login 명령을 입력하고 사용자 이름을 전달합니다.

    $ oc login -u user1
  2. 프롬프트가 표시되면 필요한 정보를 입력합니다.

    출력 예

    Server [https://localhost:8443]: https://openshift.example.com:6443 1
    The server uses a certificate signed by an unknown authority.
    You can bypass the certificate check, but any data you send to the server could be intercepted by others.
    Use insecure connections? (y/n): y 2
    
    Authentication required for https://openshift.example.com:6443 (openshift)
    Username: user1
    Password: 3
    Login successful.
    
    You don't have any projects. You can try to create a new project, by running
    
        oc new-project <projectname>
    
    Welcome! See 'oc help' to get started.

    1
    ROSA 서버 URL을 입력합니다.
    2
    비보안 연결 사용 여부를 입력합니다.
    3
    사용자 암호를 입력합니다.
참고

웹 콘솔에 로그인한 경우 토큰 및 서버 정보를 포함하는 oc login 명령을 생성할 수 있습니다. 명령을 사용하여 대화형 프롬프트 없이 OpenShift CLI에 로그인할 수 있습니다. 명령을 생성하려면 웹 콘솔의 오른쪽 상단에 있는 사용자 이름 드롭다운 메뉴에서 로그인 복사 명령을 선택합니다.

이제 클러스터를 관리하기 위한 프로젝트를 생성하거나 다른 명령을 실행할 수 있습니다.

2.1.4. 웹 브라우저를 사용하여 OpenShift CLI에 로그인

웹 브라우저의 도움말을 사용하여 OpenShift CLI(oc)에 로그인하여 클러스터에 액세스하고 관리할 수 있습니다. 이를 통해 사용자는 액세스 토큰을 명령줄에 삽입하지 않을 수 있습니다.

주의

웹 브라우저를 통해 CLI에 로그인하면 HTTPS가 아닌 localhost에서 서버를 실행합니다. 다중 사용자 워크스테이션에서 주의해서 사용합니다.

사전 요구 사항

  • AWS 클러스터의 Red Hat OpenShift Service에 액세스할 수 있어야 합니다.
  • OpenShift CLI(oc)가 설치되어 있어야 합니다.
  • 브라우저가 설치되어 있어야 합니다.

절차

  1. --web 플래그를 사용하여 oc login 명령을 입력합니다.

    $ oc login <cluster_url> --web 1
    1
    선택적으로 서버 URL 및 콜백 포트를 지정할 수 있습니다. 예: oc login <cluster_url> --web --callback-port 8280 localhost:8443.
  2. 웹 브라우저가 자동으로 열립니다. 그렇지 않은 경우 명령 출력의 링크를 클릭합니다. AWS 서버 oc 에서 Red Hat OpenShift Service를 지정하지 않으면 현재 oc 구성 파일에 지정된 클러스터의 웹 콘솔을 열려고 합니다. oc 구성이 없는 경우 oc 에서 서버 URL을 대화형으로 입력하라는 메시지를 표시합니다.

    출력 예

    Opening login URL in the default browser: https://openshift.example.com
    Opening in existing browser session.

  3. 둘 이상의 ID 공급자를 사용할 수 있는 경우 제공된 옵션에서 선택한 항목을 선택합니다.
  4. 해당 브라우저 필드에 사용자 이름과 암호를 입력합니다. 로그인한 후 브라우저에 access token received successfully; please return to your terminal라는 텍스트가 표시됩니다.
  5. CLI에서 로그인 확인을 확인합니다.

    출력 예

    Login successful.
    
    You don't have any projects. You can try to create a new project, by running
    
        oc new-project <projectname>

참고

웹 콘솔은 기본적으로 이전 세션에서 사용된 프로필로 설정됩니다. Administrator와 Developer 프로필 간에 전환하려면 AWS 웹 콘솔의 Red Hat OpenShift Service에서 로그아웃하고 캐시를 지웁니다.

이제 클러스터를 관리하기 위한 프로젝트를 생성하거나 다른 명령을 실행할 수 있습니다.

2.1.5. OpenShift CLI 사용

다음 섹션을 검토하여 CLI로 일반적인 작업을 완료하는 방법을 알아봅니다.

2.1.5.1. 프로젝트 생성

oc new-project 명령을 사용하여 새 프로젝트를 생성합니다.

$ oc new-project my-project

출력 예

Now using project "my-project" on server "https://openshift.example.com:6443".

2.1.5.2. 새 애플리케이션 생성

oc new-app 명령을 사용하여 새 애플리케이션을 생성합니다.

$ oc new-app https://github.com/sclorg/cakephp-ex

출력 예

--> Found image 40de956 (9 days old) in imagestream "openshift/php" under tag "7.2" for "php"

...

    Run 'oc status' to view your app.

2.1.5.3. Pod 보기

oc get pods 명령을 사용하여 현재 프로젝트의 Pod를 봅니다.

참고

Pod 내에서 oc 를 실행하고 네임스페이스를 지정하지 않으면 기본적으로 Pod의 네임스페이스가 사용됩니다.

$ oc get pods -o wide

출력 예

NAME                  READY   STATUS      RESTARTS   AGE     IP            NODE                           NOMINATED NODE
cakephp-ex-1-build    0/1     Completed   0          5m45s   10.131.0.10   ip-10-0-141-74.ec2.internal    <none>
cakephp-ex-1-deploy   0/1     Completed   0          3m44s   10.129.2.9    ip-10-0-147-65.ec2.internal    <none>
cakephp-ex-1-ktz97    1/1     Running     0          3m33s   10.128.2.11   ip-10-0-168-105.ec2.internal   <none>

2.1.5.4. Pod 로그 보기

oc logs 명령을 사용하여 특정 Pod의 로그를 봅니다.

$ oc logs cakephp-ex-1-deploy

출력 예

--> Scaling cakephp-ex-1 to 1
--> Success

2.1.5.5. 현재 프로젝트 보기

oc project 명령을 사용하여 현재 프로젝트를 봅니다.

$ oc project

출력 예

Using project "my-project" on server "https://openshift.example.com:6443".

2.1.5.6. 현재 프로젝트의 상태 보기

oc status 명령을 사용하여 서비스, 배포, 빌드 구성 등 현재 프로젝트에 대한 정보를 봅니다.

$ oc status

출력 예

In project my-project on server https://openshift.example.com:6443

svc/cakephp-ex - 172.30.236.80 ports 8080, 8443
  dc/cakephp-ex deploys istag/cakephp-ex:latest <-
    bc/cakephp-ex source builds https://github.com/sclorg/cakephp-ex on openshift/php:7.2
    deployment #1 deployed 2 minutes ago - 1 pod

3 infos identified, use 'oc status --suggest' to see details.

2.1.5.7. 지원되는 API 리소스 나열

oc api-resources 명령을 사용하여 서버에서 지원되는 API 리소스 목록을 봅니다.

$ oc api-resources

출력 예

NAME                                  SHORTNAMES       APIGROUP                              NAMESPACED   KIND
bindings                                                                                     true         Binding
componentstatuses                     cs                                                     false        ComponentStatus
configmaps                            cm                                                     true         ConfigMap
...

2.1.6. 도움말 가져오기

CLI 명령 및 ROSA 리소스에 대한 도움말은 다음과 같은 방법으로 확인할 수 있습니다.

  • oc help를 사용하여 모든 사용 가능한 CLI 명령 목록 및 설명을 가져옵니다.

    예: CLI에 대한 일반적인 도움말 가져오기

    $ oc help

    출력 예

    OpenShift Client
    
    This client helps you develop, build, deploy, and run your applications on any OpenShift or Kubernetes compatible
    platform. It also includes the administrative commands for managing a cluster under the 'adm' subcommand.
    
    Usage:
      oc [flags]
    
    Basic Commands:
      login           Log in to a server
      new-project     Request a new project
      new-app         Create a new application
    
    ...

  • --help 플래그를 사용하여 특정 CLI 명령에 대한 도움말을 가져옵니다.

    예: oc create 명령에 대한 도움말 가져오기

    $ oc create --help

    출력 예

    Create a resource by filename or stdin
    
    JSON and YAML formats are accepted.
    
    Usage:
      oc create -f FILENAME [flags]
    
    ...

  • oc explain 명령을 사용하여 특정 리소스에 대한 설명 및 필드를 봅니다.

    예: Pod 리소스에 대한 문서 보기

    $ oc explain pods

    출력 예

    KIND:     Pod
    VERSION:  v1
    
    DESCRIPTION:
         Pod is a collection of containers that can run on a host. This resource is
         created by clients and scheduled onto hosts.
    
    FIELDS:
       apiVersion	<string>
         APIVersion defines the versioned schema of this representation of an
         object. Servers should convert recognized schemas to the latest internal
         value, and may reject unrecognized values. More info:
         https://git.k8s.io/community/contributors/devel/api-conventions.md#resources
    
    ...

2.1.7. OpenShift CLI에서 로그아웃

OpenShift CLI에서 로그아웃하여 현재 세션을 종료할 수 있습니다.

  • oc logout 명령을 사용합니다.

    $ oc logout

    출력 예

    Logged "user1" out on "https://openshift.example.com"

이렇게 하면 저장된 인증 토큰이 서버에서 삭제되고 구성 파일에서 제거됩니다.

2.2. OpenShift CLI 구성

2.2.1. 탭 완료 활성화

Bash 또는 Zsh 쉘에 대한 탭 완료를 활성화할 수 있습니다.

2.2.1.1. Bash 탭 완료 활성화

OpenShift CLI(oc)를 설치한 후 탭 완료를 활성화하여 자동으로 oc 명령을 완료하거나 탭을 누를 때 옵션을 제안할 수 있습니다. 다음 절차에서는 Bash 쉘에 대한 탭 완료를 활성화합니다.

사전 요구 사항

  • OpenShift CLI(oc)가 설치되어 있어야 합니다.
  • bash-completion 패키지가 설치되어 있어야 합니다.

절차

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

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

    $ sudo cp oc_bash_completion /etc/bash_completion.d/

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

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

2.2.1.2. Zsh에 탭 완료 활성화

OpenShift CLI(oc)를 설치한 후 탭 완료를 활성화하여 자동으로 oc 명령을 완료하거나 탭을 누를 때 옵션을 제안할 수 있습니다. 다음 절차에서는 Zsh 쉘에 대한 탭 완료를 활성화합니다.

사전 요구 사항

  • OpenShift CLI(oc)가 설치되어 있어야 합니다.

절차

  • oc 의 탭 완료를 .zshrc 파일에 추가하려면 다음 명령을 실행합니다.

    $ cat >>~/.zshrc<<EOF
    if [ $commands[oc] ]; then
      source <(oc completion zsh)
      compdef _oc oc
    fi
    EOF

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

2.3. oc 및 kubectl 명령 사용

Kubernetes CLI(명령줄 인터페이스), kubectl은 Kubernetes 클러스터에 대해 명령을 실행하는 데 사용할 수 있습니다. ROSA(Red Hat OpenShift Service on AWS)는 인증된 Kubernetes 배포판이므로 ROSA와 함께 제공되는 지원되는 kubectl 바이너리를 사용하거나 oc 바이너리를 사용하여 확장된 기능을 얻을 수 있습니다.

2.3.1. oc 바이너리

oc 바이너리는 kubectl 바이너리와 동일한 기능을 제공하지만 다음을 포함하여 추가 ROSA 기능을 지원하도록 기본적으로 확장됩니다.

  • ROSA 리소스 전체 지원

    DeploymentConfig,BuildConfig,Route, ImageStreamTag 오브젝트와 같은 리소스는 ROSA 배포와 관련된 표준 Kubernetes 프리미티브에 따라 빌드됩니다.

  • 인증
  • 추가 명령

    예를 들어 추가 명령 oc new-app을 사용하면 기존 소스 코드 또는 미리 빌드된 이미지를 사용하여 새 애플리케이션을 보다 쉽게 시작할 수 있습니다. 마찬가지로, 추가 명령 oc new-project를 사용하면 기본값으로 전환할 수 있는 프로젝트를 보다 쉽게 시작할 수 있습니다.

중요

이전 버전의 oc 바이너리를 설치한 경우 ROSA의 모든 명령을 완료하는 데 사용할 수 없습니다. 최신 기능을 사용하려면 ROSA 서버 버전에 해당하는 oc 바이너리의 최신 버전을 다운로드하여 설치해야 합니다.

이전 oc 바이너리가 업데이트할 수 있도록 하려면 최소한 두 개의 마이너 릴리스(예:4.1에서 4.2에서 4.3)가 변경됩니다. 새 기능을 사용하려면 최신 oc 바이너리가 필요할 수 있습니다. 4.3 서버에는 4.2 oc 바이너리가 사용할 수 없는 추가 기능이 있을 수 있으며 4.3 oc 바이너리에는 4.2 서버에서 지원하지 않는 추가 기능이 있을 수 있습니다.

표 2.1. 호환성 목록

 

XY(oc 클라이언트)

X.Y+N footnote:versionpolicyn[여기서 N 은 1보다 크거나 같은 숫자임] (oc Client)

X.Y(서버)

redcircle 1

redcircle 3

X.Y+N footnote:versionpolicyn[](Server)

redcircle 2

redcircle 1

redcircle 1 완전하게 호환됩니다.

redcircle 2 oc 클라이언트에서 서버 기능에 액세스하지 못할 수 있습니다.

redcircle 3 oc 클라이언트에서 액세스한 서버와 호환되지 않을 수 있는 옵션과 기능을 제공할 수 있습니다.

2.3.2. kubectl 바이너리

kubectl 바이너리는 표준 Kubernetes 환경에서 들어오는 새로운 ROSA 사용자 또는 kubectl CLI 사용을 선호하는 사용자를 위해 기존 워크플로우 및 스크립트를 지원하는 수단으로 제공됩니다. kubectl 의 기존 사용자는 ROSA 클러스터에 대한 변경없이 Kubernetes 프리미티브와 상호 작용하기 위해 바이너리를 계속 사용할 수 있습니다.

OpenShift CLI 설치 단계에 따라 지원되는 kubectl 바이너리를 설치할 수 있습니다. kubectl 바이너리는 바이너리를 다운로드한 경우 아카이브에 포함되어 있습니다. RPM을 사용하여 CLI를 설치할 때 이 바이너리가 설치됩니다.

자세한 내용은 kubectl 문서를 참조하십시오.

2.4. CLI 프로필 관리

CLI 구성 파일을 사용하면 CLI 툴 개요 와 함께 사용할 수 있도록 다양한 프로필 또는 컨텍스트를 구성할 수 있습니다. 컨텍스트는 닉네임 과 관련된 Red Hat OpenShift Service on AWS(ROSA) 서버 정보로 구성됩니다.

2.4.1. CLI 프로필 간 스위치 정보

컨텍스트를 사용하면 CLI 작업을 사용할 때 여러 ROSA 서버 또는 클러스터에서 여러 사용자 간에 쉽게 전환할 수 있습니다. 닉네임은 컨텍스트, 사용자 인증 정보 및 클러스터 세부 정보에 대한 간단한 참조를 제공하여 CLI 구성을 더 쉽게 관리할 수 있습니다. 사용자가 oc CLI로 처음 로그인한 후 ROSA는 아직 존재하지 않는 경우 ~/.kube/config 파일을 생성합니다. oc 로그인 작업 중에 자동으로 또는 CLI 프로필을 수동으로 구성하여 CLI에 인증 및 연결 세부 정보가 제공되면 업데이트된 정보는 구성 파일에 저장됩니다.

CLI 구성 파일

apiVersion: v1
clusters: 1
- cluster:
    insecure-skip-tls-verify: true
    server: https://openshift1.example.com:8443
  name: openshift1.example.com:8443
- cluster:
    insecure-skip-tls-verify: true
    server: https://openshift2.example.com:8443
  name: openshift2.example.com:8443
contexts: 2
- context:
    cluster: openshift1.example.com:8443
    namespace: alice-project
    user: alice/openshift1.example.com:8443
  name: alice-project/openshift1.example.com:8443/alice
- context:
    cluster: openshift1.example.com:8443
    namespace: joe-project
    user: alice/openshift1.example.com:8443
  name: joe-project/openshift1/alice
current-context: joe-project/openshift1.example.com:8443/alice 3
kind: Config
preferences: {}
users: 4
- name: alice/openshift1.example.com:8443
  user:
    token: xZHd2piv5_9vQrg-SKXRJ2Dsl9SceNJdhNTljEKTb8k

1
cluster 섹션 은 마스터 서버의 주소를 포함하여 ROSA 클러스터에 대한 연결 세부 정보를 정의합니다. 이 예에서 하나의 클러스터는 nicknamed openshift1.example.com:8443 이며 다른 클러스터는 nicknamed openshift2.example.com:8443 입니다.
2
컨텍스트 섹션에서는 두 개의 컨텍스트를 정의합니다. alice-project/openshift1.example.com:8443/alice 에서는 alice-project 프로젝트, openshift1.example.com:8443 클러스터, alice 사용자 및 다른 nicknamed joe-project/openshift1.example.com:8443/ alice 를 사용하여 하나의 닉네임 alice-project/openshift1.example.com:8443/alice 를 정의합니다. joe-project 프로젝트, openshift1.example.com:8443 클러스터 및 alice 사용자 사용.
3
current-context 매개변수는 joe-project/openshift1.example.com:8443/alice 컨텍스트가 현재 사용 중임을 표시하여 alice 사용자가 openshift1.example.com:8443 클러스터의 joe-project 프로젝트에서 작업할 수 있습니다.
4
users 섹션에서는 사용자 자격 증명을 정의합니다. 이 예에서 사용자 닉네임 alice/openshift1.example.com:8443 은 액세스 토큰을 사용합니다.

CLI는 런타임에 로드되고 명령줄에서 지정된 재정의 옵션과 함께 병합되는 여러 구성 파일을 지원할 수 있습니다. 로그인한 후 oc status 또는 oc project 명령을 사용하여 현재 작업 환경을 확인할 수 있습니다.

현재 작업 환경 확인

$ oc status

출력 예

oc status
In project Joe's Project (joe-project)

service database (172.30.43.12:5434 -> 3306)
  database deploys docker.io/openshift/mysql-55-centos7:latest
    #1 deployed 25 minutes ago - 1 pod

service frontend (172.30.159.137:5432 -> 8080)
  frontend deploys origin-ruby-sample:latest <-
    builds https://github.com/openshift/ruby-hello-world with joe-project/ruby-20-centos7:latest
    #1 deployed 22 minutes ago - 2 pods

To see more information about a service or deployment, use 'oc describe service <name>' or 'oc describe dc <name>'.
You can use 'oc get all' to see lists of each of the types described in this example.

현재 프로젝트 나열

$ oc project

출력 예

Using project "joe-project" from context named "joe-project/openshift1.example.com:8443/alice" on server "https://openshift1.example.com:8443".

oc login 명령을 다시 실행하고 대화형 프로세스 중에 필요한 정보를 제공하여 사용자 인증 정보 및 클러스터 세부 정보의 다른 조합을 사용하여 로그인할 수 있습니다. 컨텍스트는 아직 존재하지 않는 경우 제공된 정보를 기반으로 구성됩니다. 이미 로그인한 후 현재 사용자가 이미 액세스할 수 있는 다른 프로젝트로 전환하려면 oc project 명령을 사용하고 프로젝트 이름을 입력합니다.

$ oc project alice-project

출력 예

Now using project "alice-project" on server "https://openshift1.example.com:8443".

언제든지 oc config view 명령을 사용하여 출력에 표시된 대로 현재 CLI 구성을 볼 수 있습니다. 고급 사용을 위해 추가 CLI 구성 명령도 사용할 수 있습니다.

참고

관리자 인증 정보에 액세스할 수 있지만 더 이상 기본 시스템 사용자 system:admin 으로 로그인하지 않는 경우 CLI 구성 파일에 인증 정보가 계속 있는 한 언제든지 이 사용자로 다시 로그인할 수 있습니다. 다음 명령은 에 로그인하여 기본 프로젝트로 전환합니다.

$ oc login -u system:admin -n default

2.4.2. CLI 프로필 수동 구성

참고

이 섹션에서는 CLI 구성의 고급 사용법에 대해 설명합니다. 대부분의 경우 oc loginoc project 명령을 사용하여 로그인하고 컨텍스트와 프로젝트 간에 전환할 수 있습니다.

CLI 구성 파일을 수동으로 구성하려면 파일을 직접 수정하는 대신 oc config 명령을 사용할 수 있습니다. oc config 명령에는 다음과 같은 여러 유용한 하위 명령이 포함되어 있습니다.

표 2.2. CLI 구성 하위 명령

하위 명령사용법

set-cluster

CLI 구성 파일에 클러스터 항목을 설정합니다. 참조된 클러스터 닉네임이 이미 존재하는 경우 지정된 정보가 병합됩니다.

$ oc config set-cluster <cluster_nickname> [--server=<master_ip_or_fqdn>]
[--certificate-authority=<path/to/certificate/authority>]
[--api-version=<apiversion>] [--insecure-skip-tls-verify=true]

set-context

CLI 구성 파일에 컨텍스트 항목을 설정합니다. 참조된 컨텍스트 닉네임이 이미 존재하는 경우 지정된 정보가 병합됩니다.

$ oc config set-context <context_nickname> [--cluster=<cluster_nickname>]
[--user=<user_nickname>] [--namespace=<namespace>]

use-context

지정된 컨텍스트 닉네임을 사용하여 현재 컨텍스트를 설정합니다.

$ oc config use-context <context_nickname>

set

CLI 구성 파일에서 개별 값을 설정합니다.

$ oc config set <property_name> <property_value>

& lt;property_name >은 점으로 구분된 이름으로, 각 토큰은 특성 이름 또는 맵 키를 나타냅니다. & lt;property_value& gt;는 설정 중인 새 값입니다.

설정되지 않음

CLI 구성 파일에서 개별 값을 설정 해제합니다.

$ oc config unset <property_name>

& lt;property_name >은 점으로 구분된 이름으로, 각 토큰은 특성 이름 또는 맵 키를 나타냅니다.

view

현재 사용 중인 병합된 CLI 구성을 표시합니다.

$ oc config view

지정된 CLI 구성 파일의 결과를 표시합니다.

$ oc config view --config=<specific_filename>

사용 예

  • 액세스 토큰을 사용하는 사용자로 로그인합니다. 이 토큰은 alice 사용자가 사용합니다.
$ oc login https://openshift1.example.com --token=ns7yVhuRNpDM9cgzfhhxQ7bM5s7N2ZVrkZepSRf4LC0
  • 자동으로 생성된 클러스터 항목을 확인합니다.
$ oc config view

출력 예

apiVersion: v1
clusters:
- cluster:
    insecure-skip-tls-verify: true
    server: https://openshift1.example.com
  name: openshift1-example-com
contexts:
- context:
    cluster: openshift1-example-com
    namespace: default
    user: alice/openshift1-example-com
  name: default/openshift1-example-com/alice
current-context: default/openshift1-example-com/alice
kind: Config
preferences: {}
users:
- name: alice/openshift1.example.com
  user:
    token: ns7yVhuRNpDM9cgzfhhxQ7bM5s7N2ZVrkZepSRf4LC0

  • 사용자가 원하는 네임스페이스에 로그인하도록 현재 컨텍스트를 업데이트합니다.
$ oc config set-context `oc config current-context` --namespace=<project_name>
  • 현재 컨텍스트를 검사하여 변경 사항이 구현되었는지 확인합니다.
$ oc whoami -c

이후의 모든 CLI 작업은 CLI 옵션을 재정의하거나 컨텍스트가 전환될 때까지 달리 지정하지 않는 한 새 컨텍스트를 사용합니다.

2.4.3. 규칙 로드 및 병합

CLI 구성의 로드 및 병합에 대한 CLI 작업을 실행할 때 다음 규칙을 따를 수 있습니다.

  • CLI 구성 파일은 다음 계층 구조 및 병합 규칙을 사용하여 워크스테이션에서 검색됩니다.

    • --config 옵션이 설정되면 해당 파일만 로드됩니다. 플래그는 한 번 설정되고 병합이 수행되지 않습니다.
    • $KUBECONFIG 환경 변수가 설정되면 사용됩니다. 변수는 경로 목록일 수 있으며, 이 경우 경로가 함께 병합됩니다. 값이 수정되면 스탠자를 정의하는 파일에서 수정됩니다. 값이 생성되면 존재하는 첫 번째 파일에 생성됩니다. 체인에 파일이 없으면 목록에 마지막 파일이 생성됩니다.
    • 그렇지 않으면 ~/.kube/config 파일이 사용되고 병합이 수행되지 않습니다.
  • 사용할 컨텍스트는 다음 흐름의 첫 번째 일치 항목에 따라 결정됩니다.

    • context 옵션의 값입니다.
    • CLI 구성 파일의 current-context 값입니다.
    • 이 단계에서 빈 값이 허용됩니다.
  • 사용할 사용자와 클러스터가 결정됩니다. 이 시점에는 컨텍스트가 있거나 없을 수 있습니다. 이러한 컨텍스트는 다음 흐름의 첫 번째 일치 항목에 따라 빌드됩니다. 이 항목은 사용자에게 한 번 실행되고 클러스터에 대해 한 번 실행됩니다.

    • 클러스터 이름에 대한 사용자 이름 및 --cluster 옵션의 --user 값입니다.
    • context 옵션이 있는 경우 컨텍스트의 값을 사용합니다.
    • 이 단계에서 빈 값이 허용됩니다.
  • 사용할 실제 클러스터 정보가 결정됩니다. 이 시점에서 클러스터 정보가 있을 수도 있고 없을 수도 있습니다. 클러스터 정보의 각 조각은 다음 흐름에서 첫 번째 일치 항목을 기반으로 구축됩니다.

    • 다음 명령줄 옵션 중 하나의 값입니다.

      • --server,
      • --api-version
      • --certificate-authority
      • --insecure-skip-tls-verify
    • 클러스터 정보와 속성 값이 있는 경우 이를 사용합니다.
    • 서버 위치가 없는 경우 오류가 발생합니다.
  • 사용할 실제 사용자 정보가 결정됩니다. 사용자당 하나의 인증 기술만 있을 수 있다는 점을 제외하고 클러스터와 동일한 규칙을 사용하여 사용자를 빌드합니다. 충돌하는 기술으로 인해 작업이 실패합니다. 명령줄 옵션이 구성 파일 값보다 우선합니다. 유효한 명령행 옵션은 다음과 같습니다.

    • --auth-path
    • --client-certificate
    • --client-key
    • --token
  • 아직 누락된 정보의 경우 기본값이 사용되며 추가 정보에 대한 프롬프트가 제공됩니다.

2.5. 플러그인을 사용하여 OpenShift CLI 확장

기본 oc 명령에 빌드할 플러그인을 작성하고 설치하여 OpenShift CLI를 사용하여 새롭고 더 복잡한 작업을 수행할 수 있습니다.

2.5.1. CLI 플러그인 작성

명령줄 명령을 작성할 수 있는 모든 프로그래밍 언어 또는 스크립트에서 OpenShift CLI용 플러그인을 작성할 수 있습니다. 기존 oc 명령을 덮어쓰는 데 플러그인을 사용할 수 없습니다.

절차

이 절차에서는 oc foo 명령이 실행될 때 메시지를 터미널에 출력하는 간단한 Bash 플러그인을 생성합니다.

  1. oc-foo라는 파일을 생성합니다.

    플러그인 파일 이름을 지정할 때 다음 사항에 유의하십시오.

    • 파일이 플러그인으로 인식되려면 oc- 또는 kubectl- 로 시작되어야 합니다.
    • 파일 이름에 따라 플러그인을 호출하는 명령이 결정됩니다. 예를 들어 파일 이름이 oc-foo-bar 인 플러그인은 oc foo bar 명령으로 호출할 수 있습니다. 명령에 대시를 포함하기 위해 밑줄을 사용할 수도 있습니다. 예를 들어 파일 이름이 oc-foo_bar 인 플러그인은 oc foo-bar 명령으로 호출할 수 있습니다.
  2. 파일에 다음 콘텐츠를 추가합니다.

    #!/bin/bash
    
    # optional argument handling
    if [[ "$1" == "version" ]]
    then
        echo "1.0.0"
        exit 0
    fi
    
    # optional argument handling
    if [[ "$1" == "config" ]]
    then
        echo $KUBECONFIG
        exit 0
    fi
    
    echo "I am a plugin named kubectl-foo"

OpenShift CLI에 대한 이 플러그인을 설치한 후 oc foo 명령을 사용하여 호출할 수 있습니다.

추가 리소스

2.5.2. CLI 플러그인 설치 및 사용

OpenShift CLI에 대한 사용자 정의 플러그인을 작성한 후 사용하기 전에 플러그인을 설치해야 합니다.

사전 요구 사항

  • oc CLI 툴이 설치되어 있어야 합니다.
  • oc- 또는 kubectl- 로 시작하는 CLI 플러그인 파일이 있어야 합니다.

절차

  1. 필요한 경우 플러그인 파일을 실행 가능하게 업데이트합니다.

    $ chmod +x <plugin_file>
  2. 파일을 PATH에 있는 임의의 위치(예: /usr/local/bin/)에 배치합니다.

    $ sudo mv <plugin_file> /usr/local/bin/.
  3. oc plugin list 를 실행하여 플러그인이 나열되어 있는지 확인합니다.

    $ oc plugin list

    출력 예

    The following compatible plugins are available:
    
    /usr/local/bin/<plugin_file>

    플러그인이 여기에 나열되지 않은 경우 파일이 oc- 또는 kubectl- 로 시작하고 실행 가능하며 PATH 에 있는지 확인합니다.

  4. 플러그인에서 도입한 새 명령 또는 옵션을 호출합니다.

    예를 들어 샘플 플러그인 리포지터리 에서 kubectl-ns 플러그인을 빌드하고 설치한 경우 다음 명령을 사용하여 현재 네임스페이스를 볼 수 있습니다.

    $ oc ns

    플러그인을 호출하는 명령은 플러그인 파일 이름에 따라 다릅니다. 예를 들어 파일 이름이 oc-foo-bar 인 플러그인은 oc foo bar 명령으로 호출됩니다.

2.6. OpenShift CLI 개발자 명령 참조

이 참조는 OpenShift CLI (oc) developer 명령에 대한 설명 및 예제 명령을 제공합니다.

oc help를 실행하여 모든 명령을 나열하거나 oc <command> --help를 실행하여 특정 명령에 대한 추가 세부 정보를 가져옵니다.

2.6.1. OpenShift CLI (oc) 개발자 명령

2.6.1.1. oc annotate

리소스에서 주석을 업데이트

사용 예

  # Update pod 'foo' with the annotation 'description' and the value 'my frontend'
  # If the same annotation is set multiple times, only the last value will be applied
  oc annotate pods foo description='my frontend'

  # Update a pod identified by type and name in "pod.json"
  oc annotate -f pod.json description='my frontend'

  # Update pod 'foo' with the annotation 'description' and the value 'my frontend running nginx', overwriting any existing value
  oc annotate --overwrite pods foo description='my frontend running nginx'

  # Update all pods in the namespace
  oc annotate pods --all description='my frontend running nginx'

  # Update pod 'foo' only if the resource is unchanged from version 1
  oc annotate pods foo description='my frontend running nginx' --resource-version=1

  # Update pod 'foo' by removing an annotation named 'description' if it exists
  # Does not require the --overwrite flag
  oc annotate pods foo description-

2.6.1.2. oc api-resources

서버에서 지원되는 API 리소스를 인쇄

사용 예

  # Print the supported API resources
  oc api-resources

  # Print the supported API resources with more information
  oc api-resources -o wide

  # Print the supported API resources sorted by a column
  oc api-resources --sort-by=name

  # Print the supported namespaced resources
  oc api-resources --namespaced=true

  # Print the supported non-namespaced resources
  oc api-resources --namespaced=false

  # Print the supported API resources with a specific APIGroup
  oc api-resources --api-group=rbac.authorization.k8s.io

2.6.1.3. oc api-versions

"group/version" 형식으로 서버에서 지원되는 API 버전을 인쇄

사용 예

  # Print the supported API versions
  oc api-versions

2.6.1.4. oc apply

파일 이름 또는 stdin별 리소스에 구성을 적용

사용 예

  # Apply the configuration in pod.json to a pod
  oc apply -f ./pod.json

  # Apply resources from a directory containing kustomization.yaml - e.g. dir/kustomization.yaml
  oc apply -k dir/

  # Apply the JSON passed into stdin to a pod
  cat pod.json | oc apply -f -

  # Apply the configuration from all files that end with '.json'
  oc apply -f '*.json'

  # Note: --prune is still in Alpha
  # Apply the configuration in manifest.yaml that matches label app=nginx and delete all other resources that are not in the file and match label app=nginx
  oc apply --prune -f manifest.yaml -l app=nginx

  # Apply the configuration in manifest.yaml and delete all the other config maps that are not in the file
  oc apply --prune -f manifest.yaml --all --prune-allowlist=core/v1/ConfigMap

2.6.1.5. oc apply edit-last-applied

리소스/오브젝트의 최신 last-applied-configuration 주석을 편집

사용 예

  # Edit the last-applied-configuration annotations by type/name in YAML
  oc apply edit-last-applied deployment/nginx

  # Edit the last-applied-configuration annotations by file in JSON
  oc apply edit-last-applied -f deploy.yaml -o json

2.6.1.6. oc apply set-last-applied

파일의 내용과 일치하도록 라이브 오브젝트에 last-applied-configuration 주석을 설정

사용 예

  # Set the last-applied-configuration of a resource to match the contents of a file
  oc apply set-last-applied -f deploy.yaml

  # Execute set-last-applied against each configuration file in a directory
  oc apply set-last-applied -f path/

  # Set the last-applied-configuration of a resource to match the contents of a file; will create the annotation if it does not already exist
  oc apply set-last-applied -f deploy.yaml --create-annotation=true

2.6.1.7. oc apply view-last-applied

리소스/오브젝트의 최신 last-applied-configuration 주석 보기

사용 예

  # View the last-applied-configuration annotations by type/name in YAML
  oc apply view-last-applied deployment/nginx

  # View the last-applied-configuration annotations by file in JSON
  oc apply view-last-applied -f deploy.yaml -o json

2.6.1.8. oc attach

실행 중인 컨테이너에 연결

사용 예

  # Get output from running pod mypod; use the 'oc.kubernetes.io/default-container' annotation
  # for selecting the container to be attached or the first container in the pod will be chosen
  oc attach mypod

  # Get output from ruby-container from pod mypod
  oc attach mypod -c ruby-container

  # Switch to raw terminal mode; sends stdin to 'bash' in ruby-container from pod mypod
  # and sends stdout/stderr from 'bash' back to the client
  oc attach mypod -c ruby-container -i -t

  # Get output from the first pod of a replica set named nginx
  oc attach rs/nginx

2.6.1.9. oc auth can-i

작업이 허용되는지 확인

사용 예

  # Check to see if I can create pods in any namespace
  oc auth can-i create pods --all-namespaces

  # Check to see if I can list deployments in my current namespace
  oc auth can-i list deployments.apps

  # Check to see if service account "foo" of namespace "dev" can list pods
  # in the namespace "prod".
  # You must be allowed to use impersonation for the global option "--as".
  oc auth can-i list pods --as=system:serviceaccount:dev:foo -n prod

  # Check to see if I can do everything in my current namespace ("*" means all)
  oc auth can-i '*' '*'

  # Check to see if I can get the job named "bar" in namespace "foo"
  oc auth can-i list jobs.batch/bar -n foo

  # Check to see if I can read pod logs
  oc auth can-i get pods --subresource=log

  # Check to see if I can access the URL /logs/
  oc auth can-i get /logs/

  # List all allowed actions in namespace "foo"
  oc auth can-i --list --namespace=foo

2.6.1.10. oc auth reconcile

RBAC 역할, 역할 바인딩, 클러스터 역할 및 클러스터 역할 바인딩 오브젝트에 대한 규칙 조정

사용 예

  # Reconcile RBAC resources from a file
  oc auth reconcile -f my-rbac-rules.yaml

2.6.1.11. oc auth whoami

실험: 자체 주제 속성 확인

사용 예

  # Get your subject attributes.
  oc auth whoami

  # Get your subject attributes in JSON format.
  oc auth whoami -o json

2.6.1.12. oc autoscale

배포 구성, 배포, 복제본 세트, 상태 저장 세트 또는 복제 컨트롤러를 자동 스케일링

사용 예

  # Auto scale a deployment "foo", with the number of pods between 2 and 10, no target CPU utilization specified so a default autoscaling policy will be used
  oc autoscale deployment foo --min=2 --max=10

  # Auto scale a replication controller "foo", with the number of pods between 1 and 5, target CPU utilization at 80%
  oc autoscale rc foo --max=5 --cpu-percent=80

2.6.1.13. oc cancel-build

실행 중이거나 보류 중인 빌드 또는 새 빌드를 취소

사용 예

  # Cancel the build with the given name
  oc cancel-build ruby-build-2

  # Cancel the named build and print the build logs
  oc cancel-build ruby-build-2 --dump-logs

  # Cancel the named build and create a new one with the same parameters
  oc cancel-build ruby-build-2 --restart

  # Cancel multiple builds
  oc cancel-build ruby-build-1 ruby-build-2 ruby-build-3

  # Cancel all builds created from the 'ruby-build' build config that are in the 'new' state
  oc cancel-build bc/ruby-build --state=new

2.6.1.14. oc cluster-info

클러스터 정보 표시

사용 예

  # Print the address of the control plane and cluster services
  oc cluster-info

2.6.1.15. oc cluster-info dump

디버깅 및 진단을 위해 관련 정보를 덤프

사용 예

  # Dump current cluster state to stdout
  oc cluster-info dump

  # Dump current cluster state to /path/to/cluster-state
  oc cluster-info dump --output-directory=/path/to/cluster-state

  # Dump all namespaces to stdout
  oc cluster-info dump --all-namespaces

  # Dump a set of namespaces to /path/to/cluster-state
  oc cluster-info dump --namespaces default,kube-system --output-directory=/path/to/cluster-state

2.6.1.16. oc completion

지정된 쉘에 대한 쉘 완료 코드 출력(bash, zsh, Fish 또는 powershell)

사용 예

  # Installing bash completion on macOS using homebrew
  ## If running Bash 3.2 included with macOS
  brew install bash-completion
  ## or, if running Bash 4.1+
  brew install bash-completion@2
  ## If oc is installed via homebrew, this should start working immediately
  ## If you've installed via other means, you may need add the completion to your completion directory
  oc completion bash > $(brew --prefix)/etc/bash_completion.d/oc


  # Installing bash completion on Linux
  ## If bash-completion is not installed on Linux, install the 'bash-completion' package
  ## via your distribution's package manager.
  ## Load the oc completion code for bash into the current shell
  source <(oc completion bash)
  ## Write bash completion code to a file and source it from .bash_profile
  oc completion bash > ~/.kube/completion.bash.inc
  printf "
  # oc shell completion
  source '$HOME/.kube/completion.bash.inc'
  " >> $HOME/.bash_profile
  source $HOME/.bash_profile

  # Load the oc completion code for zsh[1] into the current shell
  source <(oc completion zsh)
  # Set the oc completion code for zsh[1] to autoload on startup
  oc completion zsh > "${fpath[1]}/_oc"


  # Load the oc completion code for fish[2] into the current shell
  oc completion fish | source
  # To load completions for each session, execute once:
  oc completion fish > ~/.config/fish/completions/oc.fish

  # Load the oc completion code for powershell into the current shell
  oc completion powershell | Out-String | Invoke-Expression
  # Set oc completion code for powershell to run on startup
  ## Save completion code to a script and execute in the profile
  oc completion powershell > $HOME\.kube\completion.ps1
  Add-Content $PROFILE "$HOME\.kube\completion.ps1"
  ## Execute completion code in the profile
  Add-Content $PROFILE "if (Get-Command oc -ErrorAction SilentlyContinue) {
  oc completion powershell | Out-String | Invoke-Expression
  }"
  ## Add completion code directly to the $PROFILE script
  oc completion powershell >> $PROFILE

2.6.1.17. oc config current-context

current-context를 표시

사용 예

  # Display the current-context
  oc config current-context

2.6.1.18. oc config delete-cluster

kubeconfig에서 지정된 클러스터를 삭제

사용 예

  # Delete the minikube cluster
  oc config delete-cluster minikube

2.6.1.19. oc config delete-context

kubeconfig에서 지정된 컨텍스트를 삭제

사용 예

  # Delete the context for the minikube cluster
  oc config delete-context minikube

2.6.1.20. oc config delete-user

kubeconfig에서 지정된 사용자를 삭제

사용 예

  # Delete the minikube user
  oc config delete-user minikube

2.6.1.21. oc config get-clusters

kubeconfig에 정의된 클러스터를 표시

사용 예

  # List the clusters that oc knows about
  oc config get-clusters

2.6.1.22. oc config get-contexts

하나 또는 여러 컨텍스트를 설명

사용 예

  # List all the contexts in your kubeconfig file
  oc config get-contexts

  # Describe one context in your kubeconfig file
  oc config get-contexts my-context

2.6.1.23. oc config get-users

kubeconfig에 정의된 사용자를 표시

사용 예

  # List the users that oc knows about
  oc config get-users

2.6.1.24. oc config new-admin-kubeconfig

서버를 생성하고, 신뢰하고, 새 admin.kubeconfig를 표시합니다.

사용 예

  # Generate a new admin kubeconfig
  oc config new-admin-kubeconfig

2.6.1.25. oc config new-kubelet-bootstrap-kubeconfig

서버를 생성하고, 신뢰하고, 새 kubelet /etc/kubernetes/kubeconfig를 표시합니다.

사용 예

  # Generate a new kubelet bootstrap kubeconfig
  oc config new-kubelet-bootstrap-kubeconfig

2.6.1.26. oc config refresh-ca-bundle

apiserver에 연결하여 OpenShift CA 번들을 업데이트합니다.

사용 예

  # Refresh the CA bundle for the current context's cluster
  oc config refresh-ca-bundle

  # Refresh the CA bundle for the cluster named e2e in your kubeconfig
  oc config refresh-ca-bundle e2e

  # Print the CA bundle from the current OpenShift cluster's apiserver.
  oc config refresh-ca-bundle --dry-run

2.6.1.27. oc config rename-context

kubeconfig 파일에서 컨텍스트 이름 변경

사용 예

  # Rename the context 'old-name' to 'new-name' in your kubeconfig file
  oc config rename-context old-name new-name

2.6.1.28. oc config set

kubeconfig 파일에서 개별 값 설정

사용 예

  # Set the server field on the my-cluster cluster to https://1.2.3.4
  oc config set clusters.my-cluster.server https://1.2.3.4

  # Set the certificate-authority-data field on the my-cluster cluster
  oc config set clusters.my-cluster.certificate-authority-data $(echo "cert_data_here" | base64 -i -)

  # Set the cluster field in the my-context context to my-cluster
  oc config set contexts.my-context.cluster my-cluster

  # Set the client-key-data field in the cluster-admin user using --set-raw-bytes option
  oc config set users.cluster-admin.client-key-data cert_data_here --set-raw-bytes=true

2.6.1.29. oc config set-cluster

kubeconfig에서 클러스터 항목 설정

사용 예

  # Set only the server field on the e2e cluster entry without touching other values
  oc config set-cluster e2e --server=https://1.2.3.4

  # Embed certificate authority data for the e2e cluster entry
  oc config set-cluster e2e --embed-certs --certificate-authority=~/.kube/e2e/kubernetes.ca.crt

  # Disable cert checking for the e2e cluster entry
  oc config set-cluster e2e --insecure-skip-tls-verify=true

  # Set the custom TLS server name to use for validation for the e2e cluster entry
  oc config set-cluster e2e --tls-server-name=my-cluster-name

  # Set the proxy URL for the e2e cluster entry
  oc config set-cluster e2e --proxy-url=https://1.2.3.4

2.6.1.30. oc config set-context

kubeconfig에서 컨텍스트 항목 설정

사용 예

  # Set the user field on the gce context entry without touching other values
  oc config set-context gce --user=cluster-admin

2.6.1.31. oc config set-credentials

kubeconfig에서 사용자 항목 설정

사용 예

  # Set only the "client-key" field on the "cluster-admin"
  # entry, without touching other values
  oc config set-credentials cluster-admin --client-key=~/.kube/admin.key

  # Set basic auth for the "cluster-admin" entry
  oc config set-credentials cluster-admin --username=admin --password=uXFGweU9l35qcif

  # Embed client certificate data in the "cluster-admin" entry
  oc config set-credentials cluster-admin --client-certificate=~/.kube/admin.crt --embed-certs=true

  # Enable the Google Compute Platform auth provider for the "cluster-admin" entry
  oc config set-credentials cluster-admin --auth-provider=gcp

  # Enable the OpenID Connect auth provider for the "cluster-admin" entry with additional arguments
  oc config set-credentials cluster-admin --auth-provider=oidc --auth-provider-arg=client-id=foo --auth-provider-arg=client-secret=bar

  # Remove the "client-secret" config value for the OpenID Connect auth provider for the "cluster-admin" entry
  oc config set-credentials cluster-admin --auth-provider=oidc --auth-provider-arg=client-secret-

  # Enable new exec auth plugin for the "cluster-admin" entry
  oc config set-credentials cluster-admin --exec-command=/path/to/the/executable --exec-api-version=client.authentication.k8s.io/v1beta1

  # Define new exec auth plugin arguments for the "cluster-admin" entry
  oc config set-credentials cluster-admin --exec-arg=arg1 --exec-arg=arg2

  # Create or update exec auth plugin environment variables for the "cluster-admin" entry
  oc config set-credentials cluster-admin --exec-env=key1=val1 --exec-env=key2=val2

  # Remove exec auth plugin environment variables for the "cluster-admin" entry
  oc config set-credentials cluster-admin --exec-env=var-to-remove-

2.6.1.32. oc config unset

kubeconfig 파일에서 개별 값 설정 해제

사용 예

  # Unset the current-context
  oc config unset current-context

  # Unset namespace in foo context
  oc config unset contexts.foo.namespace

2.6.1.33. oc config use-context

kubeconfig 파일에서 current-context 설정

사용 예

  # Use the context for the minikube cluster
  oc config use-context minikube

2.6.1.34. oc config view

병합된 kubeconfig 설정 또는 지정된 kubeconfig 파일을 표시

사용 예

  # Show merged kubeconfig settings
  oc config view

  # Show merged kubeconfig settings, raw certificate data, and exposed secrets
  oc config view --raw

  # Get the password for the e2e user
  oc config view -o jsonpath='{.users[?(@.name == "e2e")].user.password}'

2.6.1.35. oc cp

컨테이너 간에 파일 및 디렉터리를 복사

사용 예

  # !!!Important Note!!!
  # Requires that the 'tar' binary is present in your container
  # image.  If 'tar' is not present, 'oc cp' will fail.
  #
  # For advanced use cases, such as symlinks, wildcard expansion or
  # file mode preservation, consider using 'oc exec'.

  # Copy /tmp/foo local file to /tmp/bar in a remote pod in namespace <some-namespace>
  tar cf - /tmp/foo | oc exec -i -n <some-namespace> <some-pod> -- tar xf - -C /tmp/bar

  # Copy /tmp/foo from a remote pod to /tmp/bar locally
  oc exec -n <some-namespace> <some-pod> -- tar cf - /tmp/foo | tar xf - -C /tmp/bar

  # Copy /tmp/foo_dir local directory to /tmp/bar_dir in a remote pod in the default namespace
  oc cp /tmp/foo_dir <some-pod>:/tmp/bar_dir

  # Copy /tmp/foo local file to /tmp/bar in a remote pod in a specific container
  oc cp /tmp/foo <some-pod>:/tmp/bar -c <specific-container>

  # Copy /tmp/foo local file to /tmp/bar in a remote pod in namespace <some-namespace>
  oc cp /tmp/foo <some-namespace>/<some-pod>:/tmp/bar

  # Copy /tmp/foo from a remote pod to /tmp/bar locally
  oc cp <some-namespace>/<some-pod>:/tmp/foo /tmp/bar

2.6.1.36. oc create

파일 또는 stdin에서 리소스를 생성

사용 예

  # Create a pod using the data in pod.json
  oc create -f ./pod.json

  # Create a pod based on the JSON passed into stdin
  cat pod.json | oc create -f -

  # Edit the data in registry.yaml in JSON then create the resource using the edited data
  oc create -f registry.yaml --edit -o json

2.6.1.37. oc create build

새 빌드를 생성

사용 예

  # Create a new build
  oc create build myapp

2.6.1.38. oc create clusterresourcequota

클러스터 리소스 쿼터를 생성

사용 예

  # Create a cluster resource quota limited to 10 pods
  oc create clusterresourcequota limit-bob --project-annotation-selector=openshift.io/requester=user-bob --hard=pods=10

2.6.1.39. oc create clusterrole

클러스터 역할 생성

사용 예

  # Create a cluster role named "pod-reader" that allows user to perform "get", "watch" and "list" on pods
  oc create clusterrole pod-reader --verb=get,list,watch --resource=pods

  # Create a cluster role named "pod-reader" with ResourceName specified
  oc create clusterrole pod-reader --verb=get --resource=pods --resource-name=readablepod --resource-name=anotherpod

  # Create a cluster role named "foo" with API Group specified
  oc create clusterrole foo --verb=get,list,watch --resource=rs.apps

  # Create a cluster role named "foo" with SubResource specified
  oc create clusterrole foo --verb=get,list,watch --resource=pods,pods/status

  # Create a cluster role name "foo" with NonResourceURL specified
  oc create clusterrole "foo" --verb=get --non-resource-url=/logs/*

  # Create a cluster role name "monitoring" with AggregationRule specified
  oc create clusterrole monitoring --aggregation-rule="rbac.example.com/aggregate-to-monitoring=true"

2.6.1.40. oc create clusterrolebinding

특정 클러스터 역할에 대한 클러스터 역할 바인딩 생성

사용 예

  # Create a cluster role binding for user1, user2, and group1 using the cluster-admin cluster role
  oc create clusterrolebinding cluster-admin --clusterrole=cluster-admin --user=user1 --user=user2 --group=group1

2.6.1.41. oc create configmap

로컬 파일, 디렉터리 또는 리터럴 값에서 구성 맵을 생성

사용 예

  # Create a new config map named my-config based on folder bar
  oc create configmap my-config --from-file=path/to/bar

  # Create a new config map named my-config with specified keys instead of file basenames on disk
  oc create configmap my-config --from-file=key1=/path/to/bar/file1.txt --from-file=key2=/path/to/bar/file2.txt

  # Create a new config map named my-config with key1=config1 and key2=config2
  oc create configmap my-config --from-literal=key1=config1 --from-literal=key2=config2

  # Create a new config map named my-config from the key=value pairs in the file
  oc create configmap my-config --from-file=path/to/bar

  # Create a new config map named my-config from an env file
  oc create configmap my-config --from-env-file=path/to/foo.env --from-env-file=path/to/bar.env

2.6.1.42. oc create cronjob

지정된 이름으로 cron 작업 생성

사용 예

  # Create a cron job
  oc create cronjob my-job --image=busybox --schedule="*/1 * * * *"

  # Create a cron job with a command
  oc create cronjob my-job --image=busybox --schedule="*/1 * * * *" -- date

2.6.1.43. oc create deployment

지정된 이름으로 배포 생성

사용 예

  # Create a deployment named my-dep that runs the busybox image
  oc create deployment my-dep --image=busybox

  # Create a deployment with a command
  oc create deployment my-dep --image=busybox -- date

  # Create a deployment named my-dep that runs the nginx image with 3 replicas
  oc create deployment my-dep --image=nginx --replicas=3

  # Create a deployment named my-dep that runs the busybox image and expose port 5701
  oc create deployment my-dep --image=busybox --port=5701

2.6.1.44. oc create deploymentconfig

지정된 이미지를 사용하는 기본 옵션으로 배포 구성을 생성

사용 예

  # Create an nginx deployment config named my-nginx
  oc create deploymentconfig my-nginx --image=nginx

2.6.1.45. oc create identity

수동으로 ID를 생성 (자동 생성이 비활성화된 경우에만 필요)

사용 예

  # Create an identity with identity provider "acme_ldap" and the identity provider username "adamjones"
  oc create identity acme_ldap:adamjones

2.6.1.46. oc create imagestream

비어 있는 새 이미지 스트림을 생성

사용 예

  # Create a new image stream
  oc create imagestream mysql

2.6.1.47. oc create imagestreamtag

새 이미지 스트림 태그를 생성

사용 예

  # Create a new image stream tag based on an image in a remote registry
  oc create imagestreamtag mysql:latest --from-image=myregistry.local/mysql/mysql:5.0

2.6.1.48. oc create ingress

지정된 이름으로 수신 생성

사용 예

  # Create a single ingress called 'simple' that directs requests to foo.com/bar to svc
  # svc1:8080 with a TLS secret "my-cert"
  oc create ingress simple --rule="foo.com/bar=svc1:8080,tls=my-cert"

  # Create a catch all ingress of "/path" pointing to service svc:port and Ingress Class as "otheringress"
  oc create ingress catch-all --class=otheringress --rule="/path=svc:port"

  # Create an ingress with two annotations: ingress.annotation1 and ingress.annotations2
  oc create ingress annotated --class=default --rule="foo.com/bar=svc:port" \
  --annotation ingress.annotation1=foo \
  --annotation ingress.annotation2=bla

  # Create an ingress with the same host and multiple paths
  oc create ingress multipath --class=default \
  --rule="foo.com/=svc:port" \
  --rule="foo.com/admin/=svcadmin:portadmin"

  # Create an ingress with multiple hosts and the pathType as Prefix
  oc create ingress ingress1 --class=default \
  --rule="foo.com/path*=svc:8080" \
  --rule="bar.com/admin*=svc2:http"

  # Create an ingress with TLS enabled using the default ingress certificate and different path types
  oc create ingress ingtls --class=default \
  --rule="foo.com/=svc:https,tls" \
  --rule="foo.com/path/subpath*=othersvc:8080"

  # Create an ingress with TLS enabled using a specific secret and pathType as Prefix
  oc create ingress ingsecret --class=default \
  --rule="foo.com/*=svc:8080,tls=secret1"

  # Create an ingress with a default backend
  oc create ingress ingdefault --class=default \
  --default-backend=defaultsvc:http \
  --rule="foo.com/*=svc:8080,tls=secret1"

2.6.1.49. oc create job

지정된 이름으로 작업 생성

사용 예

  # Create a job
  oc create job my-job --image=busybox

  # Create a job with a command
  oc create job my-job --image=busybox -- date

  # Create a job from a cron job named "a-cronjob"
  oc create job test-job --from=cronjob/a-cronjob

2.6.1.50. oc create namespace

지정된 이름으로 네임 스페이스를 생성

사용 예

  # Create a new namespace named my-namespace
  oc create namespace my-namespace

2.6.1.51. oc create poddisruptionbudget

지정된 이름으로 Pod 중단 예산 생성

사용 예

  # Create a pod disruption budget named my-pdb that will select all pods with the app=rails label
  # and require at least one of them being available at any point in time
  oc create poddisruptionbudget my-pdb --selector=app=rails --min-available=1

  # Create a pod disruption budget named my-pdb that will select all pods with the app=nginx label
  # and require at least half of the pods selected to be available at any point in time
  oc create pdb my-pdb --selector=app=nginx --min-available=50%

2.6.1.52. oc create priorityclass

지정된 이름으로 우선순위 클래스를 생성

사용 예

  # Create a priority class named high-priority
  oc create priorityclass high-priority --value=1000 --description="high priority"

  # Create a priority class named default-priority that is considered as the global default priority
  oc create priorityclass default-priority --value=1000 --global-default=true --description="default priority"

  # Create a priority class named high-priority that cannot preempt pods with lower priority
  oc create priorityclass high-priority --value=1000 --description="high priority" --preemption-policy="Never"

2.6.1.53. oc create quota

지정된 이름으로 할당량 생성

사용 예

  # Create a new resource quota named my-quota
  oc create quota my-quota --hard=cpu=1,memory=1G,pods=2,services=3,replicationcontrollers=2,resourcequotas=1,secrets=5,persistentvolumeclaims=10

  # Create a new resource quota named best-effort
  oc create quota best-effort --hard=pods=100 --scopes=BestEffort

2.6.1.54. oc create role

단일 규칙을 사용하여 역할 생성

사용 예

  # Create a role named "pod-reader" that allows user to perform "get", "watch" and "list" on pods
  oc create role pod-reader --verb=get --verb=list --verb=watch --resource=pods

  # Create a role named "pod-reader" with ResourceName specified
  oc create role pod-reader --verb=get --resource=pods --resource-name=readablepod --resource-name=anotherpod

  # Create a role named "foo" with API Group specified
  oc create role foo --verb=get,list,watch --resource=rs.apps

  # Create a role named "foo" with SubResource specified
  oc create role foo --verb=get,list,watch --resource=pods,pods/status

2.6.1.55. oc create rolebinding

특정 역할 또는 클러스터 역할에 대한 역할 바인딩 생성

사용 예

  # Create a role binding for user1, user2, and group1 using the admin cluster role
  oc create rolebinding admin --clusterrole=admin --user=user1 --user=user2 --group=group1

  # Create a role binding for serviceaccount monitoring:sa-dev using the admin role
  oc create rolebinding admin-binding --role=admin --serviceaccount=monitoring:sa-dev

2.6.1.56. oc create route edge

엣지 TLS 종료를 사용하는 경로를 생성

사용 예

  # Create an edge route named "my-route" that exposes the frontend service
  oc create route edge my-route --service=frontend

  # Create an edge route that exposes the frontend service and specify a path
  # If the route name is omitted, the service name will be used
  oc create route edge --service=frontend --path /assets

2.6.1.57. oc create route passthrough

패스스루 TLS 종료를 사용하는 경로를 생성

사용 예

  # Create a passthrough route named "my-route" that exposes the frontend service
  oc create route passthrough my-route --service=frontend

  # Create a passthrough route that exposes the frontend service and specify
  # a host name. If the route name is omitted, the service name will be used
  oc create route passthrough --service=frontend --hostname=www.example.com

2.6.1.58. oc create route reencrypt

재암호화 TLS 종료를 사용하는 경로를 생성

사용 예

  # Create a route named "my-route" that exposes the frontend service
  oc create route reencrypt my-route --service=frontend --dest-ca-cert cert.cert

  # Create a reencrypt route that exposes the frontend service, letting the
  # route name default to the service name and the destination CA certificate
  # default to the service CA
  oc create route reencrypt --service=frontend

2.6.1.59. oc create secret docker-registry

Docker 레지스트리와 함께 사용할 시크릿을 생성

사용 예

  # If you do not already have a .dockercfg file, create a dockercfg secret directly
  oc create secret docker-registry my-secret --docker-server=DOCKER_REGISTRY_SERVER --docker-username=DOCKER_USER --docker-password=DOCKER_PASSWORD --docker-email=DOCKER_EMAIL

  # Create a new secret named my-secret from ~/.docker/config.json
  oc create secret docker-registry my-secret --from-file=.dockerconfigjson=path/to/.docker/config.json

2.6.1.60. oc create secret generic

로컬 파일, 디렉터리 또는 리터럴 값에서 시크릿을 생성

사용 예

  # Create a new secret named my-secret with keys for each file in folder bar
  oc create secret generic my-secret --from-file=path/to/bar

  # Create a new secret named my-secret with specified keys instead of names on disk
  oc create secret generic my-secret --from-file=ssh-privatekey=path/to/id_rsa --from-file=ssh-publickey=path/to/id_rsa.pub

  # Create a new secret named my-secret with key1=supersecret and key2=topsecret
  oc create secret generic my-secret --from-literal=key1=supersecret --from-literal=key2=topsecret

  # Create a new secret named my-secret using a combination of a file and a literal
  oc create secret generic my-secret --from-file=ssh-privatekey=path/to/id_rsa --from-literal=passphrase=topsecret

  # Create a new secret named my-secret from env files
  oc create secret generic my-secret --from-env-file=path/to/foo.env --from-env-file=path/to/bar.env

2.6.1.61. oc create secret tls

TLS 시크릿을 생성

사용 예

  # Create a new TLS secret named tls-secret with the given key pair
  oc create secret tls tls-secret --cert=path/to/tls.cert --key=path/to/tls.key

2.6.1.62. oc create service clusterip

ClusterIP 서비스 생성

사용 예

  # Create a new ClusterIP service named my-cs
  oc create service clusterip my-cs --tcp=5678:8080

  # Create a new ClusterIP service named my-cs (in headless mode)
  oc create service clusterip my-cs --clusterip="None"

2.6.1.63. oc create service externalname

ExternalName 서비스 생성

사용 예

  # Create a new ExternalName service named my-ns
  oc create service externalname my-ns --external-name bar.com

2.6.1.64. oc create service loadbalancer

LoadBalancer 서비스 생성

사용 예

  # Create a new LoadBalancer service named my-lbs
  oc create service loadbalancer my-lbs --tcp=5678:8080

2.6.1.65. oc create service nodeport

NodePort 서비스 생성

사용 예

  # Create a new NodePort service named my-ns
  oc create service nodeport my-ns --tcp=5678:8080

2.6.1.66. oc create serviceaccount

지정된 이름으로 서비스 계정을 생성

사용 예

  # Create a new service account named my-service-account
  oc create serviceaccount my-service-account

2.6.1.67. oc create token

서비스 계정 토큰 요청

사용 예

  # Request a token to authenticate to the kube-apiserver as the service account "myapp" in the current namespace
  oc create token myapp

  # Request a token for a service account in a custom namespace
  oc create token myapp --namespace myns

  # Request a token with a custom expiration
  oc create token myapp --duration 10m

  # Request a token with a custom audience
  oc create token myapp --audience https://example.com

  # Request a token bound to an instance of a Secret object
  oc create token myapp --bound-object-kind Secret --bound-object-name mysecret

  # Request a token bound to an instance of a Secret object with a specific UID
  oc create token myapp --bound-object-kind Secret --bound-object-name mysecret --bound-object-uid 0d4691ed-659b-4935-a832-355f77ee47cc

2.6.1.68. oc create user

사용자를 수동으로 생성 (자동 생성이 비활성화된 경우에만 필요)

사용 예

  # Create a user with the username "ajones" and the display name "Adam Jones"
  oc create user ajones --full-name="Adam Jones"

2.6.1.69. oc create useridentitymapping

ID를 사용자에게 수동으로 매핑

사용 예

  # Map the identity "acme_ldap:adamjones" to the user "ajones"
  oc create useridentitymapping acme_ldap:adamjones ajones

2.6.1.70. oc debug

디버깅을 위해 Pod의 새 인스턴스를 시작

사용 예

  # Start a shell session into a pod using the OpenShift tools image
  oc debug

  # Debug a currently running deployment by creating a new pod
  oc debug deploy/test

  # Debug a node as an administrator
  oc debug node/master-1

  # Debug a Windows Node
  # Note: the chosen image must match the Windows Server version (2019, 2022) of the Node
  oc debug node/win-worker-1 --image=mcr.microsoft.com/powershell:lts-nanoserver-ltsc2022

  # Launch a shell in a pod using the provided image stream tag
  oc debug istag/mysql:latest -n openshift

  # Test running a job as a non-root user
  oc debug job/test --as-user=1000000

  # Debug a specific failing container by running the env command in the 'second' container
  oc debug daemonset/test -c second -- /bin/env

  # See the pod that would be created to debug
  oc debug mypod-9xbc -o yaml

  # Debug a resource but launch the debug pod in another namespace
  # Note: Not all resources can be debugged using --to-namespace without modification. For example,
  # volumes and service accounts are namespace-dependent. Add '-o yaml' to output the debug pod definition
  # to disk.  If necessary, edit the definition then run 'oc debug -f -' or run without --to-namespace
  oc debug mypod-9xbc --to-namespace testns

2.6.1.71. oc delete

파일 이름, stdin, 리소스 및 이름별 리소스 또는 레이블 선택기별 리소스 삭제

사용 예

  # Delete a pod using the type and name specified in pod.json
  oc delete -f ./pod.json

  # Delete resources from a directory containing kustomization.yaml - e.g. dir/kustomization.yaml
  oc delete -k dir

  # Delete resources from all files that end with '.json'
  oc delete -f '*.json'

  # Delete a pod based on the type and name in the JSON passed into stdin
  cat pod.json | oc delete -f -

  # Delete pods and services with same names "baz" and "foo"
  oc delete pod,service baz foo

  # Delete pods and services with label name=myLabel
  oc delete pods,services -l name=myLabel

  # Delete a pod with minimal delay
  oc delete pod foo --now

  # Force delete a pod on a dead node
  oc delete pod foo --force

  # Delete all pods
  oc delete pods --all

2.6.1.72. oc describe

특정 리소스 또는 리소스 그룹의 세부 정보를 표시

사용 예

  # Describe a node
  oc describe nodes kubernetes-node-emt8.c.myproject.internal

  # Describe a pod
  oc describe pods/nginx

  # Describe a pod identified by type and name in "pod.json"
  oc describe -f pod.json

  # Describe all pods
  oc describe pods

  # Describe pods by label name=myLabel
  oc describe pods -l name=myLabel

  # Describe all pods managed by the 'frontend' replication controller
  # (rc-created pods get the name of the rc as a prefix in the pod name)
  oc describe pods frontend

2.6.1.73. oc diff

would-be applied 버전에 대해 라이브 버전을 diff

사용 예

  # Diff resources included in pod.json
  oc diff -f pod.json

  # Diff file read from stdin
  cat service.yaml | oc diff -f -

2.6.1.74. oc edit

서버에서 리소스를 편집

사용 예

  # Edit the service named 'registry'
  oc edit svc/registry

  # Use an alternative editor
  KUBE_EDITOR="nano" oc edit svc/registry

  # Edit the job 'myjob' in JSON using the v1 API format
  oc edit job.v1.batch/myjob -o json

  # Edit the deployment 'mydeployment' in YAML and save the modified config in its annotation
  oc edit deployment/mydeployment -o yaml --save-config

  # Edit the 'status' subresource for the 'mydeployment' deployment
  oc edit deployment mydeployment --subresource='status'

2.6.1.75. oc events

이벤트 나열

사용 예

  # List recent events in the default namespace
  oc events

  # List recent events in all namespaces
  oc events --all-namespaces

  # List recent events for the specified pod, then wait for more events and list them as they arrive
  oc events --for pod/web-pod-13je7 --watch

  # List recent events in YAML format
  oc events -oyaml

  # List recent only events of type 'Warning' or 'Normal'
  oc events --types=Warning,Normal

2.6.1.76. oc exec

컨테이너에서 명령을 실행

사용 예

  # Get output from running the 'date' command from pod mypod, using the first container by default
  oc exec mypod -- date

  # Get output from running the 'date' command in ruby-container from pod mypod
  oc exec mypod -c ruby-container -- date

  # Switch to raw terminal mode; sends stdin to 'bash' in ruby-container from pod mypod
  # and sends stdout/stderr from 'bash' back to the client
  oc exec mypod -c ruby-container -i -t -- bash -il

  # List contents of /usr from the first container of pod mypod and sort by modification time
  # If the command you want to execute in the pod has any flags in common (e.g. -i),
  # you must use two dashes (--) to separate your command's flags/arguments
  # Also note, do not surround your command and its flags/arguments with quotes
  # unless that is how you would execute it normally (i.e., do ls -t /usr, not "ls -t /usr")
  oc exec mypod -i -t -- ls -t /usr

  # Get output from running 'date' command from the first pod of the deployment mydeployment, using the first container by default
  oc exec deploy/mydeployment -- date

  # Get output from running 'date' command from the first pod of the service myservice, using the first container by default
  oc exec svc/myservice -- date

2.6.1.77. oc explain

리소스에 대한 문서 가져오기

사용 예

  # Get the documentation of the resource and its fields
  oc explain pods

  # Get all the fields in the resource
  oc explain pods --recursive

  # Get the explanation for deployment in supported api versions
  oc explain deployments --api-version=apps/v1

  # Get the documentation of a specific field of a resource
  oc explain pods.spec.containers

  # Get the documentation of resources in different format
  oc explain deployment --output=plaintext-openapiv2

2.6.1.78. oc expose

복제된 애플리케이션을 서비스 또는 경로로 노출

사용 예

  # Create a route based on service nginx. The new route will reuse nginx's labels
  oc expose service nginx

  # Create a route and specify your own label and route name
  oc expose service nginx -l name=myroute --name=fromdowntown

  # Create a route and specify a host name
  oc expose service nginx --hostname=www.example.com

  # Create a route with a wildcard
  oc expose service nginx --hostname=x.example.com --wildcard-policy=Subdomain
  # This would be equivalent to *.example.com. NOTE: only hosts are matched by the wildcard; subdomains would not be included

  # Expose a deployment configuration as a service and use the specified port
  oc expose dc ruby-hello-world --port=8080

  # Expose a service as a route in the specified path
  oc expose service nginx --path=/nginx

2.6.1.79. oc extract

시크릿 또는 구성 맵을 디스크에 추출

사용 예

  # Extract the secret "test" to the current directory
  oc extract secret/test

  # Extract the config map "nginx" to the /tmp directory
  oc extract configmap/nginx --to=/tmp

  # Extract the config map "nginx" to STDOUT
  oc extract configmap/nginx --to=-

  # Extract only the key "nginx.conf" from config map "nginx" to the /tmp directory
  oc extract configmap/nginx --to=/tmp --keys=nginx.conf

2.6.1.80. oc get

리소스를 하나 이상 표시

사용 예

  # List all pods in ps output format
  oc get pods

  # List all pods in ps output format with more information (such as node name)
  oc get pods -o wide

  # List a single replication controller with specified NAME in ps output format
  oc get replicationcontroller web

  # List deployments in JSON output format, in the "v1" version of the "apps" API group
  oc get deployments.v1.apps -o json

  # List a single pod in JSON output format
  oc get -o json pod web-pod-13je7

  # List a pod identified by type and name specified in "pod.yaml" in JSON output format
  oc get -f pod.yaml -o json

  # List resources from a directory with kustomization.yaml - e.g. dir/kustomization.yaml
  oc get -k dir/

  # Return only the phase value of the specified pod
  oc get -o template pod/web-pod-13je7 --template={{.status.phase}}

  # List resource information in custom columns
  oc get pod test-pod -o custom-columns=CONTAINER:.spec.containers[0].name,IMAGE:.spec.containers[0].image

  # List all replication controllers and services together in ps output format
  oc get rc,services

  # List one or more resources by their type and names
  oc get rc/web service/frontend pods/web-pod-13je7

  # List the 'status' subresource for a single pod
  oc get pod web-pod-13je7 --subresource status

2.6.1.81. oc get-token

실험적: credentials exec 플러그인으로 외부 OIDC 발행자에서 토큰 가져오기

사용 예

  # Starts an auth code flow to the issuer url with the client id and the given extra scopes
  oc get-token --client-id=client-id --issuer-url=test.issuer.url --extra-scopes=email,profile

  # Starts an authe code flow to the issuer url with a different callback address.
  oc get-token --client-id=client-id --issuer-url=test.issuer.url --callback-address=127.0.0.1:8343

2.6.1.82. oc idle

확장 가능한 리소스를 유휴 상태로 설정

사용 예

  # Idle the scalable controllers associated with the services listed in to-idle.txt
  $ oc idle --resource-names-file to-idle.txt

2.6.1.83. oc image append

이미지에 레이어를 추가하고 레지스트리에 푸시

사용 예

  # Remove the entrypoint on the mysql:latest image
  oc image append --from mysql:latest --to myregistry.com/myimage:latest --image '{"Entrypoint":null}'

  # Add a new layer to the image
  oc image append --from mysql:latest --to myregistry.com/myimage:latest layer.tar.gz

  # Add a new layer to the image and store the result on disk
  # This results in $(pwd)/v2/mysql/blobs,manifests
  oc image append --from mysql:latest --to file://mysql:local layer.tar.gz

  # Add a new layer to the image and store the result on disk in a designated directory
  # This will result in $(pwd)/mysql-local/v2/mysql/blobs,manifests
  oc image append --from mysql:latest --to file://mysql:local --dir mysql-local layer.tar.gz

  # Add a new layer to an image that is stored on disk (~/mysql-local/v2/image exists)
  oc image append --from-dir ~/mysql-local --to myregistry.com/myimage:latest layer.tar.gz

  # Add a new layer to an image that was mirrored to the current directory on disk ($(pwd)/v2/image exists)
  oc image append --from-dir v2 --to myregistry.com/myimage:latest layer.tar.gz

  # Add a new layer to a multi-architecture image for an os/arch that is different from the system's os/arch
  # Note: The first image in the manifest list that matches the filter will be returned when --keep-manifest-list is not specified
  oc image append --from docker.io/library/busybox:latest --filter-by-os=linux/s390x --to myregistry.com/myimage:latest layer.tar.gz

  # Add a new layer to a multi-architecture image for all the os/arch manifests when keep-manifest-list is specified
  oc image append --from docker.io/library/busybox:latest --keep-manifest-list --to myregistry.com/myimage:latest layer.tar.gz

  # Add a new layer to a multi-architecture image for all the os/arch manifests that is specified by the filter, while preserving the manifestlist
  oc image append --from docker.io/library/busybox:latest --filter-by-os=linux/s390x --keep-manifest-list --to myregistry.com/myimage:latest layer.tar.gz

2.6.1.84. oc image extract

이미지에서 파일 시스템으로 파일을 복사

사용 예

  # Extract the busybox image into the current directory
  oc image extract docker.io/library/busybox:latest

  # Extract the busybox image into a designated directory (must exist)
  oc image extract docker.io/library/busybox:latest --path /:/tmp/busybox

  # Extract the busybox image into the current directory for linux/s390x platform
  # Note: Wildcard filter is not supported with extract; pass a single os/arch to extract
  oc image extract docker.io/library/busybox:latest --filter-by-os=linux/s390x

  # Extract a single file from the image into the current directory
  oc image extract docker.io/library/centos:7 --path /bin/bash:.

  # Extract all .repo files from the image's /etc/yum.repos.d/ folder into the current directory
  oc image extract docker.io/library/centos:7 --path /etc/yum.repos.d/*.repo:.

  # Extract all .repo files from the image's /etc/yum.repos.d/ folder into a designated directory (must exist)
  # This results in /tmp/yum.repos.d/*.repo on local system
  oc image extract docker.io/library/centos:7 --path /etc/yum.repos.d/*.repo:/tmp/yum.repos.d

  # Extract an image stored on disk into the current directory ($(pwd)/v2/busybox/blobs,manifests exists)
  # --confirm is required because the current directory is not empty
  oc image extract file://busybox:local --confirm

  # Extract an image stored on disk in a directory other than $(pwd)/v2 into the current directory
  # --confirm is required because the current directory is not empty ($(pwd)/busybox-mirror-dir/v2/busybox exists)
  oc image extract file://busybox:local --dir busybox-mirror-dir --confirm

  # Extract an image stored on disk in a directory other than $(pwd)/v2 into a designated directory (must exist)
  oc image extract file://busybox:local --dir busybox-mirror-dir --path /:/tmp/busybox

  # Extract the last layer in the image
  oc image extract docker.io/library/centos:7[-1]

  # Extract the first three layers of the image
  oc image extract docker.io/library/centos:7[:3]

  # Extract the last three layers of the image
  oc image extract docker.io/library/centos:7[-3:]

2.6.1.85. oc image info

이미지에 대한 정보 표시

사용 예

  # Show information about an image
  oc image info quay.io/openshift/cli:latest

  # Show information about images matching a wildcard
  oc image info quay.io/openshift/cli:4.*

  # Show information about a file mirrored to disk under DIR
  oc image info --dir=DIR file://library/busybox:latest

  # Select which image from a multi-OS image to show
  oc image info library/busybox:latest --filter-by-os=linux/arm64

2.6.1.86. oc image mirror

한 저장소에서 다른 저장소로 이미지를 미러링

사용 예

  # Copy image to another tag
  oc image mirror myregistry.com/myimage:latest myregistry.com/myimage:stable

  # Copy image to another registry
  oc image mirror myregistry.com/myimage:latest docker.io/myrepository/myimage:stable

  # Copy all tags starting with mysql to the destination repository
  oc image mirror myregistry.com/myimage:mysql* docker.io/myrepository/myimage

  # Copy image to disk, creating a directory structure that can be served as a registry
  oc image mirror myregistry.com/myimage:latest file://myrepository/myimage:latest

  # Copy image to S3 (pull from <bucket>.s3.amazonaws.com/image:latest)
  oc image mirror myregistry.com/myimage:latest s3://s3.amazonaws.com/<region>/<bucket>/image:latest

  # Copy image to S3 without setting a tag (pull via @<digest>)
  oc image mirror myregistry.com/myimage:latest s3://s3.amazonaws.com/<region>/<bucket>/image

  # Copy image to multiple locations
  oc image mirror myregistry.com/myimage:latest docker.io/myrepository/myimage:stable \
  docker.io/myrepository/myimage:dev

  # Copy multiple images
  oc image mirror myregistry.com/myimage:latest=myregistry.com/other:test \
  myregistry.com/myimage:new=myregistry.com/other:target

  # Copy manifest list of a multi-architecture image, even if only a single image is found
  oc image mirror myregistry.com/myimage:latest=myregistry.com/other:test \
  --keep-manifest-list=true

  # Copy specific os/arch manifest of a multi-architecture image
  # Run 'oc image info myregistry.com/myimage:latest' to see available os/arch for multi-arch images
  # Note that with multi-arch images, this results in a new manifest list digest that includes only
  # the filtered manifests
  oc image mirror myregistry.com/myimage:latest=myregistry.com/other:test \
  --filter-by-os=os/arch

  # Copy all os/arch manifests of a multi-architecture image
  # Run 'oc image info myregistry.com/myimage:latest' to see list of os/arch manifests that will be mirrored
  oc image mirror myregistry.com/myimage:latest=myregistry.com/other:test \
  --keep-manifest-list=true

  # Note the above command is equivalent to
  oc image mirror myregistry.com/myimage:latest=myregistry.com/other:test \
  --filter-by-os=.*

  # Copy specific os/arch manifest of a multi-architecture image
  # Run 'oc image info myregistry.com/myimage:latest' to see available os/arch for multi-arch images
  # Note that the target registry may reject a manifest list if the platform specific images do not all
  # exist. You must use a registry with sparse registry support enabled.
  oc image mirror myregistry.com/myimage:latest=myregistry.com/other:test \
  --filter-by-os=linux/386 \
  --keep-manifest-list=true

2.6.1.87. oc import-image

컨테이너 이미지 레지스트리에서 이미지를 가져옵니다

사용 예

  # Import tag latest into a new image stream
  oc import-image mystream --from=registry.io/repo/image:latest --confirm

  # Update imported data for tag latest in an already existing image stream
  oc import-image mystream

  # Update imported data for tag stable in an already existing image stream
  oc import-image mystream:stable

  # Update imported data for all tags in an existing image stream
  oc import-image mystream --all

  # Update imported data for a tag that points to a manifest list to include the full manifest list
  oc import-image mystream --import-mode=PreserveOriginal

  # Import all tags into a new image stream
  oc import-image mystream --from=registry.io/repo/image --all --confirm

  # Import all tags into a new image stream using a custom timeout
  oc --request-timeout=5m import-image mystream --from=registry.io/repo/image --all --confirm

2.6.1.88. oc kustomize

디렉터리 또는 URL에서 kustomization 대상을 빌드합니다.

사용 예

  # Build the current working directory
  oc kustomize

  # Build some shared configuration directory
  oc kustomize /home/config/production

  # Build from github
  oc kustomize https://github.com/kubernetes-sigs/kustomize.git/examples/helloWorld?ref=v1.0.6

2.6.1.89. oc label

리소스에서 레이블을 업데이트

사용 예

  # Update pod 'foo' with the label 'unhealthy' and the value 'true'
  oc label pods foo unhealthy=true

  # Update pod 'foo' with the label 'status' and the value 'unhealthy', overwriting any existing value
  oc label --overwrite pods foo status=unhealthy

  # Update all pods in the namespace
  oc label pods --all status=unhealthy

  # Update a pod identified by the type and name in "pod.json"
  oc label -f pod.json status=unhealthy

  # Update pod 'foo' only if the resource is unchanged from version 1
  oc label pods foo status=unhealthy --resource-version=1

  # Update pod 'foo' by removing a label named 'bar' if it exists
  # Does not require the --overwrite flag
  oc label pods foo bar-

2.6.1.90. oc login

서버에 로그인

사용 예

  # Log in interactively
  oc login --username=myuser

  # Log in to the given server with the given certificate authority file
  oc login localhost:8443 --certificate-authority=/path/to/cert.crt

  # Log in to the given server with the given credentials (will not prompt interactively)
  oc login localhost:8443 --username=myuser --password=mypass

  # Log in to the given server through a browser
  oc login localhost:8443 --web --callback-port 8280

  # Log in to the external OIDC issuer through Auth Code + PKCE by starting a local server listening port 8080
  oc login --exec-plugin=oc-oidc --issuer-url=<issuer_url> --client-id=<client_id> --extra-scopes=email,profile --callback-port=8080

  # Log in with an external OIDC if the external OIDC certificate is not publically trusted
  oc login --exec-plugin=oc-oidc --issuer-url=<issuer_url> --client-id=<client_id> --extra-scopes=email --callback-port=8080 --oidc-certificate-authority <CA for external OIDC certificate>

표 2.3. 인수

옵션정의

--exec-plugin

외부 OIDC 발행자를 인증하는 데 사용되는 exec 플러그인 자격 증명 유형을 지정합니다. 현재는 oc-oidc 만 지원됩니다.

--issuer-url

외부 발행자에 대한 발행자 URL입니다. 필수 항목입니다.

--client-id

외부 OIDC 발행자의 클라이언트 ID입니다. 인증 코드와 PKCE만 지원합니다. 필수 항목입니다.

--extra-scopes

외부 OIDC 발행자의 추가 범위입니다. 선택 사항:

--callback-port

인증 흐름이 완료된 후 콜백 서버가 리디렉션되는 포트입니다. 기본값은 임의의 열린 포트입니다.

--oidc-certificate-authority

외부 OIDC 인증 기관의 인증서 파일의 경로입니다.

2.6.1.91. oc logout

현재 서버 세션을 종료

사용 예

  # Log out
  oc logout

2.6.1.92. oc logs

Pod에서 컨테이너의 로그를 출력

사용 예

  # Start streaming the logs of the most recent build of the openldap build config
  oc logs -f bc/openldap

  # Start streaming the logs of the latest deployment of the mysql deployment config
  oc logs -f dc/mysql

  # Get the logs of the first deployment for the mysql deployment config. Note that logs
  # from older deployments may not exist either because the deployment was successful
  # or due to deployment pruning or manual deletion of the deployment
  oc logs --version=1 dc/mysql

  # Return a snapshot of ruby-container logs from pod backend
  oc logs backend -c ruby-container

  # Start streaming of ruby-container logs from pod backend
  oc logs -f pod/backend -c ruby-container

2.6.1.93. oc new-app

새 애플리케이션을 생성

사용 예

  # List all local templates and image streams that can be used to create an app
  oc new-app --list

  # Create an application based on the source code in the current git repository (with a public remote) and a container image
  oc new-app . --image=registry/repo/langimage

  # Create an application myapp with Docker based build strategy expecting binary input
  oc new-app  --strategy=docker --binary --name myapp

  # Create a Ruby application based on the provided [image]~[source code] combination
  oc new-app centos/ruby-25-centos7~https://github.com/sclorg/ruby-ex.git

  # Use the public container registry MySQL image to create an app. Generated artifacts will be labeled with db=mysql
  oc new-app mysql MYSQL_USER=user MYSQL_PASSWORD=pass MYSQL_DATABASE=testdb -l db=mysql

  # Use a MySQL image in a private registry to create an app and override application artifacts' names
  oc new-app --image=myregistry.com/mycompany/mysql --name=private

  # Use an image with the full manifest list to create an app and override application artifacts' names
  oc new-app --image=myregistry.com/mycompany/image --name=private --import-mode=PreserveOriginal

  # Create an application from a remote repository using its beta4 branch
  oc new-app https://github.com/openshift/ruby-hello-world#beta4

  # Create an application based on a stored template, explicitly setting a parameter value
  oc new-app --template=ruby-helloworld-sample --param=MYSQL_USER=admin

  # Create an application from a remote repository and specify a context directory
  oc new-app https://github.com/youruser/yourgitrepo --context-dir=src/build

  # Create an application from a remote private repository and specify which existing secret to use
  oc new-app https://github.com/youruser/yourgitrepo --source-secret=yoursecret

  # Create an application based on a template file, explicitly setting a parameter value
  oc new-app --file=./example/myapp/template.json --param=MYSQL_USER=admin

  # Search all templates, image streams, and container images for the ones that match "ruby"
  oc new-app --search ruby

  # Search for "ruby", but only in stored templates (--template, --image-stream and --image
  # can be used to filter search results)
  oc new-app --search --template=ruby

  # Search for "ruby" in stored templates and print the output as YAML
  oc new-app --search --template=ruby --output=yaml

2.6.1.94. oc new-build

새 빌드 구성을 생성

사용 예

  # Create a build config based on the source code in the current git repository (with a public
  # remote) and a container image
  oc new-build . --image=repo/langimage

  # Create a NodeJS build config based on the provided [image]~[source code] combination
  oc new-build centos/nodejs-8-centos7~https://github.com/sclorg/nodejs-ex.git

  # Create a build config from a remote repository using its beta2 branch
  oc new-build https://github.com/openshift/ruby-hello-world#beta2

  # Create a build config using a Dockerfile specified as an argument
  oc new-build -D $'FROM centos:7\nRUN yum install -y httpd'

  # Create a build config from a remote repository and add custom environment variables
  oc new-build https://github.com/openshift/ruby-hello-world -e RACK_ENV=development

  # Create a build config from a remote private repository and specify which existing secret to use
  oc new-build https://github.com/youruser/yourgitrepo --source-secret=yoursecret

  # Create a build config using  an image with the full manifest list to create an app and override application artifacts' names
  oc new-build --image=myregistry.com/mycompany/image --name=private --import-mode=PreserveOriginal

  # Create a build config from a remote repository and inject the npmrc into a build
  oc new-build https://github.com/openshift/ruby-hello-world --build-secret npmrc:.npmrc

  # Create a build config from a remote repository and inject environment data into a build
  oc new-build https://github.com/openshift/ruby-hello-world --build-config-map env:config

  # Create a build config that gets its input from a remote repository and another container image
  oc new-build https://github.com/openshift/ruby-hello-world --source-image=openshift/jenkins-1-centos7 --source-image-path=/var/lib/jenkins:tmp

2.6.1.95. oc new-project

새 프로젝트를 요청

사용 예

  # Create a new project with minimal information
  oc new-project web-team-dev

  # Create a new project with a display name and description
  oc new-project web-team-dev --display-name="Web Team Development" --description="Development project for the web team."

2.6.1.96. oc observe

리소스에 대한 변경 사항을 관찰하고 이에 대응합니다(시험적)

사용 예

  # Observe changes to services
  oc observe services

  # Observe changes to services, including the clusterIP and invoke a script for each
  oc observe services --template '{ .spec.clusterIP }' -- register_dns.sh

  # Observe changes to services filtered by a label selector
  oc observe services -l regist-dns=true --template '{ .spec.clusterIP }' -- register_dns.sh

2.6.1.97. oc patch

리소스 필드 업데이트

사용 예

  # Partially update a node using a strategic merge patch, specifying the patch as JSON
  oc patch node k8s-node-1 -p '{"spec":{"unschedulable":true}}'

  # Partially update a node using a strategic merge patch, specifying the patch as YAML
  oc patch node k8s-node-1 -p $'spec:\n unschedulable: true'

  # Partially update a node identified by the type and name specified in "node.json" using strategic merge patch
  oc patch -f node.json -p '{"spec":{"unschedulable":true}}'

  # Update a container's image; spec.containers[*].name is required because it's a merge key
  oc patch pod valid-pod -p '{"spec":{"containers":[{"name":"kubernetes-serve-hostname","image":"new image"}]}}'

  # Update a container's image using a JSON patch with positional arrays
  oc patch pod valid-pod --type='json' -p='[{"op": "replace", "path": "/spec/containers/0/image", "value":"new image"}]'

  # Update a deployment's replicas through the 'scale' subresource using a merge patch
  oc patch deployment nginx-deployment --subresource='scale' --type='merge' -p '{"spec":{"replicas":2}}'

2.6.1.98. oc plugin list

사용자의 PATH에 표시되는 모든 플러그인 실행 파일을 나열합니다.

사용 예

  # List all available plugins
  oc plugin list

2.6.1.99. oc policy add-role-to-user

현재 프로젝트의 사용자 또는 서비스 계정에 역할을 추가

사용 예

  # Add the 'view' role to user1 for the current project
  oc policy add-role-to-user view user1

  # Add the 'edit' role to serviceaccount1 for the current project
  oc policy add-role-to-user edit -z serviceaccount1

2.6.1.100. oc policy scc-review

Pod를 생성할 수 있는 서비스 계정을 확인

사용 예

  # Check whether service accounts sa1 and sa2 can admit a pod with a template pod spec specified in my_resource.yaml
  # Service Account specified in myresource.yaml file is ignored
  oc policy scc-review -z sa1,sa2 -f my_resource.yaml

  # Check whether service accounts system:serviceaccount:bob:default can admit a pod with a template pod spec specified in my_resource.yaml
  oc policy scc-review -z system:serviceaccount:bob:default -f my_resource.yaml

  # Check whether the service account specified in my_resource_with_sa.yaml can admit the pod
  oc policy scc-review -f my_resource_with_sa.yaml

  # Check whether the default service account can admit the pod; default is taken since no service account is defined in myresource_with_no_sa.yaml
  oc policy scc-review -f myresource_with_no_sa.yaml

2.6.1.101. oc policy scc-subject-review

사용자 또는 서비스 계정의 Pod 생성 가능 여부 확인

사용 예

  # Check whether user bob can create a pod specified in myresource.yaml
  oc policy scc-subject-review -u bob -f myresource.yaml

  # Check whether user bob who belongs to projectAdmin group can create a pod specified in myresource.yaml
  oc policy scc-subject-review -u bob -g projectAdmin -f myresource.yaml

  # Check whether a service account specified in the pod template spec in myresourcewithsa.yaml can create the pod
  oc policy scc-subject-review -f myresourcewithsa.yaml

2.6.1.102. oc port-forward

Pod에 하나 이상의 로컬 포트를 전달

사용 예

  # Listen on ports 5000 and 6000 locally, forwarding data to/from ports 5000 and 6000 in the pod
  oc port-forward pod/mypod 5000 6000

  # Listen on ports 5000 and 6000 locally, forwarding data to/from ports 5000 and 6000 in a pod selected by the deployment
  oc port-forward deployment/mydeployment 5000 6000

  # Listen on port 8443 locally, forwarding to the targetPort of the service's port named "https" in a pod selected by the service
  oc port-forward service/myservice 8443:https

  # Listen on port 8888 locally, forwarding to 5000 in the pod
  oc port-forward pod/mypod 8888:5000

  # Listen on port 8888 on all addresses, forwarding to 5000 in the pod
  oc port-forward --address 0.0.0.0 pod/mypod 8888:5000

  # Listen on port 8888 on localhost and selected IP, forwarding to 5000 in the pod
  oc port-forward --address localhost,10.19.21.23 pod/mypod 8888:5000

  # Listen on a random port locally, forwarding to 5000 in the pod
  oc port-forward pod/mypod :5000

2.6.1.103. oc process

템플릿을 리소스 목록으로 처리

사용 예

  # Convert the template.json file into a resource list and pass to create
  oc process -f template.json | oc create -f -

  # Process a file locally instead of contacting the server
  oc process -f template.json --local -o yaml

  # Process template while passing a user-defined label
  oc process -f template.json -l name=mytemplate

  # Convert a stored template into a resource list
  oc process foo

  # Convert a stored template into a resource list by setting/overriding parameter values
  oc process foo PARM1=VALUE1 PARM2=VALUE2

  # Convert a template stored in different namespace into a resource list
  oc process openshift//foo

  # Convert template.json into a resource list
  cat template.json | oc process -f -

2.6.1.104. oc project

다른 프로젝트로 전환

사용 예

  # Switch to the 'myapp' project
  oc project myapp

  # Display the project currently in use
  oc project

2.6.1.105. oc projects

기존 프로젝트를 표시

사용 예

  # List all projects
  oc projects

2.6.1.106. oc proxy

Kubernetes API 서버에 대해 프록시를 실행

사용 예

  # To proxy all of the Kubernetes API and nothing else
  oc proxy --api-prefix=/

  # To proxy only part of the Kubernetes API and also some static files
  # You can get pods info with 'curl localhost:8001/api/v1/pods'
  oc proxy --www=/my/files --www-prefix=/static/ --api-prefix=/api/

  # To proxy the entire Kubernetes API at a different root
  # You can get pods info with 'curl localhost:8001/custom/api/v1/pods'
  oc proxy --api-prefix=/custom/

  # Run a proxy to the Kubernetes API server on port 8011, serving static content from ./local/www/
  oc proxy --port=8011 --www=./local/www/

  # Run a proxy to the Kubernetes API server on an arbitrary local port
  # The chosen port for the server will be output to stdout
  oc proxy --port=0

  # Run a proxy to the Kubernetes API server, changing the API prefix to k8s-api
  # This makes e.g. the pods API available at localhost:8001/k8s-api/v1/pods/
  oc proxy --api-prefix=/k8s-api

2.6.1.107. oc registry login

통합 레지스트리에 로그인

사용 예

  # Log in to the integrated registry
  oc registry login

  # Log in to different registry using BASIC auth credentials
  oc registry login --registry quay.io/myregistry --auth-basic=USER:PASS

2.6.1.108. oc replace

리소스를 파일 이름 또는 stdin으로 교체

사용 예

  # Replace a pod using the data in pod.json
  oc replace -f ./pod.json

  # Replace a pod based on the JSON passed into stdin
  cat pod.json | oc replace -f -

  # Update a single-container pod's image version (tag) to v4
  oc get pod mypod -o yaml | sed 's/\(image: myimage\):.*$/\1:v4/' | oc replace -f -

  # Force replace, delete and then re-create the resource
  oc replace --force -f ./pod.json

2.6.1.109. oc rollback

애플리케이션의 일부를 이전 배포로 되돌립니다

사용 예

  # Perform a rollback to the last successfully completed deployment for a deployment config
  oc rollback frontend

  # See what a rollback to version 3 will look like, but do not perform the rollback
  oc rollback frontend --to-version=3 --dry-run

  # Perform a rollback to a specific deployment
  oc rollback frontend-2

  # Perform the rollback manually by piping the JSON of the new config back to oc
  oc rollback frontend -o json | oc replace dc/frontend -f -

  # Print the updated deployment configuration in JSON format instead of performing the rollback
  oc rollback frontend -o json

2.6.1.110. oc rollout cancel

진행 중인 배포를 취소

사용 예

  # Cancel the in-progress deployment based on 'nginx'
  oc rollout cancel dc/nginx

2.6.1.111. oc rollout history

롤아웃 내역 보기

사용 예

  # View the rollout history of a deployment
  oc rollout history dc/nginx

  # View the details of deployment revision 3
  oc rollout history dc/nginx --revision=3

2.6.1.112. oc rollout latest

트리거의 최신 상태로 배포 구성에 대한 새 롤아웃 시작

사용 예

  # Start a new rollout based on the latest images defined in the image change triggers
  oc rollout latest dc/nginx

  # Print the rolled out deployment config
  oc rollout latest dc/nginx -o json

2.6.1.113. oc rollout pause

제공된 리소스를 일시 중지됨으로 표시

사용 예

  # Mark the nginx deployment as paused. Any current state of
  # the deployment will continue its function, new updates to the deployment will not
  # have an effect as long as the deployment is paused
  oc rollout pause dc/nginx

2.6.1.114. oc rollout restart

리소스를 다시 시작

사용 예

  # Restart a deployment
  oc rollout restart deployment/nginx

  # Restart a daemon set
  oc rollout restart daemonset/abc

  # Restart deployments with the app=nginx label
  oc rollout restart deployment --selector=app=nginx

2.6.1.115. oc rollout resume

일시 중지된 리소스 재개

사용 예

  # Resume an already paused deployment
  oc rollout resume dc/nginx

2.6.1.116. oc rollout retry

가장 최근에 실패한 롤아웃 재시도

사용 예

  # Retry the latest failed deployment based on 'frontend'
  # The deployer pod and any hook pods are deleted for the latest failed deployment
  oc rollout retry dc/frontend

2.6.1.117. oc rollout status

롤아웃 상태를 표시

사용 예

  # Watch the status of the latest rollout
  oc rollout status dc/nginx

2.6.1.118. oc rollout undo

이전 롤아웃 실행 취소

사용 예

  # Roll back to the previous deployment
  oc rollout undo dc/nginx

  # Roll back to deployment revision 3. The replication controller for that version must exist
  oc rollout undo dc/nginx --to-revision=3

2.6.1.119. oc rsh

컨테이너에서 쉘 세션 시작

사용 예

  # Open a shell session on the first container in pod 'foo'
  oc rsh foo

  # Open a shell session on the first container in pod 'foo' and namespace 'bar'
  # (Note that oc client specific arguments must come before the resource name and its arguments)
  oc rsh -n bar foo

  # Run the command 'cat /etc/resolv.conf' inside pod 'foo'
  oc rsh foo cat /etc/resolv.conf

  # See the configuration of your internal registry
  oc rsh dc/docker-registry cat config.yml

  # Open a shell session on the container named 'index' inside a pod of your job
  oc rsh -c index job/scheduled

2.6.1.120. oc rsync

로컬 파일 시스템과 Pod 간 파일 복사

사용 예

  # Synchronize a local directory with a pod directory
  oc rsync ./local/dir/ POD:/remote/dir

  # Synchronize a pod directory with a local directory
  oc rsync POD:/remote/dir/ ./local/dir

2.6.1.121. oc run

클러스터에서 특정 이미지 실행

사용 예

  # Start a nginx pod
  oc run nginx --image=nginx

  # Start a hazelcast pod and let the container expose port 5701
  oc run hazelcast --image=hazelcast/hazelcast --port=5701

  # Start a hazelcast pod and set environment variables "DNS_DOMAIN=cluster" and "POD_NAMESPACE=default" in the container
  oc run hazelcast --image=hazelcast/hazelcast --env="DNS_DOMAIN=cluster" --env="POD_NAMESPACE=default"

  # Start a hazelcast pod and set labels "app=hazelcast" and "env=prod" in the container
  oc run hazelcast --image=hazelcast/hazelcast --labels="app=hazelcast,env=prod"

  # Dry run; print the corresponding API objects without creating them
  oc run nginx --image=nginx --dry-run=client

  # Start a nginx pod, but overload the spec with a partial set of values parsed from JSON
  oc run nginx --image=nginx --overrides='{ "apiVersion": "v1", "spec": { ... } }'

  # Start a busybox pod and keep it in the foreground, don't restart it if it exits
  oc run -i -t busybox --image=busybox --restart=Never

  # Start the nginx pod using the default command, but use custom arguments (arg1 .. argN) for that command
  oc run nginx --image=nginx -- <arg1> <arg2> ... <argN>

  # Start the nginx pod using a different command and custom arguments
  oc run nginx --image=nginx --command -- <cmd> <arg1> ... <argN>

2.6.1.122. oc scale

배포, 복제본 세트 또는 복제 컨트롤러의 새 크기 설정

사용 예

  # Scale a replica set named 'foo' to 3
  oc scale --replicas=3 rs/foo

  # Scale a resource identified by type and name specified in "foo.yaml" to 3
  oc scale --replicas=3 -f foo.yaml

  # If the deployment named mysql's current size is 2, scale mysql to 3
  oc scale --current-replicas=2 --replicas=3 deployment/mysql

  # Scale multiple replication controllers
  oc scale --replicas=5 rc/example1 rc/example2 rc/example3

  # Scale stateful set named 'web' to 3
  oc scale --replicas=3 statefulset/web

2.6.1.125. oc set build-hook

빌드 구성에서 빌드 후크를 업데이트

사용 예

  # Clear post-commit hook on a build config
  oc set build-hook bc/mybuild --post-commit --remove

  # Set the post-commit hook to execute a test suite using a new entrypoint
  oc set build-hook bc/mybuild --post-commit --command -- /bin/bash -c /var/lib/test-image.sh

  # Set the post-commit hook to execute a shell script
  oc set build-hook bc/mybuild --post-commit --script="/var/lib/test-image.sh param1 param2 && /var/lib/done.sh"

2.6.1.126. oc set build-secret

빌드 구성에서 빌드 보안을 업데이트

사용 예

  # Clear the push secret on a build config
  oc set build-secret --push --remove bc/mybuild

  # Set the pull secret on a build config
  oc set build-secret --pull bc/mybuild mysecret

  # Set the push and pull secret on a build config
  oc set build-secret --push --pull bc/mybuild mysecret

  # Set the source secret on a set of build configs matching a selector
  oc set build-secret --source -l app=myapp gitsecret

2.6.1.127. oc set data

구성 맵 또는 시크릿 내의 데이터를 업데이트

사용 예

  # Set the 'password' key of a secret
  oc set data secret/foo password=this_is_secret

  # Remove the 'password' key from a secret
  oc set data secret/foo password-

  # Update the 'haproxy.conf' key of a config map from a file on disk
  oc set data configmap/bar --from-file=../haproxy.conf

  # Update a secret with the contents of a directory, one key per file
  oc set data secret/foo --from-file=secret-dir

2.6.1.128. oc set deployment-hook

배포 구성에서 배포 후크를 업데이트

사용 예

  # Clear pre and post hooks on a deployment config
  oc set deployment-hook dc/myapp --remove --pre --post

  # Set the pre deployment hook to execute a db migration command for an application
  # using the data volume from the application
  oc set deployment-hook dc/myapp --pre --volumes=data -- /var/lib/migrate-db.sh

  # Set a mid deployment hook along with additional environment variables
  oc set deployment-hook dc/myapp --mid --volumes=data -e VAR1=value1 -e VAR2=value2 -- /var/lib/prepare-deploy.sh

2.6.1.129. oc set env

Pod 템플릿에서 환경 변수를 업데이트

사용 예

  # Update deployment config 'myapp' with a new environment variable
  oc set env dc/myapp STORAGE_DIR=/local

  # List the environment variables defined on a build config 'sample-build'
  oc set env bc/sample-build --list

  # List the environment variables defined on all pods
  oc set env pods --all --list

  # Output modified build config in YAML
  oc set env bc/sample-build STORAGE_DIR=/data -o yaml

  # Update all containers in all replication controllers in the project to have ENV=prod
  oc set env rc --all ENV=prod

  # Import environment from a secret
  oc set env --from=secret/mysecret dc/myapp

  # Import environment from a config map with a prefix
  oc set env --from=configmap/myconfigmap --prefix=MYSQL_ dc/myapp

  # Remove the environment variable ENV from container 'c1' in all deployment configs
  oc set env dc --all --containers="c1" ENV-

  # Remove the environment variable ENV from a deployment config definition on disk and
  # update the deployment config on the server
  oc set env -f dc.json ENV-

  # Set some of the local shell environment into a deployment config on the server
  oc set env | grep RAILS_ | oc env -e - dc/myapp

2.6.1.130. oc set image

Pod 템플릿 이미지 업데이트

사용 예

  # Set a deployment config's nginx container image to 'nginx:1.9.1', and its busybox container image to 'busybox'.
  oc set image dc/nginx busybox=busybox nginx=nginx:1.9.1

  # Set a deployment config's app container image to the image referenced by the imagestream tag 'openshift/ruby:2.3'.
  oc set image dc/myapp app=openshift/ruby:2.3 --source=imagestreamtag

  # Update all deployments' and rc's nginx container's image to 'nginx:1.9.1'
  oc set image deployments,rc nginx=nginx:1.9.1 --all

  # Update image of all containers of daemonset abc to 'nginx:1.9.1'
  oc set image daemonset abc *=nginx:1.9.1

  # Print result (in YAML format) of updating nginx container image from local file, without hitting the server
  oc set image -f path/to/file.yaml nginx=nginx:1.9.1 --local -o yaml

2.6.1.131. oc set image-lookup

애플리케이션을 배포할 때 이미지가 해결되는 방법 변경

사용 예

  # Print all of the image streams and whether they resolve local names
  oc set image-lookup

  # Use local name lookup on image stream mysql
  oc set image-lookup mysql

  # Force a deployment to use local name lookup
  oc set image-lookup deploy/mysql

  # Show the current status of the deployment lookup
  oc set image-lookup deploy/mysql --list

  # Disable local name lookup on image stream mysql
  oc set image-lookup mysql --enabled=false

  # Set local name lookup on all image streams
  oc set image-lookup --all

2.6.1.132. oc set probe

Pod 템플릿에서 프로브 업데이트

사용 예

  # Clear both readiness and liveness probes off all containers
  oc set probe dc/myapp --remove --readiness --liveness

  # Set an exec action as a liveness probe to run 'echo ok'
  oc set probe dc/myapp --liveness -- echo ok

  # Set a readiness probe to try to open a TCP socket on 3306
  oc set probe rc/mysql --readiness --open-tcp=3306

  # Set an HTTP startup probe for port 8080 and path /healthz over HTTP on the pod IP
  oc set probe dc/webapp --startup --get-url=http://:8080/healthz

  # Set an HTTP readiness probe for port 8080 and path /healthz over HTTP on the pod IP
  oc set probe dc/webapp --readiness --get-url=http://:8080/healthz

  # Set an HTTP readiness probe over HTTPS on 127.0.0.1 for a hostNetwork pod
  oc set probe dc/router --readiness --get-url=https://127.0.0.1:1936/stats

  # Set only the initial-delay-seconds field on all deployments
  oc set probe dc --all --readiness --initial-delay-seconds=30

2.6.1.133. oc set resources

Pod 템플릿을 사용하여 오브젝트에서 리소스 요청/제한 업데이트

사용 예

  # Set a deployments nginx container CPU limits to "200m and memory to 512Mi"
  oc set resources deployment nginx -c=nginx --limits=cpu=200m,memory=512Mi

  # Set the resource request and limits for all containers in nginx
  oc set resources deployment nginx --limits=cpu=200m,memory=512Mi --requests=cpu=100m,memory=256Mi

  # Remove the resource requests for resources on containers in nginx
  oc set resources deployment nginx --limits=cpu=0,memory=0 --requests=cpu=0,memory=0

  # Print the result (in YAML format) of updating nginx container limits locally, without hitting the server
  oc set resources -f path/to/file.yaml --limits=cpu=200m,memory=512Mi --local -o yaml

2.6.1.134. oc set route-backends

경로의 백엔드 업데이트

사용 예

  # Print the backends on the route 'web'
  oc set route-backends web

  # Set two backend services on route 'web' with 2/3rds of traffic going to 'a'
  oc set route-backends web a=2 b=1

  # Increase the traffic percentage going to b by 10%% relative to a
  oc set route-backends web --adjust b=+10%%

  # Set traffic percentage going to b to 10%% of the traffic going to a
  oc set route-backends web --adjust b=10%%

  # Set weight of b to 10
  oc set route-backends web --adjust b=10

  # Set the weight to all backends to zero
  oc set route-backends web --zero

2.6.1.135. oc set selector

리소스에 선택기 설정

사용 예

  # Set the labels and selector before creating a deployment/service pair.
  oc create service clusterip my-svc --clusterip="None" -o yaml --dry-run | oc set selector --local -f - 'environment=qa' -o yaml | oc create -f -
  oc create deployment my-dep -o yaml --dry-run | oc label --local -f - environment=qa -o yaml | oc create -f -

2.6.1.136. oc set serviceaccount

리소스의 서비스 계정 업데이트

사용 예

  # Set deployment nginx-deployment's service account to serviceaccount1
  oc set serviceaccount deployment nginx-deployment serviceaccount1

  # Print the result (in YAML format) of updated nginx deployment with service account from a local file, without hitting the API server
  oc set sa -f nginx-deployment.yaml serviceaccount1 --local --dry-run -o yaml

2.6.1.137. oc set subject

역할 바인딩 또는 클러스터 역할 바인딩에서 사용자, 그룹 또는 서비스 계정을 업데이트

사용 예

  # Update a cluster role binding for serviceaccount1
  oc set subject clusterrolebinding admin --serviceaccount=namespace:serviceaccount1

  # Update a role binding for user1, user2, and group1
  oc set subject rolebinding admin --user=user1 --user=user2 --group=group1

  # Print the result (in YAML format) of updating role binding subjects locally, without hitting the server
  oc create rolebinding admin --role=admin --user=admin -o yaml --dry-run | oc set subject --local -f - --user=foo -o yaml

2.6.1.138. oc set triggers

하나 이상의 오브젝트에서 트리거 업데이트

사용 예

  # Print the triggers on the deployment config 'myapp'
  oc set triggers dc/myapp

  # Set all triggers to manual
  oc set triggers dc/myapp --manual

  # Enable all automatic triggers
  oc set triggers dc/myapp --auto

  # Reset the GitHub webhook on a build to a new, generated secret
  oc set triggers bc/webapp --from-github
  oc set triggers bc/webapp --from-webhook

  # Remove all triggers
  oc set triggers bc/webapp --remove-all

  # Stop triggering on config change
  oc set triggers dc/myapp --from-config --remove

  # Add an image trigger to a build config
  oc set triggers bc/webapp --from-image=namespace1/image:latest

  # Add an image trigger to a stateful set on the main container
  oc set triggers statefulset/db --from-image=namespace1/image:latest -c main

2.6.1.139. oc set volumes

Pod 템플릿에서 볼륨 업데이트

사용 예

  # List volumes defined on all deployment configs in the current project
  oc set volume dc --all

  # Add a new empty dir volume to deployment config (dc) 'myapp' mounted under
  # /var/lib/myapp
  oc set volume dc/myapp --add --mount-path=/var/lib/myapp

  # Use an existing persistent volume claim (PVC) to overwrite an existing volume 'v1'
  oc set volume dc/myapp --add --name=v1 -t pvc --claim-name=pvc1 --overwrite

  # Remove volume 'v1' from deployment config 'myapp'
  oc set volume dc/myapp --remove --name=v1

  # Create a new persistent volume claim that overwrites an existing volume 'v1'
  oc set volume dc/myapp --add --name=v1 -t pvc --claim-size=1G --overwrite

  # Change the mount point for volume 'v1' to /data
  oc set volume dc/myapp --add --name=v1 -m /data --overwrite

  # Modify the deployment config by removing volume mount "v1" from container "c1"
  # (and by removing the volume "v1" if no other containers have volume mounts that reference it)
  oc set volume dc/myapp --remove --name=v1 --containers=c1

  # Add new volume based on a more complex volume source (AWS EBS, GCE PD,
  # Ceph, Gluster, NFS, ISCSI, ...)
  oc set volume dc/myapp --add -m /data --source=<json-string>

2.6.1.140. oc start-build

새 빌드를 시작

사용 예

  # Starts build from build config "hello-world"
  oc start-build hello-world

  # Starts build from a previous build "hello-world-1"
  oc start-build --from-build=hello-world-1

  # Use the contents of a directory as build input
  oc start-build hello-world --from-dir=src/

  # Send the contents of a Git repository to the server from tag 'v2'
  oc start-build hello-world --from-repo=../hello-world --commit=v2

  # Start a new build for build config "hello-world" and watch the logs until the build
  # completes or fails
  oc start-build hello-world --follow

  # Start a new build for build config "hello-world" and wait until the build completes. It
  # exits with a non-zero return code if the build fails
  oc start-build hello-world --wait

2.6.1.141. oc status

현재 프로젝트의 개요를 표시

사용 예

  # See an overview of the current project
  oc status

  # Export the overview of the current project in an svg file
  oc status -o dot | dot -T svg -o project.svg

  # See an overview of the current project including details for any identified issues
  oc status --suggest

2.6.1.142. oc tag

기존 이미지를 이미지 스트림에 태깅

사용 예

  # Tag the current image for the image stream 'openshift/ruby' and tag '2.0' into the image stream 'yourproject/ruby with tag 'tip'
  oc tag openshift/ruby:2.0 yourproject/ruby:tip

  # Tag a specific image
  oc tag openshift/ruby@sha256:6b646fa6bf5e5e4c7fa41056c27910e679c03ebe7f93e361e6515a9da7e258cc yourproject/ruby:tip

  # Tag an external container image
  oc tag --source=docker openshift/origin-control-plane:latest yourproject/ruby:tip

  # Tag an external container image and request pullthrough for it
  oc tag --source=docker openshift/origin-control-plane:latest yourproject/ruby:tip --reference-policy=local

  # Tag an external container image and include the full manifest list
  oc tag --source=docker openshift/origin-control-plane:latest yourproject/ruby:tip --import-mode=PreserveOriginal

  # Remove the specified spec tag from an image stream
  oc tag openshift/origin-control-plane:latest -d

2.6.1.143. oc version

클라이언트 및 서버 버전 정보를 인쇄

사용 예

  # Print the OpenShift client, kube-apiserver, and openshift-apiserver version information for the current context
  oc version

  # Print the OpenShift client, kube-apiserver, and openshift-apiserver version numbers for the current context in json format
  oc version --output json

  # Print the OpenShift client version information for the current context
  oc version --client

2.6.1.144. oc wait

실험적: 하나 이상의 리소스에서 특정 조건을 대기

사용 예

  # Wait for the pod "busybox1" to contain the status condition of type "Ready"
  oc wait --for=condition=Ready pod/busybox1

  # The default value of status condition is true; you can wait for other targets after an equal delimiter (compared after Unicode simple case folding, which is a more general form of case-insensitivity)
  oc wait --for=condition=Ready=false pod/busybox1

  # Wait for the pod "busybox1" to contain the status phase to be "Running"
  oc wait --for=jsonpath='{.status.phase}'=Running pod/busybox1

  # Wait for the service "loadbalancer" to have ingress.
  oc wait --for=jsonpath='{.status.loadBalancer.ingress}' service/loadbalancer

  # Wait for the pod "busybox1" to be deleted, with a timeout of 60s, after having issued the "delete" command
  oc delete pod/busybox1
  oc wait --for=delete pod/busybox1 --timeout=60s

2.6.1.145. oc whoami

현재 세션에 대한 정보를 반환

사용 예

  # Display the currently authenticated user
  oc whoami

2.7. OpenShift CLI 관리자 명령 참조

이 참조는 OpenShift CLI (oc) 관리자 명령에 대한 설명 및 예제 명령을 제공합니다. 이러한 명령을 사용하려면 cluster-admin 또는 동등한 권한이 있어야 합니다.

개발자 명령의 경우 OpenShift CLI 개발자 명령 참조를 참조하십시오.

oc adm -h 를 실행하여 모든 관리자 명령을 나열하거나 oc <command> --help 를 실행하여 특정 명령에 대한 추가 세부 정보를 가져옵니다.

2.7.1. OpenShift CLI (oc) 관리자 명령

2.7.1.1. oc adm build-chain

빌드의 입력 및 종속 항목을 출력

사용 예

  # Build the dependency tree for the 'latest' tag in <image-stream>
  oc adm build-chain <image-stream>

  # Build the dependency tree for the 'v2' tag in dot format and visualize it via the dot utility
  oc adm build-chain <image-stream>:v2 -o dot | dot -T svg -o deps.svg

  # Build the dependency tree across all namespaces for the specified image stream tag found in the 'test' namespace
  oc adm build-chain <image-stream> -n test --all

2.7.1.2. oc adm catalog mirror

operator-registry 카탈로그 미러링

사용 예

  # Mirror an operator-registry image and its contents to a registry
  oc adm catalog mirror quay.io/my/image:latest myregistry.com

  # Mirror an operator-registry image and its contents to a particular namespace in a registry
  oc adm catalog mirror quay.io/my/image:latest myregistry.com/my-namespace

  # Mirror to an airgapped registry by first mirroring to files
  oc adm catalog mirror quay.io/my/image:latest file:///local/index
  oc adm catalog mirror file:///local/index/my/image:latest my-airgapped-registry.com

  # Configure a cluster to use a mirrored registry
  oc apply -f manifests/imageDigestMirrorSet.yaml

  # Edit the mirroring mappings and mirror with "oc image mirror" manually
  oc adm catalog mirror --manifests-only quay.io/my/image:latest myregistry.com
  oc image mirror -f manifests/mapping.txt

  # Delete all ImageDigestMirrorSets generated by oc adm catalog mirror
  oc delete imagedigestmirrorset -l operators.openshift.org/catalog=true

2.7.1.3. oc adm certificate approve

인증서 서명 요청 승인

사용 예

  # Approve CSR 'csr-sqgzp'
  oc adm certificate approve csr-sqgzp

2.7.1.4. oc adm certificate deny

인증서 서명 요청 거부

사용 예

  # Deny CSR 'csr-sqgzp'
  oc adm certificate deny csr-sqgzp

2.7.1.5. oc adm copy-to-node

지정된 파일을 노드에 복사합니다.

2.7.1.6. oc adm cordon

노드를 예약 불가로 표시

사용 예

  # Mark node "foo" as unschedulable
  oc adm cordon foo

2.7.1.7. oc adm create-bootstrap-project-template

부트스트랩 프로젝트 템플릿을 생성

사용 예

  # Output a bootstrap project template in YAML format to stdout
  oc adm create-bootstrap-project-template -o yaml

2.7.1.8. oc adm create-error-template

오류 페이지 템플릿 생성

사용 예

  # Output a template for the error page to stdout
  oc adm create-error-template

2.7.1.9. oc adm create-login-template

로그인 템플릿 생성

사용 예

  # Output a template for the login page to stdout
  oc adm create-login-template

2.7.1.10. oc adm create-provider-selection-template

공급자 선택 템플릿 생성

사용 예

  # Output a template for the provider selection page to stdout
  oc adm create-provider-selection-template

2.7.1.11. oc adm drain

유지 관리를 위해 노드를 드레이닝

사용 예

  # Drain node "foo", even if there are pods not managed by a replication controller, replica set, job, daemon set, or stateful set on it
  oc adm drain foo --force

  # As above, but abort if there are pods not managed by a replication controller, replica set, job, daemon set, or stateful set, and use a grace period of 15 minutes
  oc adm drain foo --grace-period=900

2.7.1.12. oc adm groups add-users

그룹에 사용자 추가

사용 예

  # Add user1 and user2 to my-group
  oc adm groups add-users my-group user1 user2

2.7.1.13. oc adm groups new

새 그룹 생성

사용 예

  # Add a group with no users
  oc adm groups new my-group

  # Add a group with two users
  oc adm groups new my-group user1 user2

  # Add a group with one user and shorter output
  oc adm groups new my-group user1 -o name

2.7.1.14. oc adm groups prune

외부 공급자에서 누락된 레코드를 참조하는 이전 OpenShift 그룹 제거

사용 예

  # Prune all orphaned groups
  oc adm groups prune --sync-config=/path/to/ldap-sync-config.yaml --confirm

  # Prune all orphaned groups except the ones from the denylist file
  oc adm groups prune --blacklist=/path/to/denylist.txt --sync-config=/path/to/ldap-sync-config.yaml --confirm

  # Prune all orphaned groups from a list of specific groups specified in an allowlist file
  oc adm groups prune --whitelist=/path/to/allowlist.txt --sync-config=/path/to/ldap-sync-config.yaml --confirm

  # Prune all orphaned groups from a list of specific groups specified in a list
  oc adm groups prune groups/group_name groups/other_name --sync-config=/path/to/ldap-sync-config.yaml --confirm

2.7.1.15. oc adm groups remove-users

그룹에서 사용자 제거

사용 예

  # Remove user1 and user2 from my-group
  oc adm groups remove-users my-group user1 user2

2.7.1.16. oc adm groups sync

외부 공급자에서 레코드와 OpenShift 그룹 동기화

사용 예

  # Sync all groups with an LDAP server
  oc adm groups sync --sync-config=/path/to/ldap-sync-config.yaml --confirm

  # Sync all groups except the ones from the blacklist file with an LDAP server
  oc adm groups sync --blacklist=/path/to/blacklist.txt --sync-config=/path/to/ldap-sync-config.yaml --confirm

  # Sync specific groups specified in an allowlist file with an LDAP server
  oc adm groups sync --whitelist=/path/to/allowlist.txt --sync-config=/path/to/sync-config.yaml --confirm

  # Sync all OpenShift groups that have been synced previously with an LDAP server
  oc adm groups sync --type=openshift --sync-config=/path/to/ldap-sync-config.yaml --confirm

  # Sync specific OpenShift groups if they have been synced previously with an LDAP server
  oc adm groups sync groups/group1 groups/group2 groups/group3 --sync-config=/path/to/sync-config.yaml --confirm

2.7.1.17. oc adm inspect

지정된 리소스에 대한 디버깅 데이터 수집

사용 예

  # Collect debugging data for the "openshift-apiserver" clusteroperator
  oc adm inspect clusteroperator/openshift-apiserver

  # Collect debugging data for the "openshift-apiserver" and "kube-apiserver" clusteroperators
  oc adm inspect clusteroperator/openshift-apiserver clusteroperator/kube-apiserver

  # Collect debugging data for all clusteroperators
  oc adm inspect clusteroperator

  # Collect debugging data for all clusteroperators and clusterversions
  oc adm inspect clusteroperators,clusterversions

2.7.1.18. oc adm migrate icsp

imagecontentsourcepolicy 파일을 imagedigestmirrorset 파일로 업데이트

사용 예

  # Update the imagecontentsourcepolicy.yaml file to a new imagedigestmirrorset file under the mydir directory
  oc adm migrate icsp imagecontentsourcepolicy.yaml --dest-dir mydir

2.7.1.19. oc adm migrate template-instances

최신 group-version-kinds를 가리키도록 템플릿 인스턴스를 업데이트

사용 예

  # Perform a dry-run of updating all objects
  oc adm migrate template-instances

  # To actually perform the update, the confirm flag must be appended
  oc adm migrate template-instances --confirm

2.7.1.20. oc adm must-gather

디버그 정보 수집을 위해 Pod의 새 인스턴스를 시작

사용 예

  # Gather information using the default plug-in image and command, writing into ./must-gather.local.<rand>
  oc adm must-gather

  # Gather information with a specific local folder to copy to
  oc adm must-gather --dest-dir=/local/directory

  # Gather audit information
  oc adm must-gather -- /usr/bin/gather_audit_logs

  # Gather information using multiple plug-in images
  oc adm must-gather --image=quay.io/kubevirt/must-gather --image=quay.io/openshift/origin-must-gather

  # Gather information using a specific image stream plug-in
  oc adm must-gather --image-stream=openshift/must-gather:latest

  # Gather information using a specific image, command, and pod directory
  oc adm must-gather --image=my/image:tag --source-dir=/pod/directory -- myspecial-command.sh

2.7.1.21. oc adm new-project

새 프로젝트 생성

사용 예

  # Create a new project using a node selector
  oc adm new-project myproject --node-selector='type=user-node,region=east'

2.7.1.22. oc adm node-logs

노드 로그를 표시하고 필터링

사용 예

  # Show kubelet logs from all masters
  oc adm node-logs --role master -u kubelet

  # See what logs are available in masters in /var/log
  oc adm node-logs --role master --path=/

  # Display cron log file from all masters
  oc adm node-logs --role master --path=cron

2.7.1.23. oc adm ocp-certificates monitor-certificates

플랫폼 인증서를 확인합니다.

사용 예

  # Watch platform certificates.
  oc adm ocp-certificates monitor-certificates

2.7.1.24. oc adm ocp-certificates recreate-leaf

클라이언트 다시 생성 및 OpenShift 클러스터의 인증서 제공

2.7.1.25. oc adm ocp-certificates recreate-machine-config-server-serving-cert

OpenShift 클러스터에서 머신 구성 Operator 인증서 다시 생성

2.7.1.26. oc adm ocp-certificates recreate-top-level

OpenShift 클러스터에서 최상위 인증서 다시 생성

2.7.1.27. oc adm ocp-certificates remove-old-trust

OpenShift 클러스터에서 플랫폼 신뢰 번들을 나타내는 ConfigMap에서 이전 CA 제거

사용 예

  #  Remove only CA certificates created before a certain date from all trust bundles
  oc adm ocp-certificates remove-old-trust configmaps -A --all --created-before 2023-06-05T14:44:06Z

2.7.1.28. oc adm ocp-certificates update-ignition-ca-bundle-for-machine-config-server

업데이트된 MCO certfs를 사용하도록 OpenShift 클러스터에서 user-data 시크릿 업데이트

사용 예

  # Regenerate the MCO certs without modifying user-data secrets
  oc adm certificates regenerate-machine-config-server-serving-cert --update-ignition=false

  # Update the user-data secrets to use new MCS certs
  oc adm certificates update-ignition-ca-bundle-for-machine-config-server

2.7.1.29. oc adm pod-network isolate-projects

프로젝트 네트워크 격리

사용 예

  # Provide isolation for project p1
  oc adm pod-network isolate-projects <p1>

  # Allow all projects with label name=top-secret to have their own isolated project network
  oc adm pod-network isolate-projects --selector='name=top-secret'

2.7.1.30. oc adm pod-network join-projects

프로젝트 네트워크 참여

사용 예

  # Allow project p2 to use project p1 network
  oc adm pod-network join-projects --to=<p1> <p2>

  # Allow all projects with label name=top-secret to use project p1 network
  oc adm pod-network join-projects --to=<p1> --selector='name=top-secret'

2.7.1.31. oc adm pod-network make-projects-global

프로젝트 네트워크 글로벌 만들기

사용 예

  # Allow project p1 to access all pods in the cluster and vice versa
  oc adm pod-network make-projects-global <p1>

  # Allow all projects with label name=share to access all pods in the cluster and vice versa
  oc adm pod-network make-projects-global --selector='name=share'

2.7.1.32. oc adm policy add-role-to-user

현재 프로젝트의 사용자 또는 서비스 계정에 역할을 추가

사용 예

  # Add the 'view' role to user1 for the current project
  oc adm policy add-role-to-user view user1

  # Add the 'edit' role to serviceaccount1 for the current project
  oc adm policy add-role-to-user edit -z serviceaccount1

2.7.1.33. oc adm policy add-scc-to-group

그룹에 보안 컨텍스트 제한 조건 추가

사용 예

  # Add the 'restricted' security context constraint to group1 and group2
  oc adm policy add-scc-to-group restricted group1 group2

2.7.1.34. oc adm policy add-scc-to-user

사용자 또는 서비스 계정에 보안 컨텍스트 제약 조건 추가

사용 예

  # Add the 'restricted' security context constraint to user1 and user2
  oc adm policy add-scc-to-user restricted user1 user2

  # Add the 'privileged' security context constraint to serviceaccount1 in the current namespace
  oc adm policy add-scc-to-user privileged -z serviceaccount1

2.7.1.35. oc adm policy scc-review

Pod를 생성할 수 있는 서비스 계정을 확인

사용 예

  # Check whether service accounts sa1 and sa2 can admit a pod with a template pod spec specified in my_resource.yaml
  # Service Account specified in myresource.yaml file is ignored
  oc adm policy scc-review -z sa1,sa2 -f my_resource.yaml

  # Check whether service accounts system:serviceaccount:bob:default can admit a pod with a template pod spec specified in my_resource.yaml
  oc adm policy scc-review -z system:serviceaccount:bob:default -f my_resource.yaml

  # Check whether the service account specified in my_resource_with_sa.yaml can admit the pod
  oc adm policy scc-review -f my_resource_with_sa.yaml

  # Check whether the default service account can admit the pod; default is taken since no service account is defined in myresource_with_no_sa.yaml
  oc adm policy scc-review -f myresource_with_no_sa.yaml

2.7.1.36. oc adm policy scc-subject-review

사용자 또는 서비스 계정의 Pod 생성 가능 여부 확인

사용 예

  # Check whether user bob can create a pod specified in myresource.yaml
  oc adm policy scc-subject-review -u bob -f myresource.yaml

  # Check whether user bob who belongs to projectAdmin group can create a pod specified in myresource.yaml
  oc adm policy scc-subject-review -u bob -g projectAdmin -f myresource.yaml

  # Check whether a service account specified in the pod template spec in myresourcewithsa.yaml can create the pod
  oc adm policy scc-subject-review -f myresourcewithsa.yaml

2.7.1.37. oc adm prune 빌드

이전 빌드 및 실패한 빌드 삭제

사용 예

  # Dry run deleting older completed and failed builds and also including
  # all builds whose associated build config no longer exists
  oc adm prune builds --orphans

  # To actually perform the prune operation, the confirm flag must be appended
  oc adm prune builds --orphans --confirm

2.7.1.38. oc adm prune deployment

이전 완료 및 실패한 배포 구성 제거

사용 예

  # Dry run deleting all but the last complete deployment for every deployment config
  oc adm prune deployments --keep-complete=1

  # To actually perform the prune operation, the confirm flag must be appended
  oc adm prune deployments --keep-complete=1 --confirm

2.7.1.39. oc adm prune groups

외부 공급자에서 누락된 레코드를 참조하는 이전 OpenShift 그룹 제거

사용 예

  # Prune all orphaned groups
  oc adm prune groups --sync-config=/path/to/ldap-sync-config.yaml --confirm

  # Prune all orphaned groups except the ones from the denylist file
  oc adm prune groups --blacklist=/path/to/denylist.txt --sync-config=/path/to/ldap-sync-config.yaml --confirm

  # Prune all orphaned groups from a list of specific groups specified in an allowlist file
  oc adm prune groups --whitelist=/path/to/allowlist.txt --sync-config=/path/to/ldap-sync-config.yaml --confirm

  # Prune all orphaned groups from a list of specific groups specified in a list
  oc adm prune groups groups/group_name groups/other_name --sync-config=/path/to/ldap-sync-config.yaml --confirm

2.7.1.40. oc adm prune images

권장되지 않은 이미지 제거

사용 예

  # See what the prune command would delete if only images and their referrers were more than an hour old
  # and obsoleted by 3 newer revisions under the same tag were considered
  oc adm prune images --keep-tag-revisions=3 --keep-younger-than=60m

  # To actually perform the prune operation, the confirm flag must be appended
  oc adm prune images --keep-tag-revisions=3 --keep-younger-than=60m --confirm

  # See what the prune command would delete if we are interested in removing images
  # exceeding currently set limit ranges ('openshift.io/Image')
  oc adm prune images --prune-over-size-limit

  # To actually perform the prune operation, the confirm flag must be appended
  oc adm prune images --prune-over-size-limit --confirm

  # Force the insecure HTTP protocol with the particular registry host name
  oc adm prune images --registry-url=http://registry.example.org --confirm

  # Force a secure connection with a custom certificate authority to the particular registry host name
  oc adm prune images --registry-url=registry.example.org --certificate-authority=/path/to/custom/ca.crt --confirm

2.7.1.41. oc adm reboot-machine-config-pool

지정된 MachineConfigPool의 재부팅을 시작합니다.

사용 예

  # Reboot all MachineConfigPools
  oc adm reboot-machine-config-pool mcp/worker mcp/master

  # Reboot all MachineConfigPools that inherit from worker.  This include all custom MachineConfigPools and infra.
  oc adm reboot-machine-config-pool mcp/worker

  # Reboot masters
  oc adm reboot-machine-config-pool mcp/master

2.7.1.42. oc adm release extract

업데이트 페이로드 내용을 디스크에 추출

사용 예

  # Use git to check out the source code for the current cluster release to DIR
  oc adm release extract --git=DIR

  # Extract cloud credential requests for AWS
  oc adm release extract --credentials-requests --cloud=aws

  # Use git to check out the source code for the current cluster release to DIR from linux/s390x image
  # Note: Wildcard filter is not supported; pass a single os/arch to extract
  oc adm release extract --git=DIR quay.io/openshift-release-dev/ocp-release:4.11.2 --filter-by-os=linux/s390x

2.7.1.43. oc adm release info

릴리스에 대한 정보 표시

사용 예

  # Show information about the cluster's current release
  oc adm release info

  # Show the source code that comprises a release
  oc adm release info 4.11.2 --commit-urls

  # Show the source code difference between two releases
  oc adm release info 4.11.0 4.11.2 --commits

  # Show where the images referenced by the release are located
  oc adm release info quay.io/openshift-release-dev/ocp-release:4.11.2 --pullspecs

  # Show information about linux/s390x image
  # Note: Wildcard filter is not supported; pass a single os/arch to extract
  oc adm release info quay.io/openshift-release-dev/ocp-release:4.11.2 --filter-by-os=linux/s390x

2.7.1.44. oc adm release mirror

다른 이미지 레지스트리 위치에 릴리스 미러링

사용 예

  # Perform a dry run showing what would be mirrored, including the mirror objects
  oc adm release mirror 4.11.0 --to myregistry.local/openshift/release \
  --release-image-signature-to-dir /tmp/releases --dry-run

  # Mirror a release into the current directory
  oc adm release mirror 4.11.0 --to file://openshift/release \
  --release-image-signature-to-dir /tmp/releases

  # Mirror a release to another directory in the default location
  oc adm release mirror 4.11.0 --to-dir /tmp/releases

  # Upload a release from the current directory to another server
  oc adm release mirror --from file://openshift/release --to myregistry.com/openshift/release \
  --release-image-signature-to-dir /tmp/releases

  # Mirror the 4.11.0 release to repository registry.example.com and apply signatures to connected cluster
  oc adm release mirror --from=quay.io/openshift-release-dev/ocp-release:4.11.0-x86_64 \
  --to=registry.example.com/your/repository --apply-release-image-signature

2.7.1.45. oc adm release new

새 OpenShift 릴리스 생성

사용 예

  # Create a release from the latest origin images and push to a DockerHub repository
  oc adm release new --from-image-stream=4.11 -n origin --to-image docker.io/mycompany/myrepo:latest

  # Create a new release with updated metadata from a previous release
  oc adm release new --from-release registry.ci.openshift.org/origin/release:v4.11 --name 4.11.1 \
  --previous 4.11.0 --metadata ... --to-image docker.io/mycompany/myrepo:latest

  # Create a new release and override a single image
  oc adm release new --from-release registry.ci.openshift.org/origin/release:v4.11 \
  cli=docker.io/mycompany/cli:latest --to-image docker.io/mycompany/myrepo:latest

  # Run a verification pass to ensure the release can be reproduced
  oc adm release new --from-release registry.ci.openshift.org/origin/release:v4.11

2.7.1.46. oc adm restart-kubelet

지정된 노드에서 kubelet 재시작

사용 예

  # Restart all the nodes,  10% at a time
  oc adm restart-kubelet nodes --all --directive=RemoveKubeletKubeconfig

  # Restart all the nodes,  20 nodes at a time
  oc adm restart-kubelet nodes --all --parallelism=20 --directive=RemoveKubeletKubeconfig

  # Restart all the nodes,  15% at a time
  oc adm restart-kubelet nodes --all --parallelism=15% --directive=RemoveKubeletKubeconfig

  # Restart all the masters at the same time
  oc adm restart-kubelet nodes -l node-role.kubernetes.io/master --parallelism=100% --directive=RemoveKubeletKubeconfig

2.7.1.47. oc adm taint

하나 이상의 노드에서 테인트를 업데이트

사용 예

  # Update node 'foo' with a taint with key 'dedicated' and value 'special-user' and effect 'NoSchedule'
  # If a taint with that key and effect already exists, its value is replaced as specified
  oc adm taint nodes foo dedicated=special-user:NoSchedule

  # Remove from node 'foo' the taint with key 'dedicated' and effect 'NoSchedule' if one exists
  oc adm taint nodes foo dedicated:NoSchedule-

  # Remove from node 'foo' all the taints with key 'dedicated'
  oc adm taint nodes foo dedicated-

  # Add a taint with key 'dedicated' on nodes having label myLabel=X
  oc adm taint node -l myLabel=X  dedicated=foo:PreferNoSchedule

  # Add to node 'foo' a taint with key 'bar' and no value
  oc adm taint nodes foo bar:NoSchedule

2.7.1.48. oc adm top images

이미지에 대한 사용량 통계 표시

사용 예

  # Show usage statistics for images
  oc adm top images

2.7.1.49. oc adm top imagestreams

이미지 스트림에 대한 사용량 통계 표시

사용 예

  # Show usage statistics for image streams
  oc adm top imagestreams

2.7.1.50. oc adm top node

노드의 리소스(CPU/메모리) 사용 표시

사용 예

  # Show metrics for all nodes
  oc adm top node

  # Show metrics for a given node
  oc adm top node NODE_NAME

2.7.1.51. oc adm top pod

Pod의 리소스(CPU/메모리) 사용 표시

사용 예

  # Show metrics for all pods in the default namespace
  oc adm top pod

  # Show metrics for all pods in the given namespace
  oc adm top pod --namespace=NAMESPACE

  # Show metrics for a given pod and its containers
  oc adm top pod POD_NAME --containers

  # Show metrics for the pods defined by label name=myLabel
  oc adm top pod -l name=myLabel

2.7.1.52. oc adm uncordon

노드를 예약 가능으로 표시

사용 예

  # Mark node "foo" as schedulable
  oc adm uncordon foo

2.7.1.53. oc adm upgrade

클러스터 업그레이드 또는 업그레이드 채널 조정

사용 예

  # View the update status and available cluster updates
  oc adm upgrade

  # Update to the latest version
  oc adm upgrade --to-latest=true

2.7.1.54. oc adm verify-image-signature

이미지 서명에 포함된 이미지 ID 확인

사용 예

  # Verify the image signature and identity using the local GPG keychain
  oc adm verify-image-signature sha256:c841e9b64e4579bd56c794bdd7c36e1c257110fd2404bebbb8b613e4935228c4 \
  --expected-identity=registry.local:5000/foo/bar:v1

  # Verify the image signature and identity using the local GPG keychain and save the status
  oc adm verify-image-signature sha256:c841e9b64e4579bd56c794bdd7c36e1c257110fd2404bebbb8b613e4935228c4 \
  --expected-identity=registry.local:5000/foo/bar:v1 --save

  # Verify the image signature and identity via exposed registry route
  oc adm verify-image-signature sha256:c841e9b64e4579bd56c794bdd7c36e1c257110fd2404bebbb8b613e4935228c4 \
  --expected-identity=registry.local:5000/foo/bar:v1 \
  --registry-url=docker-registry.foo.com

  # Remove all signature verifications from the image
  oc adm verify-image-signature sha256:c841e9b64e4579bd56c794bdd7c36e1c257110fd2404bebbb8b613e4935228c4 --remove-all

2.7.1.55. oc adm wait-for-node-reboot

oc adm reboot-machine-config-pool을 실행한 후 노드가 재부팅될 때까지 기다립니다.

사용 예

  # Wait for all nodes to complete a requested reboot from 'oc adm reboot-machine-config-pool mcp/worker mcp/master'
  oc adm wait-for-node-reboot nodes --all

  # Wait for masters to complete a requested reboot from 'oc adm reboot-machine-config-pool mcp/master'
  oc adm wait-for-node-reboot nodes -l node-role.kubernetes.io/master

  # Wait for masters to complete a specific reboot
  oc adm wait-for-node-reboot nodes -l node-role.kubernetes.io/master --reboot-number=4

2.7.1.56. oc adm wait-for-stable-cluster

플랫폼 운영자가 안정될 때까지 기다립니다.

사용 예

  # Wait for all clusteroperators to become stable
  oc adm wait-for-stable-cluster

  # Consider operators to be stable if they report as such for 5 minutes straight
  oc adm wait-for-stable-cluster --minimum-stable-period 5m

2.7.2. 추가 리소스

3장. odo에서 중요한 업데이트

Red Hat은 AWS 문서 사이트의 Red Hat OpenShift Service에 대한 odo 에 대한 정보를 제공하지 않습니다. odo 와 관련된 설명서 정보는 Red Hat 및 업스트림 커뮤니티에서 유지 관리하는 설명서를 참조하십시오.

중요

업스트림 커뮤니티에서 유지 관리하는 자료의 경우 Red Hat은 Cooperative Community Support 에서 지원을 제공합니다.

4장. OpenShift Serverless에서 사용할 Knative CLI

Knative(kn) CLI를 사용하면 AWS의 Red Hat OpenShift Service에서 Knative 구성 요소와 간단한 상호 작용을 수행할 수 있습니다.

4.1. 주요 기능

Knative(kn) CLI는 서버리스 컴퓨팅 작업을 단순하고 간결하게 만들 수 있도록 설계되었습니다. Knative CLI의 주요 기능은 다음과 같습니다.

  • 명령줄에서 서버리스 애플리케이션을 배포합니다.
  • 서비스, 개정, 트래픽 분할 등 Knative Serving 기능을 관리합니다.
  • 이벤트 소스 및 트리거와 같은 Knative 이벤트 구성 요소를 생성하고 관리합니다.
  • 기존 Kubernetes 애플리케이션 및 Knative 서비스를 연결하는 싱크 바인딩을 생성합니다.
  • kubectl CLI와 유사하게 유연한 플러그인 아키텍처를 사용하여 Knative CLI를 확장합니다.
  • Knative 서비스에 대한 자동 스케일링 매개변수를 구성합니다.
  • 작업 결과 대기나 사용자 정의 롤아웃 및 롤백 전략 배포와 같은 사용법을 스크립팅합니다.

4.2. Knative CLI 설치

Knative CLI 설치를 참조하십시오.

5장. Pipelines CLI(tkn)

5.1. tkn 설치

CLI 툴을 사용하여 터미널에서 Red Hat OpenShift Pipelines를 관리합니다. 다음 섹션에서는 다른 플랫폼에 CLI 툴을 설치하는 방법을 설명합니다.

중요

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

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

참고

아카이브 및 RPM에는 다음 실행 파일이 모두 포함되어 있습니다.

  • tkn
  • tkn-pac

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

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

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

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

    $ echo $PATH

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

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

사전 요구 사항

  • Red Hat 계정에 AWS 서브스크립션이 활성 상태인 Red Hat OpenShift Service가 있습니다.
  • 로컬 시스템에 root 또는 sudo 권한이 있어야 합니다.

절차

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

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

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

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

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

    • Linux (x86_64, amd64)

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

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

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

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

    # yum install openshift-pipelines-client

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

$ tkn version

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

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

절차

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

    C:\> path

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

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

절차

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

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

    $ echo $PATH

5.2. OpenShift Pipelines tkn CLI 구성

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

5.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 파일에서 소싱할 수도 있습니다.

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

5.3. OpenShift Pipelines tkn 참조

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

5.3.1. 기본 구문

tkn [command or options] [arguments…​]

5.3.2. 글로벌 옵션

--help, -h

5.3.3. 유틸리티 명령

5.3.3.1. tkn

tkn CLI의 상위 명령입니다.

예: 모든 옵션 표시

$ tkn

5.3.3.2. completion [shell]

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

예: bash 쉘 완료 코드

$ tkn completion bash

5.3.3.3. version

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

예: tkn 버전 확인

$ tkn version

5.3.4. 파이프라인 관리 명령

5.3.4.1. pipeline

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

예: 도움말 표시

$ tkn pipeline --help

5.3.4.2. pipeline delete

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

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

$ tkn pipeline delete mypipeline -n myspace

5.3.4.3. pipeline describe

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

예: mypipeline 파이프라인 설명

$ tkn pipeline describe mypipeline

5.3.4.4. pipeline list

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

예: 파이프라인 목록 표시

$ tkn pipeline list

5.3.4.5. pipeline logs

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

예: mypipeline 파이프라인의 실시간 로그 스트리밍

$ tkn pipeline logs -f mypipeline

5.3.4.6. pipeline start

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

예: mypipeline 파이프라인 시작

$ tkn pipeline start mypipeline

5.3.5. 파이프라인 실행 명령

5.3.5.1. pipelinerun

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

예: 도움말 표시

$ tkn pipelinerun -h

5.3.5.2. pipelinerun cancel

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

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

$ tkn pipelinerun cancel mypipelinerun -n myspace

5.3.5.3. pipelinerun delete

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

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

$ tkn pipelinerun delete mypipelinerun1 mypipelinerun2 -n myspace

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

$ tkn pipelinerun delete -n myspace --keep 5 1

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

예: 모든 파이프라인 삭제

$ tkn pipelinerun delete --all

참고

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

5.3.5.4. pipelinerun describe

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

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

$ tkn pipelinerun describe mypipelinerun -n myspace

5.3.5.5. pipelinerun list

파이프라인 실행 나열.

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

$ tkn pipelinerun list -n myspace

5.3.5.6. pipelinerun logs

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

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

$ tkn pipelinerun logs mypipelinerun -a -n myspace

5.3.6. 작업 관리 명령

5.3.6.1. task

작업을 관리합니다.

예: 도움말 표시

$ tkn task -h

5.3.6.2. task delete

작업을 삭제합니다.

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

$ tkn task delete mytask1 mytask2 -n myspace

5.3.6.3. task describe

작업을 설명합니다.

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

$ tkn task describe mytask -n myspace

5.3.6.4. task list

작업을 나열합니다.

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

$ tkn task list -n myspace

5.3.6.5. task logs

작업 로그를 표시합니다.

예: mytask 작업의 mytaskrun 작업 실행 로그 표시

$ tkn task logs mytask mytaskrun -n myspace

5.3.6.6. task start

작업을 시작합니다.

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

$ tkn task start mytask -s <ServiceAccountName> -n myspace

5.3.7. 작업 실행 명령

5.3.7.1. taskrun

작업 실행을 관리합니다.

예: 도움말 표시

$ tkn taskrun -h

5.3.7.2. taskrun cancel

작업 실행을 취소합니다.

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

$ tkn taskrun cancel mytaskrun -n myspace

5.3.7.3. taskrun delete

TaskRun을 삭제합니다.

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

$ tkn taskrun delete mytaskrun1 mytaskrun2 -n myspace

예: 네임스페이스에서 가장 최근에 실행된 5개의 작업 실행만 삭제

$ tkn taskrun delete -n myspace --keep 5 1

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

5.3.7.4. taskrun describe

작업 실행을 설명합니다.

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

$ tkn taskrun describe mytaskrun -n myspace

5.3.7.5. taskrun list

작업 실행을 나열합니다.

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

$ tkn taskrun list -n myspace

5.3.7.6. taskrun logs

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

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

$ tkn taskrun logs -f mytaskrun -n myspace

5.3.8. 상태 관리 명령

5.3.8.1. condition

상태를 관리합니다.

예: 도움말 표시

$ tkn condition --help

5.3.8.2. condition delete

상태를 삭제합니다.

예: 네임스페이스에서 mycondition1 상태 삭제

$ tkn condition delete mycondition1 -n myspace

5.3.8.3. condition describe

상태를 설명합니다.

예: 네임스페이스의 mycondition1 상태 설명

$ tkn condition describe mycondition1 -n myspace

5.3.8.4. condition list

상태를 나열합니다.

예: 네임스페이스의 상태 나열

$ tkn condition list -n myspace

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

5.3.9.1. resource

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

예: 도움말 표시

$ tkn resource -h

5.3.9.2. resource create

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

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

$ tkn resource create -n myspace

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

5.3.9.3. resource delete

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

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

$ tkn resource delete myresource -n myspace

5.3.9.4. resource describe

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

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

$ tkn resource describe myresource -n myspace

5.3.9.5. resource list

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

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

$ tkn resource list -n myspace

5.3.10. ClusterTask 관리 명령

중요

Red Hat OpenShift Pipelines 1.10, tkn 명령줄 유틸리티의 ClusterTask 기능은 더 이상 사용되지 않으며 향후 릴리스에서 제거될 예정입니다.

5.3.10.1. clustertask

ClusterTask를 관리합니다.

예: 도움말 표시

$ tkn clustertask --help

5.3.10.2. clustertask delete

클러스터의 ClusterTask 리소스를 삭제합니다.

예: mytask1mytask2 ClusterTask 삭제

$ tkn clustertask delete mytask1 mytask2

5.3.10.3. clustertask describe

ClusterTask를 설명합니다.

예: mytask ClusterTask 설명

$ tkn clustertask describe mytask1

5.3.10.4. clustertask list

ClusterTask를 나열합니다.

예: ClusterTask 나열

$ tkn clustertask list

5.3.10.5. clustertask start

ClusterTask를 시작합니다.

예: mytask ClusterTask 시작

$ tkn clustertask start mytask

5.3.11. 트리거 관리 명령

5.3.11.1. eventlistener

EventListener를 관리합니다.

예: 도움말 표시

$ tkn eventlistener -h

5.3.11.2. eventlistener delete

EventListener를 삭제합니다.

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

$ tkn eventlistener delete mylistener1 mylistener2 -n myspace

5.3.11.3. eventlistener describe

EventListener를 설명합니다.

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

$ tkn eventlistener describe mylistener -n myspace

5.3.11.4. eventlistener list

EventListener를 나열합니다.

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

$ tkn eventlistener list -n myspace

5.3.11.5. eventlistener logs

EventListener 로그 표시

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

$ tkn eventlistener logs mylistener -n myspace

5.3.11.6. triggerbinding

TriggerBinding을 관리합니다.

예: TriggerBinding 도움말 표시

$ tkn triggerbinding -h

5.3.11.7. triggerbinding delete

TriggerBinding을 삭제합니다.

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

$ tkn triggerbinding delete mybinding1 mybinding2 -n myspace

5.3.11.8. triggerbinding describe

TriggerBinding을 설명합니다.

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

$ tkn triggerbinding describe mybinding -n myspace

5.3.11.9. triggerbinding list

TriggerBinding을 나열합니다.

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

$ tkn triggerbinding list -n myspace

5.3.11.10. triggertemplate

TriggerTemplate을 관리합니다.

예: TriggerTemplate 도움말 표시

$ tkn triggertemplate -h

5.3.11.11. triggertemplate delete

TriggerTemplate을 삭제합니다.

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

$ tkn triggertemplate delete mytemplate1 mytemplate2 -n `myspace`

5.3.11.12. triggertemplate describe

TriggerTemplate을 설명합니다.

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

$ tkn triggertemplate describe mytemplate -n `myspace`

5.3.11.13. triggertemplate list

TriggerTemplate을 나열합니다.

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

$ tkn triggertemplate list -n myspace

5.3.11.14. clustertriggerbinding

Manage ClusterTriggerBindings.

예: ClusterTriggerBinding 도움말 표시

$ tkn clustertriggerbinding -h

5.3.11.15. clustertriggerbinding delete

ClusterTriggerBinding을 삭제합니다.

예: myclusterbinding1myclusterbinding2 ClusterTriggerBinding 삭제

$ tkn clustertriggerbinding delete myclusterbinding1 myclusterbinding2

5.3.11.16. clustertriggerbinding describe

ClusterTriggerBinding을 설명합니다.

예: myclusterbinding ClusterTriggerBinding 설명

$ tkn clustertriggerbinding describe myclusterbinding

5.3.11.17. clustertriggerbinding list

ClusterTriggerBinding을 나열합니다.

예: 모든 ClusterTriggerBinding 나열

$ tkn clustertriggerbinding list

5.3.12. Hub 상호 작용 명령

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

5.3.12.1. hub

hub와 상호 작용.

예: 도움말 표시

$ tkn hub -h

예: hub API 서버와 상호 작용

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

참고

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

5.3.12.2. hub downgrade

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

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

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

5.3.12.3. hub get

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

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

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

5.3.12.4. hub info

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

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

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

5.3.12.5. hub install

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

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

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

5.3.12.6. hub reinstall

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

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

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

5.3.12.8. hub upgrade

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

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

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

6장. opm CLI

6.1. opm CLI 설치

6.1.1. opm CLI 정보

opm CLI 툴은 Operator 번들 형식과 함께 사용할 수 있도록 Operator 프레임워크에서 제공합니다. 이 툴을 사용하면 소프트웨어 리포지토리와 유사한 Operator 번들 목록에서 Operator 카탈로그를 생성하고 유지 관리할 수 있습니다. 결과적으로 컨테이너 레지스트리에 저장한 다음 클러스터에 설치할 수 있는 컨테이너 이미지가 생성됩니다.

카탈로그에는 컨테이너 이미지가 실행될 때 제공되는 포함된 API를 통해 쿼리할 수 있는 Operator 매니페스트 콘텐츠에 대한 포인터 데이터베이스가 포함되어 있습니다. AWS의 Red Hat OpenShift Service에서 OLM(Operator Lifecycle Manager)은 CatalogSource 오브젝트에 정의된 카탈로그 소스의 이미지를 참조할 수 있으며 주기적으로 이미지를 폴링하여 클러스터에 설치된 Operator를 자주 업데이트할 수 있습니다.

6.1.2. opm CLI 설치

Linux, macOS 또는 Windows 워크스테이션에 opm CLI 툴을 설치할 수 있습니다.

사전 요구 사항

  • Linux의 경우 다음 패키지를 제공해야 합니다.

    • podman 버전 1.9.3 이상(버전 2.0 이상 권장)
    • glibc 버전 2.28 이상

절차

  1. OpenShift 미러 사이트로 이동하여 운영 체제와 일치하는 최신 버전의 tarball을 다운로드합니다.
  2. 아카이브의 압축을 풉니다.

    • Linux 또는 macOS의 경우:

      $ tar xvf <file>
    • Windows의 경우 ZIP 프로그램으로 아카이브의 압축을 풉니다.
  3. PATH에 있는 임의의 위치에 파일을 배치합니다.

    • Linux 또는 macOS의 경우:

      1. PATH를 확인합니다.

        $ echo $PATH
      2. 파일을 이동합니다. 예를 들면 다음과 같습니다.

        $ sudo mv ./opm /usr/local/bin/
    • Windows의 경우:

      1. PATH를 확인합니다.

        C:\> path
      2. 파일을 이동합니다.

        C:\> move opm.exe <directory>

검증

  • opm CLI를 설치한 후 사용할 수 있는지 확인합니다.

    $ opm version

6.2. opm CLI 참조

opm CLI(명령줄 인터페이스)는 Operator 카탈로그를 생성하고 유지 관리하는 툴입니다.

opm CLI 구문

$ opm <command> [<subcommand>] [<argument>] [<flags>]

표 6.1. 글로벌 플래그

플래그설명

-skip-tls-verify

번들 또는 인덱스를 가져오는 동안 컨테이너 이미지 레지스트리의 TLS 인증서 확인을 건너뜁니다.

--use-http

번들을 가져올 때 컨테이너 이미지 레지스트리에 일반 HTTP를 사용합니다.

중요

관련 CLI 명령을 포함한 SQLite 기반 카탈로그 형식은 더 이상 사용되지 않는 기능입니다. 더 이상 사용되지 않는 기능은 AWS의 Red Hat OpenShift Service에 계속 포함되어 있으며 계속 지원됩니다. 그러나 이 기능은 향후 릴리스에서 제거될 예정이므로 새 배포에는 사용하지 않는 것이 좋습니다.

6.2.1. generate

선언적 구성 인덱스에 대한 다양한 아티팩트를 생성합니다.

명령 구문

$ opm generate <subcommand> [<flags>]

표 6.2. 하위 명령 생성

하위 명령설명

dockerfile

선언적 구성 인덱스에 대한 Dockerfile을 생성합니다.

표 6.3. generate 플래그

플래그설명

-h, --help

generate에 대한 도움말입니다.

6.2.1.1. dockerfile

선언적 구성 인덱스에 대한 Dockerfile을 생성합니다.

중요

이 명령은 인덱스를 빌드하는 데 사용되는 < dcRootDir > (< dcDirName>.Dockerfile)과 동일한 디렉터리에 Dockerfile을 생성합니다. 동일한 이름의 Dockerfile이 이미 존재하는 경우 이 명령이 실패합니다.

추가 레이블을 지정할 때 중복 키가 있는 경우 각 중복 키의 마지막 값만 생성된 Dockerfile에 추가됩니다.

명령 구문

$ opm generate dockerfile <dcRootDir> [<flags>]

표 6.4. generate dockerfile 플래그

플래그설명

-i, --binary-image (문자열)

카탈로그를 빌드할 이미지입니다. 기본값은 quay.io/operator-framework/opm:latest 입니다.

-l,--extra-labels (문자열)

생성된 Dockerfile에 포함할 추가 레이블입니다. 레이블에는 key=value 형식이 있습니다.

-h, --help

Dockerfile에 대한 도움말

참고

공식 Red Hat 이미지로 빌드하려면 -i 플래그와 함께 registry.redhat.io/openshift4/ose-operator-registry:v4 값을 사용합니다.

6.2.2. 인덱스

SQLite 데이터베이스 형식의 Operator 인덱스를 기존 Operator 번들에서 생성합니다.

중요

AWS 4.11의 Red Hat OpenShift Service는 파일 기반 카탈로그 형식의 기본 Red Hat 제공 Operator 카탈로그 릴리스입니다. 더 이상 사용되지 않는 SQLite 데이터베이스 형식으로 릴리스된 4.10을 통해 AWS 4.6의 Red Hat OpenShift Service에 대한 기본 Red Hat 제공 Operator 카탈로그입니다.

SQLite 데이터베이스 형식과 관련된 opm 하위 명령, 플래그 및 기능도 더 이상 사용되지 않으며 향후 릴리스에서 제거됩니다. 기능은 계속 지원되며 더 이상 사용되지 않는 SQLite 데이터베이스 형식을 사용하는 카탈로그에 사용해야 합니다.

opm index prune 과 같은 SQLite 데이터베이스 형식을 사용하기 위한 opm 하위 명령 및 플래그의 대부분은 파일 기반 카탈로그 형식과 함께 작동하지 않습니다.

명령 구문

$ opm index <subcommand> [<flags>]

표 6.5. index 하위 명령

하위 명령설명

add

인덱스에 Operator 번들을 추가합니다.

prune

지정되지 않은 모든 패키지의 인덱스를 정리합니다.

prune-stranded

특정 이미지와 연결되지 않은 번들인 stranded 번들의 인덱스를 정리합니다.

rm

인덱스에서 전체 Operator를 삭제합니다.

6.2.2.1. add

인덱스에 Operator 번들을 추가합니다.

명령 구문

$ opm index add [<flags>]

표 6.6. 인덱스 추가 플래그

플래그설명

-i, --binary-image

on-image opm 명령의 컨테이너 이미지

-u,--build-tool (문자열)

컨테이너 이미지를 빌드하는 툴: podman (기본값) 또는 docker. --container-tool 플래그의 일부를 덮어씁니다.

-b,--bundles (문자열)

추가할 번들의 쉼표로 구분된 목록입니다.

-c,--container-tool (문자열)

저장 및 빌드(예: docker 또는 podman )와 같은 컨테이너 이미지와 상호 작용하는 툴입니다.

-f,--from-index (문자열)

추가할 이전 인덱스입니다.

--generate

활성화하면 Dockerfile만 생성하여 로컬 디스크에 저장합니다.

--mode (문자열)

채널 그래프의 업데이트 방법을 정의하는 그래프 업데이트 모드(기본값), semver 또는 semver-skippatch.

-d,--out-dockerfile (문자열)

선택 사항: Dockerfile을 생성하는 경우 파일 이름을 지정합니다.

--permissive

레지스트리 로드 오류를 허용합니다.

-p,--pull-tool (문자열)

컨테이너 이미지를 가져오는 툴: none (기본값), docker 또는 podman. --container-tool 플래그의 일부를 덮어씁니다.

-t,--tag (문자열)

빌드 중인 컨테이너 이미지에 대한 사용자 정의 태그입니다.

6.2.2.2. prune

지정되지 않은 모든 패키지의 인덱스를 정리합니다.

명령 구문

$ opm index prune [<flags>]

표 6.7. 인덱스 정리 플래그

플래그설명

-i, --binary-image

on-image opm 명령의 컨테이너 이미지

-c,--container-tool (문자열)

저장 및 빌드(예: docker 또는 podman )와 같은 컨테이너 이미지와 상호 작용하는 툴입니다.

-f,--from-index (문자열)

정리할 인덱스입니다.

--generate

활성화하면 Dockerfile만 생성하여 로컬 디스크에 저장합니다.

-d,--out-dockerfile (문자열)

선택 사항: Dockerfile을 생성하는 경우 파일 이름을 지정합니다.

-p,--packages (문자열)

쉼표로 구분된 보관할 패키지 목록입니다.

--permissive

레지스트리 로드 오류를 허용합니다.

-t,--tag (문자열)

빌드 중인 컨테이너 이미지에 대한 사용자 정의 태그입니다.

6.2.2.3. prune-stranded

특정 이미지와 연결되지 않은 번들인 stranded 번들의 인덱스를 정리합니다.

명령 구문

$ opm index prune-stranded [<flags>]

표 6.8. 인덱스 정리된 플래그

플래그설명

-i, --binary-image

on-image opm 명령의 컨테이너 이미지

-c,--container-tool (문자열)

저장 및 빌드(예: docker 또는 podman )와 같은 컨테이너 이미지와 상호 작용하는 툴입니다.

-f,--from-index (문자열)

정리할 인덱스입니다.

--generate

활성화하면 Dockerfile만 생성하여 로컬 디스크에 저장합니다.

-d,--out-dockerfile (문자열)

선택 사항: Dockerfile을 생성하는 경우 파일 이름을 지정합니다.

-p,--packages (문자열)

쉼표로 구분된 보관할 패키지 목록입니다.

--permissive

레지스트리 로드 오류를 허용합니다.

-t,--tag (문자열)

빌드 중인 컨테이너 이미지에 대한 사용자 정의 태그입니다.

6.2.2.4. rm

인덱스에서 전체 Operator를 삭제합니다.

명령 구문

$ opm index rm [<flags>]

표 6.9. 인덱스 rm 플래그

플래그설명

-i, --binary-image

on-image opm 명령의 컨테이너 이미지

-u,--build-tool (문자열)

컨테이너 이미지를 빌드하는 툴: podman (기본값) 또는 docker. --container-tool 플래그의 일부를 덮어씁니다.

-c,--container-tool (문자열)

저장 및 빌드(예: docker 또는 podman )와 같은 컨테이너 이미지와 상호 작용하는 툴입니다.

-f,--from-index (문자열)

삭제할 이전 인덱스입니다.

--generate

활성화하면 Dockerfile만 생성하여 로컬 디스크에 저장합니다.

-o,--operators (문자열)

삭제할 Operator의 쉼표로 구분된 목록입니다.

-d,--out-dockerfile (문자열)

선택 사항: Dockerfile을 생성하는 경우 파일 이름을 지정합니다.

-p,--packages (문자열)

쉼표로 구분된 보관할 패키지 목록입니다.

--permissive

레지스트리 로드 오류를 허용합니다.

-p,--pull-tool (문자열)

컨테이너 이미지를 가져오는 툴: none (기본값), docker 또는 podman. --container-tool 플래그의 일부를 덮어씁니다.

-t,--tag (문자열)

빌드 중인 컨테이너 이미지에 대한 사용자 정의 태그입니다.

6.2.3. init

olm.package 선언적 구성 Blob을 생성합니다.

명령 구문

$ opm init <package_name> [<flags>]

표 6.10. init 플래그

플래그설명

-c, --default-channel (string)

서브스크립션이 지정되지 않은 경우 기본값으로 설정할 채널입니다.

-d,--description (문자열)

Operator의 README.md 또는 기타 문서 경로입니다.

-i, --icon (string)

패키지 아이콘 경로입니다.

-o, --output(문자열)

출력 형식: json (기본값) 또는 yaml.

6.2.4. migrate

SQLite 데이터베이스 형식 인덱스 이미지 또는 데이터베이스 파일을 파일 기반 카탈로그로 마이그레이션합니다.

중요

관련 CLI 명령을 포함한 SQLite 기반 카탈로그 형식은 더 이상 사용되지 않는 기능입니다. 더 이상 사용되지 않는 기능은 AWS의 Red Hat OpenShift Service에 계속 포함되어 있으며 계속 지원됩니다. 그러나 이 기능은 향후 릴리스에서 제거될 예정이므로 새 배포에는 사용하지 않는 것이 좋습니다.

명령 구문

$ opm migrate <index_ref> <output_dir> [<flags>]

표 6.11. migrate 플래그

플래그설명

-o, --output(문자열)

출력 형식: json (기본값) 또는 yaml.

6.2.5. 렌더

제공된 인덱스 이미지, 번들 이미지 및 SQLite 데이터베이스 파일에서 선언적 구성 Blob을 생성합니다.

명령 구문

$ opm render <index_image | bundle_image | sqlite_file> [<flags>]

표 6.12. 렌더링 플래그

플래그설명

-o, --output(문자열)

출력 형식: json (기본값) 또는 yaml.

6.2.6. serve

GRPC 서버를 통해 선언적 구성을 제공합니다.

참고

선언적 구성 디렉터리는 시작 시 serve 명령으로 로드됩니다. 이 명령이 시작된 후 선언적 구성 변경 사항은 제공된 콘텐츠에 반영되지 않습니다.

명령 구문

$ opm serve <source_path> [<flags>]

표 6.13. serve 플래그

플래그설명

--cache-dir (문자열)

이 플래그가 설정되면 서버 캐시 디렉터리를 동기화하고 유지합니다.

--cache-enforce-integrity

캐시가 없거나 유효하지 않은 경우 오류와 함께 종료됩니다. --cache-dir 플래그가 설정되고 --cache-only 플래그가 false 인 경우 기본값은 true 입니다. 그렇지 않으면 기본값은 false 입니다.

--cache-only

서비스 캐시를 동기화하고 서비스하지 않고 종료합니다.

--debug

디버그 로깅을 활성화합니다.

h, --help

서빙에 대한 도움말입니다.

-p,--port (문자열)

서비스의 포트 번호입니다. 기본값은 50051 입니다.

--pprof-addr (문자열)

시작 프로파일링 끝점의 주소입니다. 형식은 Addr:Port 입니다.

-t,--termination-log (문자열)

컨테이너 종료 로그 파일의 경로입니다. 기본값은 /dev/termination-log 입니다.

6.2.7. 검증

지정된 디렉터리에서 선언적 구성 JSON 파일을 검증합니다.

명령 구문

$ opm validate <directory> [<flags>]

7장. Operator SDK

7.1. Operator SDK CLI 설치

Operator SDK는 Operator 개발자가 Operator를 빌드, 테스트, 배포하는 데 사용할 수 있는 CLI(명령줄 인터페이스) 툴을 제공합니다. 워크스테이션에 Operator SDK CLI를 설치하여 자체 Operator를 작성할 준비를 할 수 있습니다.

AWS의 Red Hat OpenShift Service와 같은 Kubernetes 기반 클러스터에 대한 클러스터 관리자 액세스 권한이 있는 Operator 작성자는 Operator SDK CLI를 사용하여 Go, Ansible, Java 또는 Helm을 기반으로 자체 Operator를 개발할 수 있습니다. Kubebuilder는 Go 기반 Operator의 스캐폴드 솔루션으로 Operator SDK에 포함되어 있습니다. 즉 기존 Kubebuilder 프로젝트를 그대로 Operator SDK와 함께 사용할 수 있으며 계속 작업할 수 있습니다.

7.1.1. Linux에 Operator SDK CLI 설치

Linux에 OpenShift SDK CLI 툴을 설치할 수 있습니다.

사전 요구 사항

  • Go v1.19 이상
  • docker v17.03 이상, podman v1.9.3 이상 또는 buildah v1.7 이상

프로세스

  1. OpenShift 미러 사이트로 이동합니다.
  2. 최신 4 디렉토리에서 최신 버전의 Linux용 tarball을 다운로드합니다.
  3. 아카이브의 압축을 풉니다.

    $ tar xvf operator-sdk-v1.31.0-ocp-linux-x86_64.tar.gz
  4. 파일을 실행 가능으로 설정합니다.

    $ chmod +x operator-sdk
  5. 추출된 operator-sdk 바이너리를 PATH에 있는 디렉터리로 이동합니다.

    작은 정보

    PATH를 확인하려면 다음을 실행합니다.

    $ echo $PATH
    $ sudo mv ./operator-sdk /usr/local/bin/operator-sdk

검증

  • Operator SDK CLI를 설치한 후 사용할 수 있는지 확인합니다.

    $ operator-sdk version

    출력 예

    operator-sdk version: "v1.31.0-ocp", ...

7.1.2. macOS에 Operator SDK CLI 설치

macOS에 OpenShift SDK CLI 툴을 설치할 수 있습니다.

사전 요구 사항

  • Go v1.19 이상
  • docker v17.03 이상, podman v1.9.3 이상 또는 buildah v1.7 이상

절차

  1. amd64 아키텍처의 경우 amd64 아키텍처의 OpenShift 미러 사이트로 이동합니다.
  2. 최신 4 디렉토리에서 최신 버전의 macOS용 tarball을 다운로드합니다.
  3. 다음 명령을 실행하여 amd64 아키텍처에 대한 Operator SDK 아카이브의 압축을 풉니다.

    $ tar xvf operator-sdk-v1.31.0-ocp-darwin-x86_64.tar.gz
  4. 다음 명령을 실행하여 파일을 실행 가능하게 만듭니다.

    $ chmod +x operator-sdk
  5. 다음 명령을 실행하여 추출된 operator-sdk 바이너리를 PATH 에 있는 디렉터리로 이동합니다.

    작은 정보

    다음 명령을 실행하여 PATH 를 확인합니다.

    $ echo $PATH
    $ sudo mv ./operator-sdk /usr/local/bin/operator-sdk

검증

  • Operator SDK CLI를 설치한 후 다음 명령을 실행하여 사용할 수 있는지 확인합니다.

    $ operator-sdk version

    출력 예

    operator-sdk version: "v1.31.0-ocp", ...

7.2. Operator SDK CLI 참조

Operator SDK CLI(명령줄 인터페이스)는 Operator를 더 쉽게 작성할 수 있도록 설계된 개발 키트입니다.

Operator SDK CLI 구문

$ operator-sdk <command> [<subcommand>] [<argument>] [<flags>]

7.2.1. 번들

operator-sdk bundle 명령은 Operator 번들 메타데이터를 관리합니다.

7.2.1.1. 검증

bundle validate 하위 명령은 Operator 번들을 검증합니다.

표 7.1. bundle validate 플래그

플래그Description

-h, --help

bundle validate 하위 명령에 대한 도움말 출력입니다.

--index-builder(문자열)

번들 이미지를 가져오고 압축 해제하는 툴입니다. 번들 이미지를 검증할 때만 사용됩니다. 사용 가능한 옵션은 docker(기본값), podman 또는 none입니다.

--list-optional

사용 가능한 선택적 검증기를 모두 나열합니다. 이 플래그를 설정하면 검증기가 실행되지 않습니다.

--select-optional(문자열)

실행할 선택적 검증기를 선택하는 라벨 선택기입니다. --list-optional 플래그를 사용하여 실행하는 경우 사용 가능한 선택적 검증기를 나열합니다.

7.2.2. cleanup

operator-sdk cleanup 명령은 run 명령을 사용하여 배포한 Operator용으로 생성된 리소스를 삭제하고 제거합니다.

표 7.2. cleanup 플래그

플래그Description

-h, --help

run bundle 하위 명령에 대한 도움말 출력입니다.

--kubeconfig(문자열)

CLI 요청에 사용할 kubeconfig 파일 경로입니다.

-n,--namespace (문자열)

이 플래그가 있는 경우 CLI 요청을 실행할 네임스페이스입니다.

--timeout <duration>

실패 전 명령이 완료될 때까지 대기하는 시간입니다. 기본값은 2m0s입니다.

7.2.3. 완료

operator-sdk completion 명령은 CLI 명령을 더 신속하고 쉽게 실행할 수 있도록 쉘 완료를 생성합니다.

표 7.3. completion 하위 명령

하위 명령Description

bash

bash 완료를 생성합니다.

zsh

zsh 완료를 생성합니다.

표 7.4. completion 플래그

플래그Description

-h, --help

사용법 도움말 출력입니다.

예를 들면 다음과 같습니다.

$ operator-sdk completion bash

출력 예

# bash completion for operator-sdk                         -*- shell-script -*-
...
# ex: ts=4 sw=4 et filetype=sh

7.2.4. create

operator-sdk create 명령은 Kubernetes API를 생성하거나 스캐폴드하는 데 사용됩니다.

7.2.4.1. api

create api 하위 명령은 Kubernetes API를 스캐폴드합니다. 하위 명령은 init 명령을 사용하여 초기화한 프로젝트에서 실행해야 합니다.

표 7.5. create api 플래그

플래그Description

-h, --help

run bundle 하위 명령에 대한 도움말 출력입니다.

7.2.5. generate

operator-sdk generate 명령은 특정 생성기를 호출하여 코드 또는 매니페스트를 생성합니다.

7.2.5.1. 번들

generate bundle 하위 명령은 Operator 프로젝트에 대해 일련의 번들 매니페스트, 메타데이터, bundle.Dockerfile 파일을 생성합니다.

참고

일반적으로 generate kustomize manifests 하위 명령을 먼저 실행하여 generate bundle 하위 명령에 사용되는 입력 Kustomize 베이스를 생성합니다. 그러나 초기화된 프로젝트에서 make bundle 명령을 사용하여 이러한 명령을 순서대로 실행하도록 자동화할 수 있습니다.

표 7.6. generate bundle 플래그

플래그Description

--channels(문자열)

번들이 속한 채널의 쉼표로 구분된 목록입니다. 기본값은 alpha입니다.

--crds-dir(문자열)

CustomResoureDefinition 매니페스트의 루트 디렉터리입니다.

--default-channel(문자열)

번들의 기본 채널입니다.

--deploy-dir(문자열)

배포 및 RBAC와 같은 Operator 매니페스트용 루트 디렉터리입니다. 이 디렉터리는 --input-dir 플래그로 전달되는 디렉터리와 다릅니다.

-h, --help

generate bundle에 대한 도움말입니다.

--input-dir(문자열)

기존 번들을 읽을 디렉터리입니다. 이 디렉터리는 번들 manifests 디렉터리의 상위이며 --deploy-dir 디렉터리와 다릅니다.

--kustomize-dir(문자열)

번들 매니페스트용 Kustomize 베이스 및 kustomization.yaml 파일이 포함된 디렉터리입니다. 기본 경로는 config/manifests입니다.

--manifests

번들 매니페스트를 생성합니다.

--metadata

번들 메타데이터 및 Dockerfile을 생성합니다.

--output-dir(문자열)

번들을 작성할 디렉터리입니다.

--overwrite

번들 메타데이터 및 Dockerfile이 있는 경우 덮어씁니다. 기본값은 true입니다.

--package(문자열)

번들의 패키지 이름입니다.

-q, --quiet

자동 모드로 실행됩니다.

--stdout

번들 매니페스트를 표준 출력에 작성합니다.

--version(문자열)

생성된 번들에 있는 Operator의 의미 체계 버전입니다. 새 번들을 생성하거나 Operator를 업그레이드하는 경우에만 설정됩니다.

7.2.5.2. kustomize

generate kustomize 하위 명령에는 Operator에 대한 Kustomize 데이터를 생성하는 하위 명령이 포함되어 있습니다.

7.2.5.2.1. 매니페스트

generate kustomize manifests 하위 명령은 다른 Operator SDK 명령에서 번들 매니페스트를 빌드하는 데 사용하는 Kustomize 베이스 및 kustomization.yaml 파일을 config/manifests 디렉터리에 생성하거나 다시 생성합니다. 베이스가 존재하지 않거나 --interactive=false 플래그를 설정하지 않은 경우 이 명령은 기본적으로 매니페스트 베이스의 중요한 구성 요소인 UI 메타데이터를 대화형으로 요청합니다.

표 7.7. generate kustomize manifests 플래그

플래그Description

--apis-dir(문자열)

API 유형 정의를 위한 루트 디렉터리입니다.

-h, --help

generate kustomize manifests에 대한 도움말입니다.

--input-dir(문자열)

기존 Kustomize 파일이 있는 디렉터리입니다.

--interactive

false로 설정하면 Kustomize 베이스가 없는 경우 사용자 정의 메타데이터를 수락하도록 대화형 명령 프롬프트가 표시됩니다.

--output-dir(문자열)

Kustomize 파일을 작성할 디렉터리입니다.

--package(문자열)

패키지 이름입니다.

-q, --quiet

자동 모드로 실행됩니다.

7.2.6. init

operator-sdk init 명령은 Operator 프로젝트를 초기화하고 지정된 플러그인 의 기본 프로젝트 디렉터리 레이아웃을 생성하거나 스캐폴드 합니다.

이 명령은 다음 파일을 작성합니다.

  • 상용구 라이센스 파일
  • 도메인 및 리포지토리가 있는 PROJECT 파일
  • 프로젝트를 빌드할 Makefile
  • 프로젝트 종속 항목이 있는 go.mod 파일
  • 매니페스트를 사용자 정의하는 kustomization.yaml 파일
  • 관리자 매니페스트용 이미지를 사용자 정의하는 패치 파일
  • Prometheus 지표를 활성화하는 패치 파일
  • 실행할 main.go 파일

표 7.8. init 플래그

플래그Description

--help, -h

init 명령에 대한 도움말 출력입니다.

--plugins(문자열)

프로젝트를 초기화할 플러그인의 이름 및 버전(선택 사항)입니다. 사용 가능한 플러그인은 ansible.sdk.operatorframework.io/v1,go.kubebuilder.io/v2,go.kubebuilder.io/v3, helm.sdk.operatorframework.io/v1 입니다.

--project-version

프로젝트 버전입니다. 사용 가능한 값은 2 및 기본값인 3-alpha 입니다.

7.2.7. run

operator-sdk run 명령은 다양한 환경에서 Operator를 시작할 수 있는 옵션을 제공합니다.

7.2.7.1. 번들

run bundle 하위 명령은 OLM(Operator Lifecycle Manager)을 사용하여 번들 형식으로 Operator를 배포합니다.

표 7.9. run bundle 플래그

플래그Description

--index-image(문자열)

번들을 삽입할 인덱스 이미지입니다. 기본 이미지는 quay.io/operator-framework/upstream-opm-builder:latest입니다.

--install-mode <install_mode_value>

Operator CSV(클러스터 서비스 버전)에서 지원되는 설치 모드(예: AllNamespaces 또는 SingleNamespace)입니다.

--timeout <duration>

설치 제한 시간입니다. 기본값은 2m0s입니다.

--kubeconfig(문자열)

CLI 요청에 사용할 kubeconfig 파일 경로입니다.

-n,--namespace (문자열)

이 플래그가 있는 경우 CLI 요청을 실행할 네임스페이스입니다.

--security-context-config <security_context>

카탈로그 Pod에 사용할 보안 컨텍스트를 지정합니다. 허용되는 값에는 restrictedlegacy 가 포함됩니다. 기본값은 legacy 입니다. [1]

-h, --help

run bundle 하위 명령에 대한 도움말 출력입니다.

  1. restricted 보안 컨텍스트는 기본 네임스페이스와 호환되지 않습니다. 프로덕션 환경에서 Operator의 Pod 보안 승인을 구성하려면 "Pod 보안 승인 관련"을 참조하십시오. Pod 보안 승인에 대한 자세한 내용은 "Pod 보안 승인 이해 및 관리"를 참조하십시오.

7.2.7.2. bundle-upgrade

run bundle-upgrade 하위 명령은 이전에 OLM(Operator Lifecycle Manager)을 사용하여 번들 형식으로 설치한 Operator를 업그레이드합니다.

표 7.10. run bundle-upgrade 플래그

플래그Description

--timeout <duration>

업그레이드 제한 시간입니다. 기본값은 2m0s입니다.

--kubeconfig(문자열)

CLI 요청에 사용할 kubeconfig 파일 경로입니다.

-n,--namespace (문자열)

이 플래그가 있는 경우 CLI 요청을 실행할 네임스페이스입니다.

--security-context-config <security_context>

카탈로그 Pod에 사용할 보안 컨텍스트를 지정합니다. 허용되는 값에는 restrictedlegacy 가 포함됩니다. 기본값은 legacy 입니다. [1]

-h, --help

run bundle 하위 명령에 대한 도움말 출력입니다.

  1. restricted 보안 컨텍스트는 기본 네임스페이스와 호환되지 않습니다. 프로덕션 환경에서 Operator의 Pod 보안 승인을 구성하려면 "Pod 보안 승인 관련"을 참조하십시오. Pod 보안 승인에 대한 자세한 내용은 "Pod 보안 승인 이해 및 관리"를 참조하십시오.

7.2.8. scorecard

operator-sdk scorecard 명령은 스코어 카드 툴을 실행하여 Operator 번들을 검증하고 개선을 위해 제안 사항을 제공합니다. 이 명령은 하나의 인수를 사용하며, 인수는 번들 이미지이거나 매니페스트 및 메타데이터가 포함된 디렉터리입니다. 인수에 이미지 태그가 있으면 이미지가 원격으로 존재해야 합니다.

표 7.11. scorecard 플래그

플래그Description

-c, --config(문자열)

스코어 카드 구성 파일 경로입니다. 기본 경로는 bundle/tests/scorecard/config.yaml입니다.

-h, --help

scorecard 명령에 대한 도움말 출력입니다.

--kubeconfig(문자열)

kubeconfig 파일 경로입니다.

-L, --list

실행할 수 있는 테스트를 나열합니다.

-n, --namespace(문자열)

테스트 이미지를 실행할 네임스페이스입니다.

-o, --output(문자열)

결과 출력 형식입니다. 사용 가능한 값은 text(기본값) 및 json입니다.

--pod-security <security_context>

지정된 보안 컨텍스트를 사용하여 스코어 카드를 실행하는 옵션입니다. 허용되는 값에는 restrictedlegacy 가 포함됩니다. 기본값은 legacy 입니다. [1]

-l, --selector(문자열)

실행할 테스트를 결정하는 라벨 선택기입니다.

-s, --service-account(문자열)

테스트에 사용할 서비스 계정입니다. 기본값은 default입니다.

-x, --skip-cleanup

테스트가 실행된 후 리소스 정리를 비활성화합니다.

-w, --wait-time <duration>

테스트가 완료될 때까지 대기할 시간(초)입니다(예: 35s). 기본값은 30s입니다.

  1. restricted 보안 컨텍스트는 기본 네임스페이스와 호환되지 않습니다. 프로덕션 환경에서 Operator의 Pod 보안 승인을 구성하려면 "Pod 보안 승인 관련"을 참조하십시오. Pod 보안 승인에 대한 자세한 내용은 "Pod 보안 승인 이해 및 관리"를 참조하십시오.

8장. ROSA CLI

8.1. ROSA CLI 시작하기

8.1.1. ROSA CLI 정보

ROSA(Red Hat OpenShift Service on AWS) CLI(명령줄 인터페이스) 명령인 Red Hat OpenShift Service를 사용하여 ROSA 클러스터 및 리소스를 생성, 업데이트, 관리 및 삭제합니다.

8.1.2. ROSA CLI 설정

다음 단계를 사용하여 설치 호스트에 ROSA CLI(rosa)를 설치하고 구성합니다.

절차

  1. 최신 AWS CLI(aws)를 설치하고 구성합니다.

    1. AWS 명령줄 인터페이스 설명서에 따라 운영 체제에 대한 AWS CLI를 설치하고 구성합니다.

      aws_access_key_id,aws_secret_access_keyregion.aws/credentials 파일에 지정합니다. AWS 문서의 AWS 구성 기본 사항을 참조하십시오.

      참고

      필요한 경우 AWS_DEFAULT_REGION 환경 변수를 사용하여 기본 AWS 리전을 설정할 수 있습니다.

    2. AWS API를 쿼리하여 AWS CLI가 올바르게 설치되어 구성되었는지 확인합니다.

      $ aws sts get-caller-identity  --output text

      출력 예

      <aws_account_id>    arn:aws:iam::<aws_account_id>:user/<username>  <aws_user_id>

  2. OpenShift Cluster Manager의 다운로드 페이지에서 운영 체제용 ROSA CLI(rosa) 최신 버전을 다운로드합니다.
  3. 다운로드한 아카이브에서 rosa 바이너리 파일을 추출합니다. 다음 예제에서는 Linux tar 아카이브에서 바이너리를 추출합니다.

    $ tar xvf rosa-linux.tar.gz
  4. 경로에 rosa 를 추가하십시오. 다음 예에서는 /usr/local/bin 디렉터리가 사용자의 경로에 포함됩니다.

    $ sudo mv rosa /usr/local/bin/rosa
  5. rosa 버전을 쿼리하여 ROSA CLI가 올바르게 설치되었는지 확인합니다.

    $ rosa version

    출력 예

    1.2.15
    Your ROSA CLI is up to date.

  6. 선택 사항: ROSA CLI에 대한 탭 완료를 활성화합니다. 탭 완료가 활성화되면 Tab 키를 두 번 눌러 하위 명령을 자동으로 완료하고 명령 제안을 수신할 수 있습니다.

    • Linux 호스트에서 Bash의 영구 탭 완료를 활성화하려면 다음을 수행합니다.

      1. Bash에 대한 rosa 탭 완료 구성 파일을 생성하여 /etc/bash_completion.d/ 디렉터리에 저장합니다.

        # rosa completion bash > /etc/bash_completion.d/rosa
      2. 새 터미널을 열어 구성을 활성화합니다.
    • macOS 호스트에서 Bash에 대한 영구 탭 완료를 활성화하려면 다음을 수행합니다.

      1. Bash에 대한 rosa 탭 완료 구성 파일을 생성하여 /usr/local/etc/bash_completion.d/ 디렉터리에 저장합니다.

        $ rosa completion bash > /usr/local/etc/bash_completion.d/rosa
      2. 새 터미널을 열어 구성을 활성화합니다.
    • Zsh에 대해 영구 탭 완료를 활성화하려면 다음을 수행합니다.

      1. Zsh 환경에 탭 완료가 활성화되지 않은 경우 다음 명령을 실행하여 활성화합니다.

        $ echo "autoload -U compinit; compinit" >> ~/.zshrc
      2. Zsh에 대한 rosa 탭 완료 구성 파일을 생성하여 함수 경로의 첫 번째 디렉터리에 저장합니다.

        $ rosa completion zsh > "${fpath[1]}/_rosa"
      3. 새 터미널을 열어 구성을 활성화합니다.
    • 어류에 대한 지속적인 탭 완료를 활성화하려면 다음을 수행합니다.

      1. 어류에 대한 rosa 탭 완료 구성 파일을 생성하여 ~/.config/fish/completions/ 디렉터리에 저장합니다.

        $ rosa completion fish > ~/.config/fish/completions/rosa.fish
      2. 새 터미널을 열어 구성을 활성화합니다.
    • PowerShell에 대해 영구 탭 완료를 활성화하려면 다음을 수행합니다.

      1. PowerShell에 대한 rosa 탭 완료 구성 파일을 생성하여 rosa.ps1 이라는 파일에 저장합니다.

        PS> rosa completion powershell | Out-String | Invoke-Expression
      2. PowerShell 프로필에서 rosa.ps1 파일을 가져옵니다.
    참고

    rosa 탭 완료 구성에 대한 자세한 내용은 rosa completion --help 명령을 실행하여 도움말 메뉴를 참조하십시오.

8.1.3. ROSA CLI 구성

다음 명령을 사용하여 AWS(ROSA) CLI, rosa 에서 Red Hat OpenShift Service를 구성합니다.

8.1.3.1. login

Red Hat 계정에 로그인하여 자격 증명을 rosa 구성 파일에 저장합니다. 로그인할 때 토큰을 제공해야 합니다. ROSA 토큰 페이지에서 토큰을 복사할 수 있습니다.

ROSA CLI(rosa)는 다음과 같은 우선 순위 순서로 토큰을 찾습니다.

  1. 명령줄 인수
  2. ROSA_TOKEN 환경 변수
  3. rosa 구성 파일
  4. 명령줄 프롬프트에서 대화형으로

구문

$ rosa login [arguments]

표 8.1. 인수

옵션정의

--client-id

OpenID 클라이언트 식별자(문자열)입니다. 기본값: cloud-services

--client-secret

OpenID 클라이언트 시크릿(문자열)입니다.

--insecure

서버와 비보안 통신을 활성화합니다. 이렇게 하면 TLS 인증서 및 호스트 이름 확인이 비활성화됩니다.

--scope

OpenID 범위(문자열)입니다. 이 옵션을 사용하면 기본 범위가 대체됩니다. 이 작업은 여러 번 반복하여 여러 범위를 지정할 수 있습니다. 기본값: openid

--token

토큰(문자열)에 액세스하거나 새로 고칩니다.

--token-url

OpenID 토큰 URL(문자열). Default: https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token

표 8.2. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--profile

인증 정보 파일에서 AWS 프로필(문자열)을 지정합니다.

8.1.3.2. logout

rosa 에서 로그아웃합니다. 로그아웃하면 rosa 구성 파일도 제거됩니다.

구문

$ rosa logout [arguments]

표 8.3. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--profile

인증 정보 파일에서 AWS 프로필(문자열)을 지정합니다.

8.1.3.3. 권한 확인

ROSA 클러스터를 생성하는 데 필요한 AWS 권한이 올바르게 구성되었는지 확인합니다.

구문

$ rosa verify permissions [arguments]

참고

이 명령은 AWS STS(Security Token Service)를 사용하지 않는 클러스터에 대해서만 권한을 확인합니다.

표 8.4. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--region

명령을 실행할 AWS 리전(문자열)입니다. 이 값은 AWS_REGION 환경 변수를 재정의합니다.

--profile

인증 정보 파일에서 AWS 프로필(문자열)을 지정합니다.

AWS 권한이 올바르게 구성되었는지 확인합니다.

$ rosa verify permissions

특정 리전에서 AWS 권한이 올바르게 구성되었는지 확인합니다.

$ rosa verify permissions --region=us-west-2

8.1.3.4. 할당량 확인

기본 리전에 대해 AWS 할당량이 올바르게 구성되었는지 확인합니다.

구문

$ rosa verify quota [arguments]

표 8.5. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--region

명령을 실행할 AWS 리전(문자열)입니다. 이 값은 AWS_REGION 환경 변수를 재정의합니다.

--profile

인증 정보 파일에서 AWS 프로필(문자열)을 지정합니다.

기본 리전에 대해 AWS 할당량이 올바르게 구성되었는지 확인합니다.

$ rosa verify quota

특정 리전에서 AWS 할당량이 올바르게 구성되었는지 확인합니다.

$ rosa verify quota --region=us-west-2

8.1.3.5. rosa 다운로드

rosa CLI의 최신 호환 버전을 다운로드합니다.

rosa 를 다운로드한 후 아카이브 내용을 추출하여 경로에 추가합니다.

구문

$ rosa download rosa [arguments]

표 8.6. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

8.1.3.6. oc 다운로드

OpenShift Container Platform CLI(oc)의 최신 호환 버전을 다운로드합니다.

oc 를 다운로드한 후 아카이브 내용을 추출하여 경로에 추가해야 합니다.

구문

$ rosa download oc [arguments]

표 8.7. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

예제

oc 클라이언트 툴을 다운로드합니다.

$ rosa download oc

8.1.3.7. oc 확인

OpenShift Container Platform CLI(oc)가 올바르게 설치되었는지 확인합니다.

구문

$ rosa verify oc [arguments]

표 8.8. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

예제

oc 클라이언트 툴을 확인합니다.

$ rosa verify oc

8.1.4. ROSA 초기화

TS를 사용하는 경우에만 init 명령을 사용하여 AWS(ROSA)에서 Red Hat OpenShift Service를 초기화합니다.

8.1.4.1. init

일련의 검사를 수행하여 ROSA 클러스터를 배포할 준비가 되었는지 확인합니다.

검사 목록에는 다음이 포함됩니다.

  • 로그인한 것을 확인할 수 있는 검사( 로그인참조)
  • AWS 인증 정보가 유효한지 확인
  • AWS 권한이 유효한지 확인합니다(권한 확인)
  • AWS 할당량 수준이 충분히 높은지 확인합니다( 할당량 확인참조)
  • 클러스터 시뮬레이션을 실행하여 클러스터 생성이 예상대로 수행되도록 합니다.
  • osdCcsAdmin 사용자가 AWS 계정에 생성되었는지 확인합니다.
  • 시스템에서 OpenShift Container Platform 명령줄 툴을 사용할 수 있는지 확인합니다.

구문

$ rosa init [arguments]

표 8.9. 인수

옵션정의

--region

할당량 및 권한을 확인할 AWS 리전(문자열)입니다. 이 값은 init 명령을 실행할 때만 AWS_REGION 환경 변수를 재정의하지만 AWS CLI 구성은 변경되지 않습니다.

--delete

init 명령 중에 AWS 계정에 적용되는 스택 템플릿을 삭제합니다.

--client-id

OpenID 클라이언트 식별자(문자열)입니다. 기본값: cloud-services

--client-secret

OpenID 클라이언트 시크릿(문자열)입니다.

--insecure

서버와 비보안 통신을 활성화합니다. 이렇게 하면 TLS 인증서 및 호스트 이름 확인이 비활성화됩니다.

--scope

OpenID 범위(문자열)입니다. 이 옵션을 사용하면 기본 범위가 완전히 대체됩니다. 이 작업은 여러 번 반복하여 여러 범위를 지정할 수 있습니다. 기본값: openid

--token

토큰(문자열)에 액세스하거나 새로 고칩니다.

--token-url

OpenID 토큰 URL(문자열). Default: https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token

표 8.10. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--profile

인증 정보 파일에서 AWS 프로필(문자열)을 지정합니다.

ROSA 클러스터를 허용하도록 AWS 계정을 구성합니다.

$ rosa init

기존 OpenShift Cluster Manager 인증 정보를 사용하여 새 AWS 계정을 구성합니다.

$ rosa init --token=$OFFLINE_ACCESS_TOKEN

8.1.5. Bash 스크립트 사용

이는 AWS(ROSA) CLI, rosa 에서 Red Hat OpenShift Service를 사용하여 Bash 스크립트를 사용하는 방법에 대한 예제 워크플로입니다.

사전 요구 사항

AWS 인증 정보를 다음 옵션 중 하나로 사용할 수 있는지 확인합니다.

  • AWS 프로필
  • 환경 변수(AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY)

절차

  1. Red Hat 의 Red Hat OpenShift Cluster Manager 오프라인 토큰을 사용하여 Roa 초기화합니다.

    $ rosa init --token=<token>
  2. ROSA 클러스터를 생성합니다.

    $ rosa create cluster --cluster-name=<cluster_name>
  3. IDP(ID 공급자)를 추가합니다.

    $ rosa create idp --cluster=<cluster_name> --type=<identity_provider> [arguments]
  4. dedicated-admin 사용자를 추가합니다.

    $ rosa grant user dedicated-admin --user=<idp_user_name> --cluster=<cluster_name>

8.1.6. ROSA CLI 업데이트

ROSA CLI (rosa)의 최신 호환 버전으로 업데이트합니다.

절차

  1. ROSA CLI(rosa)의 새 버전을 사용할 수 있는지 확인합니다.

    $ rosa version

    출력 예

    1.2.12
    There is a newer release version '1.2.15', please consider updating: https://mirror.openshift.com/pub/openshift-v4/clients/rosa/latest/

  2. ROSA CLI의 최신 호환 버전을 다운로드합니다.

    $ rosa download rosa

    이 명령은 rosa-*.tar.gz 라는 아카이브를 현재 디렉터리로 다운로드합니다. 파일의 정확한 이름은 운영 체제 및 시스템 아키텍처에 따라 다릅니다.

  3. 아카이브 내용을 추출합니다.

    $ tar -xzf rosa-linux.tar.gz
  4. 추출된 파일을 경로로 이동하여 ROSA CLI의 새 버전을 설치합니다. 다음 예에서는 /usr/local/bin 디렉터리가 사용자의 경로에 포함됩니다.

    $ sudo mv rosa /usr/local/bin/rosa

검증

  • 새 버전의 ROSA가 설치되어 있는지 확인합니다.

    $ rosa version

    출력 예

    1.2.15
    Your ROSA CLI is up to date.

8.2. ROSA CLI로 오브젝트 관리

Red Hat OpenShift Service on AWS (ROSA) CLI를 사용하여 오브젝트 관리 (예: dedicated-admin 사용자 추가, 클러스터 관리, 클러스터 업그레이드 예약 등).

8.2.1. 일반적인 명령 및 인수

이러한 일반적인 명령과 인수는 AWS(ROSA) CLI인 rosa 에서 Red Hat OpenShift Service에 사용할 수 있습니다.

8.2.1.1. debug

부모 명령에 대한 디버그 모드를 활성화하여 문제 해결에 도움이 됩니다.

예제

$ rosa create cluster --cluster-name=<cluster_name> --debug

8.2.1.2. 다운로드

지정된 소프트웨어의 최신 호환 버전을 아카이브 파일의 현재 디렉터리에 다운로드합니다. 아카이브 콘텐츠를 추출하고 소프트웨어를 사용할 경로에 콘텐츠를 추가합니다. 최신 ROSA CLI를 다운로드하려면 rosa 를 지정합니다. 최신 OpenShift CLI를 다운로드하려면 oc 를 지정합니다.

예제

$ rosa download <software>

8.2.1.3. help

ROSA CLI(rosa) 및 사용 가능한 명령 목록에 대한 일반 도움말 정보를 표시합니다. 이 옵션을 인수로 사용하여 버전 또는 생성 과 같은 상위 명령에 대한 도움말 정보를 표시할 수도 있습니다.

ROSA CLI에 대한 일반 도움말을 표시합니다.

$ rosa --help

버전에 대한 일반적인 도움말을 표시합니다.

$ rosa version --help

8.2.1.4. 대화형

대화형 모드를 활성화합니다.

예제

$ rosa create cluster --cluster-name=<cluster_name> --interactive

8.2.1.5. profile

인증 정보 파일에서 AWS 프로필을 지정합니다.

예제

$ rosa create cluster --cluster-name=<cluster_name> --profile=myAWSprofile

8.2.1.6. 버전

rosa 버전을 표시하고 최신 버전을 사용할 수 있는지 확인합니다.

예제

$ rosa version [arguments]

출력 예

최신 버전의 ROSA CLI를 사용할 수 있을 때 표시됩니다.

1.2.12
There is a newer release version '1.2.15', please consider updating: https://mirror.openshift.com/pub/openshift-v4/clients/rosa/latest/

8.2.2. 상위 명령

Red Hat OpenShift Service on AWS(ROSA) CLI( rosa )는 상위 명령과 하위 명령을 사용하여 오브젝트를 관리합니다. 상위 명령은 create,edit,delete,list, describe 입니다. 모든 상위 명령을 모든 하위 명령과 함께 사용할 수 있는 것은 아닙니다. 자세한 내용은 하위 명령을 설명하는 특정 참조 항목을 참조하십시오.

8.2.2.1. create

하위 명령과 페어링할 때 오브젝트 또는 리소스를 생성합니다.

예제

$ rosa create cluster --cluster-name=mycluster

8.2.2.2. edit

클러스터 개인 만들기와 같은 오브젝트의 옵션을 편집합니다.

예제

$ rosa edit cluster --cluster=mycluster --private

8.2.2.3. 삭제

하위 명령과 페어링할 때 오브젝트 또는 리소스를 삭제합니다.

예제

$ rosa delete ingress --cluster=mycluster

8.2.2.4. list

특정 클러스터의 클러스터 또는 리소스를 나열합니다.

예제

$ rosa list users --cluster=mycluster

8.2.2.5. describe

클러스터의 세부 정보를 표시합니다.

예제

$ rosa describe cluster --cluster=mycluster

8.2.3. 오브젝트 생성

이 섹션에서는 클러스터 및 리소스의 생성 명령에 대해 설명합니다.

8.2.3.1. account-roles 생성

클러스터에 필요한 계정 전체 역할 및 정책 리소스를 생성합니다.

구문

$ rosa create account-roles [flags]

표 8.11. 플래그

옵션정의

--debug

디버그 모드를 활성화합니다.

-i, --interactive

대화형 모드를 활성화합니다.

-m, --mode 문자열

작업을 수행하는 방법. 유효한 옵션은 다음과 같습니다.

auto
현재 AWS 계정을 사용하여 리소스 변경 사항이 자동으로 적용됩니다.
Manual
AWS 리소스를 수정하는 데 필요한 명령은 수동으로 실행하도록 출력됩니다.

--path string

Operator 정책을 포함하여 계정 전체 역할 및 정책의 ARM(Amazon Resource Name) 경로입니다.

--permissions-boundary 문자열

계정 역할에 대한 권한 경계를 설정하는 데 사용되는 정책의 ARN입니다.

--prefix string

생성된 모든 AWS 리소스의 사용자 정의 접두사입니다. 기본값은 Managed OpenShift 입니다.

--profile string

인증 정보 파일의 특정 AWS 프로필을 사용합니다.

-Y, --yes

작업을 확인하기 위해 yes 에 자동으로 응답합니다.

8.2.3.2. 관리자 생성

클러스터에 로그인할 수 있는 자동으로 생성된 암호를 사용하여 클러스터 관리자를 생성합니다.

구문

$ rosa create admin --cluster=<cluster_name>|<cluster_id>

표 8.12. 인수

옵션정의

--cluster <cluster_name>|<cluster_id>

필수 항목입니다. ID 공급자(IDP)에 추가할 클러스터의 이름 또는 ID(문자열)입니다.

표 8.13. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--interactive

대화형 모드를 활성화합니다.

--profile string

인증 정보 파일에서 AWS 프로필을 지정합니다.

예제

mycluster 라는 클러스터에 로그인할 수 있는 클러스터 관리자를 만듭니다.

$ rosa create admin --cluster=mycluster

8.2.3.3. 끊기 유리 인증 정보 생성

외부 인증이 활성화된 호스트 컨트롤 플레인 클러스터에 대한 중단 자격 증명을 생성합니다.

구문

$ rosa create break-glass-credential --cluster=<cluster_name> [arguments]

표 8.14. 인수

옵션정의

--cluster <cluster_name>|<cluster_id>

필수 항목입니다. 유리 인증 정보가 추가될 클러스터의 이름 또는 ID입니다.

--expiration

선택 사항: 중단 유리 인증 정보를 만료하기 전에 사용할 수 있는 기간입니다. 만료 기간은 최소 10분과 최대 24시간이어야 합니다. 값을 입력하지 않으면 만료 기간은 기본적으로 24시간입니다.

--username

선택 사항: break glass 자격 증명의 사용자 이름입니다. 값을 입력하지 않으면 임의의 사용자 이름이 생성됩니다.

표 8.15. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--interactive

대화형 모드를 활성화합니다.

--profile

인증 정보 파일에서 AWS 프로필(문자열)을 지정합니다.

--region

AWS 리전을 지정하고 AWS_REGION 환경 변수를 덮어씁니다.

--yes

작업을 확인하기 위해 yes 에 자동으로 응답합니다.

mycluster 라는 클러스터에 중단 자격 증명을 추가합니다.

구문

$ rosa create break-glass-credential --cluster=mycluster

대화형 모드를 사용하여 mycluster 라는 클러스터에 break glass 인증 정보를 추가합니다.

구문

$ rosa create break-glass-credential --cluster=mycluster -i

8.2.3.4. 클러스터 생성

새 클러스터를 생성합니다.

구문

$ rosa create cluster --cluster-name=<cluster_name> [arguments]

표 8.16. 인수

옵션정의

--additional-compute-security-group-ids <sec_group_id>

클러스터와 함께 생성된 표준 머신 풀과 함께 사용할 추가 보안 그룹의 식별자입니다. 추가 보안 그룹에 대한 자세한 내용은 추가 리소스 에서 보안 그룹에 대한 요구 사항을 참조하십시오.

--additional-infra-security-group-ids <sec_group_id>

클러스터와 함께 생성된 인프라 노드와 함께 사용할 추가 보안 그룹의 식별자입니다. 추가 보안 그룹에 대한 자세한 내용은 추가 리소스 에서 보안 그룹에 대한 요구 사항을 참조하십시오.

--additional-control-plane-security-group-ids <sec_group_id>

클러스터와 함께 생성된 컨트롤 플레인 노드와 함께 사용할 추가 보안 그룹의 식별자입니다. 추가 보안 그룹에 대한 자세한 내용은 추가 리소스 에서 보안 그룹에 대한 요구 사항을 참조하십시오.

--cluster-name <cluster_name>

필수 항목입니다. 클러스터의 이름입니다. create cluster 명령과 함께 사용하면 이 인수가 클러스터 이름을 설정하는 데 사용되며 최대 54자까지 보유할 수 있습니다. 이 인수의 값은 조직 내에서 고유해야 합니다.

--compute-machine-type <instance_type>

클러스터의 컴퓨팅 노드에 대한 인스턴스 유형입니다. 이렇게 하면 각 컴퓨팅 노드에 할당된 메모리 및 vCPU의 양이 결정됩니다. 유효한 인스턴스 유형에 대한 자세한 내용은 ROSA 서비스 정의AWS 인스턴스 유형을 참조하십시오.

--controlplane-iam-role <arn>

컨트롤 플레인 인스턴스에 연결할 IAM 역할의 ARN입니다.

--disable-scp-checks

클러스터 설치를 시도할 때 클라우드 권한 검사가 비활성화되었는지 여부를 나타냅니다.

--dry-run

클러스터 생성을 시뮬레이션합니다.

--domain-prefix

선택 사항: create cluster 명령과 함께 사용하면 이 인수는 *.openshiftapps.com 에서 클러스터의 하위 도메인을 설정합니다. 이 인수의 값은 조직 내에서 고유해야 하며 15자를 초과할 수 없으며 클러스터 생성 후에는 변경할 수 없습니다. 인수를 지정하지 않으면 클러스터 이름의 길이에 따라 자동 생성된 값이 생성됩니다. 클러스터 이름이 15자 미만이면 도메인 접두사에 해당 이름이 사용됩니다. 클러스터 이름이 15자를 초과하면 도메인 접두사가 15자 문자열로 임의로 생성됩니다.

--ec2-metadata-http-tokens string

EC2 인스턴스에 대해 IMDSv2 사용을 구성합니다. 유효한 값은 선택 사항 (기본값) 또는 필수 값입니다.

--enable-autoscaling

컴퓨팅 노드의 자동 스케일링을 활성화합니다. 기본적으로 자동 스케일링은 2 개의 노드로 설정됩니다. 기본이 아닌 노드 제한을 설정하려면 --min-replicas--max-replicas 인수와 함께 이 인수를 사용합니다.

--host-prefix <subnet>

각 개별 노드에 할당할 서브넷 접두사 길이입니다. 예를 들어 호스트 접두사가 23 으로 설정된 경우 지정된 CIDR에서 /23 서브넷이 각 노드에 할당됩니다.

--machine-cidr <address_block>

클러스터를 설치하는 동안 ROSA에서 사용하는 IP 주소 블록(예: 10.0.0.0/16 )입니다.

중요

ROSA 4.11 이상의 기본 네트워크 공급자인 OVN-Kubernetes는 내부적으로 100.64.0.0/16 IP 주소 범위를 사용합니다. 클러스터에서 OVN-Kubernetes를 사용하는 경우 클러스터의 다른 CIDR 정의에 100.64.0.0/16 IP 주소 범위를 포함하지 마십시오.

--max-replicas <number_of_nodes>

자동 스케일링을 활성화할 때 최대 컴퓨팅 노드 수를 지정합니다. 기본값: 2

--min-replicas <number_of_nodes>

자동 스케일링을 활성화할 때 최소 컴퓨팅 노드 수를 지정합니다. 기본값: 2

--multi-az

여러 데이터 센터에 배포.

--operator-roles-prefix <string>

OpenShift 설치 프로그램에 필요한 Operator가 사용하는 모든 IAM 역할에 사용되는 접두사입니다. 접두사를 지정하지 않으면 자동으로 생성됩니다.

--pod-cidr <address_block>

Pod IP 주소가 할당되는 IP 주소 블록(예: 10.128.0.0/14 )입니다.

중요

ROSA 4.11 이상의 기본 네트워크 공급자인 OVN-Kubernetes는 내부적으로 100.64.0.0/16 IP 주소 범위를 사용합니다. 클러스터에서 OVN-Kubernetes를 사용하는 경우 클러스터의 다른 CIDR 정의에 100.64.0.0/16 IP 주소 범위를 포함하지 마십시오.

--private

기본 API 끝점 및 애플리케이션 경로를 직접 프라이빗 연결로 제한합니다.

--private-link

AWS PrivateLink를 사용하여 VPC와 서비스 간에 개인 연결을 제공하도록 지정합니다. --private-link 를 사용할 때 --subnet-ids 인수가 필요합니다.

--region <region_name>

작업자 풀이 있을 AWS 리전의 이름(예: us-east-1 )입니다. 이 인수는 AWS_REGION 환경 변수를 재정의합니다.

--replicas n

가용성 영역별로 프로비저닝할 작업자 노드 수입니다. 단일 영역 클러스터에는 최소 2개의 노드가 필요합니다. 다중 영역 클러스터에는 최소 3개의 노드가 필요합니다. 기본값: 단일 영역 클러스터의 경우 2 개, 다중 영역 클러스터의 경우 3 입니다.

--role-arn <arn>

OpenShift Cluster Manager가 클러스터를 생성하는 데 사용하는 설치 프로그램 역할의 ARN입니다. 계정 역할이 아직 생성되지 않은 경우 필요합니다.

--service-cidr <address_block>

서비스에 대한 IP 주소 블록(예: 172.30.0.0/16 )

중요

ROSA 4.11 이상의 기본 네트워크 공급자인 OVN-Kubernetes는 내부적으로 100.64.0.0/16 IP 주소 범위를 사용합니다. 클러스터에서 OVN-Kubernetes를 사용하는 경우 클러스터의 다른 CIDR 정의에 100.64.0.0/16 IP 주소 범위를 포함하지 마십시오.

--sts | --non-sts

AWS STS(Security Token Service) 또는 IAM 인증 정보(STS)를 사용하여 클러스터를 배포할지 여부를 지정합니다.

--subnet-ids <aws_subnet_id>

클러스터를 설치할 때 사용되는 AWS 서브넷 ID입니다(예: subnet-01abc234d5678ef9a ). 서브넷 ID는 가용성 영역당 하나의 프라이빗 서브넷 ID와 퍼블릭 서브넷 ID가 있는 쌍으로 있어야 합니다. 서브넷은 쉼표로 구분됩니다(예: --subnet-ids=subnet-1,subnet-2 ). 설치 관리자가 프로비저닝한 서브넷 ID의 값을 비워 둡니다.

--private-link 를 사용하는 경우 --subnet-ids 인수가 필요하며 영역당 하나의 프라이빗 서브넷만 허용됩니다.

--support-role-arn string

Red Hat SRE(Site Reliabilty Engineers)가 지원을 제공하기 위해 클러스터 계정에 액세스할 수 있도록 하는 역할의 ARN입니다.

--tags

AWS에서 Red Hat OpenShift Service on AWS에서 생성한 리소스에 사용되는 태그입니다. 태그는 AWS 내에서 리소스를 관리, 식별, 구성, 검색 및 필터링할 수 있습니다. 태그는 쉼표로 구분됩니다(예: "키 값, foo bar").

중요

AWS의 Red Hat OpenShift Service는 클러스터 생성 중에 Red Hat OpenShift 리소스에 대한 사용자 정의 태그만 지원합니다. 추가되면 태그를 제거하거나 편집할 수 없습니다. Red Hat에서 추가한 태그는 클러스터가 Red Hat 프로덕션 SLA(서비스 수준 계약)를 준수하는 데 필요합니다. 이러한 태그는 제거하지 않아야 합니다.

AWS의 Red Hat OpenShift Service는 ROSA 클러스터 관리 리소스 외부에서 추가 태그를 추가하는 것을 지원하지 않습니다. 이러한 태그는 ROSA 클러스터에서 AWS 리소스를 관리하면 손실될 수 있습니다. 이러한 경우 태그를 조정하고 그대로 유지하기 위해 사용자 정의 솔루션 또는 도구가 필요할 수 있습니다.

--version 문자열

클러스터 또는 클러스터 리소스를 설치하는 데 사용할 ROSA의 버전입니다. 클러스터 의 경우 X.Y.Z 형식을 사용합니다(예: 4.15.0 ). account-roleX.Y 형식을 사용합니다(예: 4.15 ).

--worker-iam-role 문자열

컴퓨팅 인스턴스에 연결할 IAM 역할의 ARN입니다.

표 8.17. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--interactive

대화형 모드를 활성화합니다.

--profile

인증 정보 파일에서 AWS 프로필(문자열)을 지정합니다.

mycluster 라는 클러스터를 생성합니다.

$ rosa create cluster --cluster-name=mycluster

특정 AWS 리전을 사용하여 클러스터를 생성합니다.

$ rosa create cluster --cluster-name=mycluster --region=us-east-2

기본 작업자 머신 풀에서 자동 스케일링이 활성화된 클러스터를 생성합니다.

$ rosa create cluster --cluster-name=mycluster -region=us-east-1 --enable-autoscaling --min-replicas=2 --max-replicas=5

8.2.3.5. external-auth-provider 생성

OpenShift OAuth2 서버 대신 외부 ID 공급자를 추가합니다.

중요

ROSA에서는 HCP 클러스터에서만 외부 인증 공급자를 사용할 수 있습니다.

구문

$ rosa create external-auth-provider --cluster=<cluster_name> | <cluster_id> [arguments]

표 8.18. 인수

옵션정의

--claim-mapping-groups-claim <string>

필수 항목입니다. ID 토큰에서 클러스터 ID로 정보를 변환하는 방법에 대한 규칙을 설명합니다.

--claim-validation-rule <strings>

사용자를 인증하기 위해 토큰 클레임을 확인하는 데 적용되는 규칙입니다. 입력은 < claim>:<required_value> 형식으로 되어 있습니다. 여러 클레임 검증 규칙을 사용하려면 값을 , 로 분리할 수 있습니다. 예를 들면 < claim>:<required_value>,<claim>:<required_value >입니다.

--claim-mapping-username-claim <string>

클러스터 ID의 사용자 이름을 구성하는 데 사용해야 하는 클레임의 이름입니다.

--cluster <cluster_name>|<cluster_id>

필수 항목입니다. IDP가 추가될 클러스터의 이름 또는 ID입니다.

--console-client-id <string>

OpenShift Cluster Manager 웹 콘솔의 OIDC 공급자에서 OIDC 클라이언트의 식별자입니다.

--console-client-secret <string>

콘솔 애플리케이션 등록과 관련된 시크릿입니다.

--issuer-audiences <strings>

들어오는 토큰을 확인하는 대상의 배열입니다. 유효한 토큰에는 대상 클레임에 이러한 값 중 하나 이상이 포함되어야 합니다.

--issuer-ca-file <string>

서버에 요청할 때 사용할 PEM 인코딩 인증서 파일의 경로입니다.

--issuer-url <string>

토큰 발행자의 URL 제공입니다.

--name <string>

외부 인증 공급자를 참조하는 데 사용되는 이름입니다.

표 8.19. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--interactive

대화형 모드를 활성화합니다.

--profile

인증 정보 파일에서 AWS 프로필 문자열을 지정합니다.

Microsoft Entra ID ID 공급자를 mycluster 라는 클러스터에 추가합니다.

$ rosa create external-auth-provider --cluster=mycluster --name <provider_name> --issuer-audiences <audience_id> --issuer-url <issuing id> --claim-mapping-username-claim email --claim-mapping-groups-claim groups

8.2.3.6. idp 생성

ID 공급자(IDP)를 추가하여 사용자가 클러스터에 로그인하는 방법을 정의합니다.

구문

$ rosa create idp --cluster=<cluster_name> | <cluster_id> [arguments]

표 8.20. 인수

옵션정의

--cluster <cluster_name>|<cluster_id>

필수 항목입니다. IDP가 추가될 클러스터의 이름 또는 ID입니다.

--ca <path_to_file>

서버에 요청할 때 사용할 PEM 인코딩 인증서 파일의 경로입니다(예: /usr/share/cert.pem ).

--client-id

등록된 애플리케이션의 클라이언트 ID(문자열)입니다.

--client-secret

등록된 애플리케이션의 클라이언트 시크릿(문자열)입니다.

--mapping-method

새 ID(문자열)가 로그인할 때 사용자에게 매핑되는 방법을 지정합니다. 기본값: claim

--name

ID 공급자의 이름(문자열)입니다.

--type

ID 공급자의 유형(문자열)입니다. 옵션: github,gitlab,Google,ldap,openid

표 8.21. GitHub 인수

옵션정의

--hostname

GitHub Enterprise의 호스팅 인스턴스와 함께 사용되는 선택적 도메인(문자열)입니다.

--organizations

로그인 액세스 조직을 지정합니다. 나열된 조직 중 하나 이상의 멤버인 사용자만 로그인할 수 있습니다.

--teams

로그인 액세스를 위한 팀을 지정합니다. 나열된 팀 중 하나 이상(문자열)의 멤버인 사용자만 로그인할 수 있습니다. 형식은 < org>/<team>입니다.

표 8.22. GitLab 인수

옵션정의

--host-url

GitLab 공급자의 호스트 URL(문자열)입니다. 기본값: https://gitlab.com

표 8.23. Google 인수

옵션정의

--hosted-domain

사용자를 Google 앱 도메인(문자열)으로 제한합니다.

표 8.24. LDAP 인수

옵션정의

--bind-dn

검색 단계에서 바인딩할 도메인 이름(문자열)입니다.

--bind-password

검색 단계에서 바인딩할 암호(문자열)입니다.

--email-attributes

해당 값을 이메일 주소로 사용해야 하는 속성 목록(문자열)입니다.

--id-attributes

사용자 ID로 값을 사용해야 하는 속성의 목록(문자열)입니다. 기본값: dn

--insecure

서버에 TLS 연결을 수행하지 않습니다.

--name-attributes

해당 값을 표시 이름으로 사용해야 하는 속성 목록(문자열)입니다. 기본값: cn

--url

사용되는 LDAP 검색 매개변수를 지정하는 RFC 2255 URL(문자열)입니다.

--username-attributes

기본 사용자 이름으로 값을 사용해야 하는 속성의 목록(문자열). 기본값: uid

표 8.25. OpenID 인수

옵션정의

--email-claims

이메일 주소로 사용되는 클레임 목록(문자열)입니다.

--extra-scopes

권한 부여 토큰 요청 중에 openid 범위 외에 요청할 범위 목록(문자열)입니다.

--issuer-url

OpenID 공급자가 발행자 식별자로 어설션하는 URL(문자열)입니다. URL 쿼리 매개변수 또는 조각이 없는 HTTPS 체계를 사용해야 합니다.

--name-claims

표시 이름으로 사용되는 클레임의 목록(문자열)입니다.

--username-claims

사용자를 프로비저닝할 때 기본 사용자 이름으로 사용되는 클레임의 목록(문자열)입니다.

--groups-claims

그룹 이름으로 사용되는 클레임의 목록(문자열)입니다.

표 8.26. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--interactive

대화형 모드를 활성화합니다.

--profile

인증 정보 파일에서 AWS 프로필(문자열)을 지정합니다.

GitHub ID 공급자를 mycluster 라는 클러스터에 추가합니다.

$ rosa create idp --type=github --cluster=mycluster

대화형 프롬프트에 따라 ID 공급자를 추가합니다.

$ rosa create idp --cluster=mycluster --interactive

8.2.3.7. 수신 생성

클러스터에 대한 API 액세스를 활성화하는 수신 끝점을 추가합니다.

구문

$ rosa create ingress --cluster=<cluster_name> | <cluster_id> [arguments]

표 8.27. 인수

옵션정의

--cluster <cluster_name>|<cluster_id>

필수: 수신을 추가할 클러스터의 이름 또는 ID입니다.

--label-match

Ingress의 레이블과 일치합니다(문자열). 형식은 쉼표로 구분된 키=값 쌍 목록이어야 합니다. 레이블을 지정하지 않으면 두 라우터에 모든 경로가 노출됩니다.

--private

애플리케이션 경로를 직접 프라이빗 연결로 제한합니다.

표 8.28. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--interactive

대화형 모드를 활성화합니다.

--profile

인증 정보 파일에서 AWS 프로필(문자열)을 지정합니다.

mycluster 라는 클러스터에 내부 수신을 추가합니다.

$ rosa create ingress --private --cluster=mycluster

mycluster 라는 클러스터에 공용 수신을 추가합니다.

$ rosa create ingress --cluster=mycluster

경로 선택기 라벨이 일치하는 수신을 추가합니다.

$ rosa create ingress --cluster=mycluster --label-match=foo=bar,bar=baz

8.2.3.8. kubeletconfig 생성

클러스터에 대한 사용자 지정 KubeletConfig 오브젝트를 생성합니다.

구문

$ rosa create kubeletconfig --cluster=<cluster_name|cluster_id> --pod-pids-limit=<number> [flags]

표 8.29. 플래그

옵션정의

--pod-pids-limit <number>

필수 항목입니다. 클러스터의 최대 PID 수입니다.

-c, --cluster <cluster_name>|<cluster_id>

필수 항목입니다. KubeletConfig 오브젝트를 생성할 클러스터의 이름 또는 ID입니다.

-i, --interactive

대화형 모드를 활성화합니다.

-h, --help

이 명령에 대한 도움말을 표시합니다.

클러스터의 PID 제한 설정에 대한 자세한 내용은 PID 제한 구성을 참조하십시오.

8.2.3.9. Machinepool 생성

기존 클러스터에 머신 풀을 추가합니다.

구문

$ rosa create machinepool --cluster=<cluster_name> | <cluster_id> --replicas=<number> --name=<machinepool_name> [arguments]

표 8.30. 인수

옵션정의

--additional-security-group-ids <sec_group_id>

이 머신 풀에 대한 기본 보안 그룹과 함께 사용할 하나 이상의 추가 보안 그룹의 식별자입니다. 추가 보안 그룹에 대한 자세한 내용은 추가 리소스 에서 보안 그룹에 대한 요구 사항을 참조하십시오.

--cluster <cluster_name>|<cluster_id>

필수: 머신 풀을 추가할 클러스터의 이름 또는 ID입니다.

--enable-autoscaling

컴퓨팅 노드의 자동 스케일링을 활성화하거나 비활성화합니다. 자동 스케일링을 활성화하려면 --min-replicas--max-replicas 인수와 함께 이 인수를 사용합니다. 자동 스케일링을 비활성화하려면 --replicas 인수와 함께 --enable-autoscaling=false 를 사용합니다.

--instance-type

사용해야 하는 인스턴스 유형(문자열)입니다. 기본값: m5.xlarge

--labels

머신 풀의 레이블(문자열)입니다. 형식은 쉼표로 구분된 키=값 쌍 목록이어야 합니다. 이 목록은 노드 라벨에 대한 모든 수정 사항을 지속적으로 덮어씁니다.

--max-replicas

자동 스케일링을 활성화할 때 최대 컴퓨팅 노드 수를 지정합니다.

--min-replicas

자동 스케일링을 활성화할 때 최소 컴퓨팅 노드 수를 지정합니다.

--name

필수: 머신 풀의 이름(문자열)입니다.

--replicas

자동 스케일링이 구성되지 않은 경우 필요합니다. 이 머신 풀의 머신 수(정수)입니다.

--taints

머신 풀의 테인트입니다. 이 문자열 값은 key=value:ScheduleType 의 쉼표로 구분된 목록으로 포맷해야 합니다. 이 목록은 노드 테인트에 대한 모든 수정 사항을 지속적으로 덮어씁니다.

표 8.31. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--interactive

대화형 모드를 활성화합니다.

--profile

인증 정보 파일에서 AWS 프로필(문자열)을 지정합니다.

대화형으로 mycluster 라는 클러스터에 머신 풀을 추가합니다.

$ rosa create machinepool --cluster=mycluster --interactive

자동 스케일링이 활성화된 클러스터에 mp-1 이라는 시스템 풀을 추가합니다.

$ rosa create machinepool --cluster=mycluster --enable-autoscaling --min-replicas=2 --max-replicas=5 --name=mp-1

m5.xlarge 복제본이 3개인 mp-1 이라는 시스템 풀을 클러스터에 추가합니다.

$ rosa create machinepool --cluster=mycluster --replicas=3 --instance-type=m5.xlarge --name=mp-1

레이블이 있는 머신 풀을 클러스터에 추가합니다.

$ rosa create machinepool --cluster=mycluster --replicas=2 --instance-type=r5.2xlarge --labels=foo=bar,bar=baz --name=mp-1

8.2.3.10. ocm-role 만들기

클러스터에 필요한 ocm-role 리소스를 생성합니다.

구문

$ rosa create ocm-role [flags]

표 8.32. 플래그

옵션정의

--admin

역할에 대한 관리자 기능을 활성화합니다.

--debug

디버그 모드를 활성화합니다.

-i, --interactive

대화형 모드를 활성화합니다.

-m, --mode 문자열

작업을 수행하는 방법. 유효한 옵션은 다음과 같습니다.

  • 자동: 현재 AWS 계정을 사용하여 리소스 변경 사항이 자동으로 적용됩니다.
  • Manual: AWS 리소스를 수정하는 데 필요한 명령은 수동으로 실행하도록 출력됩니다.

--path string

OCM 역할 및 정책의 ARN 경로입니다.

--permissions-boundary 문자열

OCM 역할의 권한 경계를 설정하는 데 사용되는 정책의 ARN입니다.

--prefix string

생성된 모든 AWS 리소스의 사용자 정의 접두사입니다. 기본값은 Managed OpenShift 입니다.

--profile string

인증 정보 파일의 특정 AWS 프로필을 사용합니다.

-Y, --yes

작업을 확인하기 위해 yes 에 자동으로 응답합니다.

rosa create ocm-role 명령을 사용하여 생성된 OCM 역할에 대한 자세한 내용은 계정 전체 IAM 역할 및 정책 참조를 참조하십시오.

8.2.3.11. user-role 생성

클러스터에 필요한 user-role 리소스를 생성합니다.

구문

$ rosa create user-role [flags]

표 8.33. 플래그

옵션정의

--debug

디버그 모드를 활성화합니다.

-i, --interactive

대화형 모드를 활성화합니다.

-m, --mode 문자열

작업을 수행하는 방법. 유효한 옵션은 다음과 같습니다.

  • 자동: 현재 AWS 계정을 사용하여 리소스 변경 사항이 자동으로 적용됩니다.
  • Manual: AWS 리소스를 수정하는 데 필요한 명령은 수동으로 실행하도록 출력됩니다.

--path string

사용자 역할 및 정책의 ARN 경로입니다.

--permissions-boundary 문자열

사용자 역할의 권한 경계를 설정하는 데 사용되는 정책의 ARN입니다.

--prefix string

생성된 모든 AWS 리소스에 대한 사용자 정의 접두사는 기본값은 ManagedOpenShift 입니다.

--profile string

인증 정보 파일의 특정 AWS 프로필을 사용합니다.

-Y, --yes

작업을 확인하기 위해 yes 에 자동으로 응답합니다.

rosa create user-role 명령을 사용하여 생성된 사용자 역할에 대한 자세한 내용은 AWS 계정 연결 이해 를 참조하십시오.

8.2.4. 추가 리소스

8.2.5. 오브젝트 편집

이 섹션에서는 클러스터 및 리소스의 편집 명령에 대해 설명합니다.

8.2.5.1. 클러스터 편집

기존 클러스터를 편집할 수 있습니다.

구문

$ rosa edit cluster --cluster=<cluster_name> | <cluster_id> [arguments]

표 8.34. 인수

옵션정의

--cluster

필수: 편집할 클러스터의 이름 또는 ID(문자열)입니다.

--private

기본 API 끝점을 직접 프라이빗 연결로 제한합니다.

--enable-delete-protection=true

삭제 보호 기능을 활성화합니다.

--enable-delete-protection=false

삭제 보호 기능을 비활성화합니다.

표 8.35. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--interactive

대화형 모드를 활성화합니다.

--profile

인증 정보 파일에서 AWS 프로필(문자열)을 지정합니다.

mycluster 라는 클러스터를 편집하여 비공개로 설정합니다.

$ rosa edit cluster --cluster=mycluster --private

mycluster 라는 클러스터에서 모든 클러스터 옵션을 대화식으로 편집합니다.

$ rosa edit cluster --cluster=mycluster --interactive

8.2.5.2. 수신 편집

클러스터의 기본이 아닌 추가 애플리케이션 라우터를 편집합니다.

구문

$ rosa edit ingress --cluster=<cluster_name> | <cluster_id> [arguments]

표 8.36. 인수

옵션정의

--cluster

필수: 수신을 추가할 클러스터의 이름 또는 ID(문자열)입니다.

--cluster-routes-hostname

구성 요소는 OAuth, 콘솔 및 다운로드의 호스트 이름을 라우팅합니다.

--cluster-routes-tls-secret-ref

구성 요소는 OAuth, 콘솔 및 다운로드에 대한 TLS 시크릿 참조를 라우팅합니다.

--excluded-namespaces

ingress에 대한 제외된 네임스페이스입니다. 형식은 쉼표로 구분된 목록 값1, value2…​ 입니다. 값을 지정하지 않으면 모든 네임스페이스가 노출됩니다.

--label-match

Ingress의 레이블과 일치합니다(문자열). 형식은 쉼표로 구분된 키=값 쌍 목록이어야 합니다. 레이블을 지정하지 않으면 두 라우터에 모든 경로가 노출됩니다.

--lb-type

로드 밸런서 유형. 옵션은 클래식,nlb 입니다.

--namespace-ownership-policy

수신을 위한 네임스페이스 소유권 정책. 옵션은 StrictInterNamespaceAllowed 입니다. 기본값은 Strict 입니다.

--private

애플리케이션 경로를 직접 프라이빗 연결로 제한합니다.

--route-selector

Ingress의 경로 선택기입니다. 형식은 쉼표로 구분된 key=value 목록입니다. 레이블을 지정하지 않으면 모든 경로가 두 라우터에 노출됩니다. 레거시 수신 지원의 경우 이러한 항목은 포함 레이블이며, 그렇지 않으면 제외 레이블로 처리됩니다.

--wildcard-policy

Ingress에 대한 와일드카드 정책입니다. 옵션은 WildcardsDisallowedWildcardsAllowed 입니다. 기본값은 WildcardsDisallowed 입니다.

표 8.37. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--interactive

대화형 모드를 활성화합니다.

--profile

인증 정보 파일에서 AWS 프로필(문자열)을 지정합니다.

ID a1b2mycluster 라는 클러스터에서 개인 연결인 추가 수신을 만듭니다.

$ rosa edit ingress --private --cluster=mycluster a1b2

mycluster 라는 클러스터에서 ID a1b2 를 사용하여 추가 수신에 대한 라우터 선택기를 업데이트합니다.

$ rosa edit ingress --label-match=foo=bar --cluster=mycluster a1b2

mycluster 라는 클러스터에서 하위 도메인 식별자 앱을 사용하여 기본 수신을 업데이트합니다.

$ rosa edit ingress --private=false --cluster=mycluster apps

apps2 인그레스의 로드 밸런서 유형을 업데이트합니다.

$ rosa edit ingress --lb-type=nlb --cluster=mycluster apps2

8.2.5.3. kubeletconfig 편집

클러스터에서 사용자 지정 KubeletConfig 오브젝트를 편집합니다.

구문

$ rosa edit kubeletconfig --cluster=<cluster_name|cluster_id> --pod-pids-limit=<number> [flags]

표 8.38. 플래그

옵션정의

-c, --cluster <cluster_name>|<cluster_id>

필수 항목입니다. KubeletConfig 오브젝트를 편집할 클러스터의 이름 또는 ID입니다.

-i, --interactive

대화형 모드를 활성화합니다.

--pod-pids-limit <number>

필수 항목입니다. 클러스터의 최대 PID 수입니다.

-h, --help

이 명령에 대한 도움말을 표시합니다.

클러스터의 PID 제한 설정에 대한 자세한 내용은 PID 제한 구성을 참조하십시오.

8.2.5.4. Machinepool 편집

클러스터에서 머신 풀을 편집할 수 있습니다.

구문

$ rosa edit machinepool --cluster=<cluster_name> | <cluster_id> <machinepool_ID> [arguments]

표 8.39. 인수

옵션정의

--cluster

필수: 추가 머신 풀을 편집할 클러스터의 이름 또는 ID(문자열)입니다.

--enable-autoscaling

컴퓨팅 노드의 자동 스케일링을 활성화하거나 비활성화합니다. 자동 스케일링을 활성화하려면 --min-replicas--max-replicas 인수와 함께 이 인수를 사용합니다. 자동 스케일링을 비활성화하려면 --replicas 인수와 함께 --enable-autoscaling=false 를 사용합니다.

--labels

머신 풀의 레이블(문자열)입니다. 형식은 쉼표로 구분된 키=값 쌍 목록이어야 합니다. 이 값을 편집하면 노드 번호를 늘리면 생성되는 머신 풀의 새로 생성된 노드에만 영향을 미치며 기존 노드에는 영향을 미치지 않습니다. 이 목록은 노드 라벨에 대한 모든 수정 사항을 지속적으로 덮어씁니다.

--max-replicas

자동 스케일링을 활성화할 때 최대 컴퓨팅 노드 수를 지정합니다.

--min-replicas

자동 스케일링을 활성화할 때 최소 컴퓨팅 노드 수를 지정합니다.

--node-drain-grace-period

머신 풀을 업그레이드하거나 교체할 때 노드 드레이닝 기간을 지정합니다. (HCP 클러스터를 사용하는 ROSA용입니다.)

--replicas

자동 스케일링이 구성되지 않은 경우 필요합니다. 이 머신 풀의 머신 수(정수)입니다.

--taints

머신 풀의 테인트입니다. 이 문자열 값은 key=value:ScheduleType 의 쉼표로 구분된 목록으로 포맷해야 합니다. 이 값을 편집하면 노드 번호를 늘리면 생성되는 머신 풀의 새로 생성된 노드에만 영향을 미치며 기존 노드에는 영향을 미치지 않습니다. 이 목록은 노드 테인트에 대한 모든 수정 사항을 지속적으로 덮어씁니다.

표 8.40. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--interactive

대화형 모드를 활성화합니다.

--profile

인증 정보 파일에서 AWS 프로필(문자열)을 지정합니다.

mycluster 라는 클러스터에서 mp1 이라는 머신 풀에 복제본 4를 설정합니다.

$ rosa edit machinepool --cluster=mycluster --replicas=4 --name=mp1

mycluster 라는 클러스터에서 mp1 이라는 머신 풀에서 자동 스케일링을 활성화합니다.

$ rosa edit machinepool --cluster=mycluster --enable-autoscaling --min-replicas=3 --max-replicas=5 --name=mp1

mycluster 라는 클러스터에서 mp1 이라는 머신 풀에서 자동 스케일링을 비활성화합니다.

$ rosa edit machinepool --cluster=mycluster  --enable-autoscaling=false --replicas=3 --name=mp1

mycluster 라는 클러스터에서 mp1 이라는 머신 풀에서 자동 스케일링 범위를 수정합니다.

$ rosa edit machinepool --max-replicas=9 --cluster=mycluster --name=mp1

8.2.6. 오브젝트 삭제

이 섹션에서는 클러스터 및 리소스의 삭제 명령에 대해 설명합니다.

8.2.6.1. 관리자 삭제

지정된 클러스터에서 클러스터 관리자를 삭제합니다.

구문

$ rosa delete admin --cluster=<cluster_name> | <cluster_id>

표 8.41. 인수

옵션정의

--cluster

필수: ID 공급자(IDP)에 추가할 클러스터의 이름 또는 ID(문자열)입니다.

표 8.42. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--interactive

대화형 모드를 활성화합니다.

--profile

인증 정보 파일에서 AWS 프로필(문자열)을 지정합니다.

예제

mycluster 라는 클러스터에서 클러스터 관리자를 삭제합니다.

$ rosa delete admin --cluster=mycluster

8.2.6.2. 클러스터 삭제

클러스터를 삭제합니다.

구문

$ rosa delete cluster --cluster=<cluster_name> | <cluster_id> [arguments]

표 8.43. 인수

옵션정의

--cluster

필수: 삭제할 클러스터의 이름 또는 ID(문자열)입니다.

--watch

클러스터 설치 제거 로그를 감시합니다.

--best-effort

클러스터 삭제 프로세스가 실패하는 것으로 알려진 클러스터 삭제 체인의 단계를 건너뜁니다. 이 옵션을 신중하게 사용해야 하며 --best-effort 를 사용한 후 AWS 계정을 수동으로 확인하는 것이 좋습니다.

표 8.44. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--interactive

대화형 모드를 활성화합니다.

--profile

인증 정보 파일에서 AWS 프로필(문자열)을 지정합니다.

--yes

작업을 확인하기 위해 yes 에 자동으로 응답합니다.

mycluster 라는 클러스터를 삭제합니다.

$ rosa delete cluster --cluster=mycluster

8.2.6.3. external-auth-provider 삭제

클러스터에서 외부 인증 공급자를 삭제합니다.

구문

$ rosa delete external-auth-provider <name_of_external_auth_provider> --cluster=<cluster_name> | <cluster_id> [arguments]

표 8.45. 인수

옵션정의

--cluster

필수 항목입니다. 외부 인증 공급자가 삭제됩니다.

표 8.46. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--interactive

대화형 모드를 활성화합니다.

--profile

인증 정보 파일에서 AWS 프로필 문자열을 지정합니다.

--yes

작업을 확인하기 위해 yes 에 자동으로 응답합니다.

예제

mycluster 라는 클러스터에서 exauth-1 이라는 ID 공급자를 삭제합니다.

$ rosa delete external-auth-provider exauth-1 --cluster=mycluster

8.2.6.4. IDp 삭제

클러스터에서 특정 ID 공급자(IDP)를 삭제합니다.

구문

$ rosa delete idp --cluster=<cluster_name> | <cluster_id> [arguments]

표 8.47. 인수

옵션정의

--cluster

필수: IDP가 삭제될 클러스터의 이름 또는 ID(문자열)입니다.

표 8.48. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--interactive

대화형 모드를 활성화합니다.

--profile

인증 정보 파일에서 AWS 프로필(문자열)을 지정합니다.

--yes

작업을 확인하기 위해 yes 에 자동으로 응답합니다.

예제

mycluster 라는 클러스터에서 github 라는 ID 공급자를 삭제합니다.

$ rosa delete idp github --cluster=mycluster

8.2.6.5. 수신 삭제

클러스터에서 기본이 아닌 애플리케이션 라우터(ingress)를 삭제합니다.

구문

$ rosa delete ingress --cluster=<cluster_name> | <cluster_id> [arguments]

표 8.49. 인수

옵션정의

--cluster

필수: 수신을 삭제할 클러스터의 이름 또는 ID(문자열)입니다.

표 8.50. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--interactive

대화형 모드를 활성화합니다.

--profile

인증 정보 파일에서 AWS 프로필(문자열)을 지정합니다.

--yes

작업을 확인하기 위해 yes 에 자동으로 응답합니다.

mycluster 라는 클러스터에서 ID a1b2 가 있는 수신을 삭제합니다.

$ rosa delete ingress --cluster=mycluster a1b2

mycluster 라는 클러스터에서 하위 도메인 이름 apps2 를 사용하여 보조 수신을 삭제합니다.

$ rosa delete ingress --cluster=mycluster apps2

8.2.6.6. kubeletconfig 삭제

클러스터에서 사용자 지정 KubeletConfig 오브젝트를 삭제합니다.

구문

$ rosa delete kubeletconfig --cluster=<cluster_name|cluster_id> [flags]

표 8.51. 플래그

옵션정의

-c, --cluster <cluster_name>|<cluster_id>

필수 항목입니다. KubeletConfig 오브젝트를 삭제할 클러스터의 이름 또는 ID입니다.

-h, --help

이 명령에 대한 도움말을 표시합니다.

-Y, --yes

작업을 확인하기 위해 yes 에 자동으로 응답합니다.

8.2.6.7. 머신 풀 삭제

클러스터에서 머신 풀을 삭제합니다.

구문

$ rosa delete machinepool --cluster=<cluster_name> | <cluster_id> <machine_pool_id>

표 8.52. 인수

옵션정의

--cluster

필수: 머신 풀이 삭제될 클러스터의 이름 또는 ID(문자열)입니다.

표 8.53. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--interactive

대화형 모드를 활성화합니다.

--profile

인증 정보 파일에서 AWS 프로필(문자열)을 지정합니다.

--yes

작업을 확인하기 위해 yes 에 자동으로 응답합니다.

예제

mycluster 라는 클러스터에서 ID mp-1 이 있는 머신 풀을 삭제합니다.

$ rosa delete machinepool --cluster=mycluster mp-1

8.2.7. 애드온 설치 및 제거

이 섹션에서는 클러스터에 Red Hat 관리 서비스 애드온을 설치하고 제거하는 방법을 설명합니다.

8.2.7.1. 애드온 설치

클러스터에 관리 서비스 애드온을 설치합니다.

구문

$ rosa install addon --cluster=<cluster_name> | <cluster_id> [arguments]

표 8.54. 인수

옵션정의

--cluster

필수: 애드온을 설치할 클러스터의 이름 또는 ID(문자열)입니다.

표 8.55. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--profile

인증 정보 파일의 특정 AWS 프로필(문자열)을 사용합니다.

--yes

작업을 확인하기 위해 yes 에 자동으로 응답합니다.

예제

dbaas-operator 애드온 설치를 mycluster 라는 클러스터에 추가합니다.

$ rosa install addon --cluster=mycluster dbaas-operator

8.2.7.2. 애드온 설치 제거

클러스터에서 관리 서비스 애드온을 설치 제거합니다.

구문

$ rosa uninstall addon --cluster=<cluster_name> | <cluster_id> [arguments]

표 8.56. 인수

옵션정의

--cluster

필수: 추가 기능이 제거될 클러스터의 이름 또는 ID(문자열)입니다.

표 8.57. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--profile

인증 정보 파일의 특정 AWS 프로필(문자열)을 사용합니다.

--yes

작업을 확인하기 위해 yes 에 자동으로 응답합니다.

예제

mycluster 라는 클러스터에서 dbaas-operator 애드온 설치를 제거합니다.

$ rosa uninstall addon --cluster=mycluster dbaas-operator

8.2.8. 오브젝트 나열 및 설명

이 섹션에서는 클러스터 및 리소스의 명령 목록 및 설명에 대해 설명합니다.

8.2.8.1. 애드온 목록

관리 서비스 애드온 설치를 나열합니다.

구문

$ rosa list addons --cluster=<cluster_name> | <cluster_id>

표 8.58. 인수

옵션정의

--cluster

필수: 애드온을 나열할 클러스터의 이름 또는 ID(문자열)입니다.

표 8.59. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--profile

인증 정보 파일에서 AWS 프로필(문자열)을 지정합니다.

8.2.8.2. 유리 인증 정보 나열

클러스터의 모든 중단 유리 인증 정보를 나열합니다.

구문

$ rosa list break-glass-credential [arguments]

표 8.60. 인수

옵션정의

--cluster <cluster_name>|<cluster_id>

필수 항목입니다. 끊은 유리 인증 정보가 추가된 클러스터의 이름 또는 ID입니다.

표 8.61. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--profile

인증 정보 파일에서 AWS 프로필(문자열)을 지정합니다.

예제

mycluster 라는 클러스터의 모든 중단 유리 인증 정보를 나열합니다.

$ rosa list break-glass-credential --cluster=mycluster

8.2.8.3. 클러스터 나열

모든 클러스터를 나열합니다.

구문

$ rosa list clusters [arguments]

표 8.62. 인수

옵션정의

--count

표시할 클러스터의 수(정수)입니다. 기본값: 100

표 8.63. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--profile

인증 정보 파일에서 AWS 프로필(문자열)을 지정합니다.

8.2.8.4. external-auth-provider 나열

클러스터의 외부 인증 공급자를 나열합니다.

구문

$ rosa list external-auth-provider --cluster=<cluster_name> | <cluster_id> [arguments]

표 8.64. 인수

옵션정의

--cluster

필수: 외부 인증 공급자가 나열될 클러스터의 이름 또는 ID 문자열입니다.

표 8.65. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--profile

인증 정보 파일에서 AWS 프로필 문자열을 지정합니다.

예제

mycluster 라는 클러스터의 외부 인증 공급자를 나열합니다.

$ rosa list external-auth-provider --cluster=mycluster

8.2.8.5. IDps 목록

클러스터의 모든 ID 공급자(IDP)를 나열합니다.

구문

$ rosa list idps --cluster=<cluster_name> | <cluster_id> [arguments]

표 8.66. 인수

옵션정의

--cluster

필수: IDP가 나열될 클러스터의 이름 또는 ID(문자열)입니다.

표 8.67. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--profile

인증 정보 파일에서 AWS 프로필(문자열)을 지정합니다.

예제

mycluster 라는 클러스터의 모든 ID 공급자(IDP)를 나열합니다.

$ rosa list idps --cluster=mycluster

8.2.8.6. 수신 목록

클러스터의 모든 API 및 수신 끝점을 나열합니다.

구문

$ rosa list ingresses --cluster=<cluster_name> | <cluster_id> [arguments]

표 8.68. 인수

옵션정의

--cluster

필수: IDP가 나열될 클러스터의 이름 또는 ID(문자열)입니다.

표 8.69. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--profile

인증 정보 파일에서 AWS 프로필(문자열)을 지정합니다.

예제

mycluster 라는 클러스터의 모든 API 및 수신 끝점을 나열합니다.

$ rosa list ingresses --cluster=mycluster

8.2.8.7. 인스턴스 유형 나열

ROSA와 함께 사용할 수 있는 모든 인스턴스 유형을 나열합니다. 가용성은 계정의 AWS 할당량을 기반으로 합니다.

구문

$ rosa list instance-types [arguments]

표 8.70. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--output

출력 형식입니다. 허용되는 형식은 json 또는 yaml 입니다.

--profile

인증 정보 파일에서 AWS 프로필(문자열)을 지정합니다.

예제

모든 인스턴스 유형을 나열합니다.

$ rosa list instance-types

8.2.8.8. machinepools 나열

클러스터에 구성된 머신 풀을 나열합니다.

구문

$ rosa list machinepools --cluster=<cluster_name> | <cluster_id> [arguments]

표 8.71. 인수

옵션정의

--cluster

필수: 머신 풀이 나열될 클러스터의 이름 또는 ID(문자열)입니다.

표 8.72. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--profile

인증 정보 파일에서 AWS 프로필(문자열)을 지정합니다.

예제

mycluster 라는 클러스터의 모든 머신 풀을 나열합니다.

$ rosa list machinepools --cluster=mycluster

8.2.8.9. 리전 나열

현재 AWS 계정에 사용 가능한 모든 리전을 나열합니다.

구문

$ rosa list regions [arguments]

표 8.73. 인수

옵션정의

--multi-az

여러 가용성 영역에 대한 지원을 제공하는 리전을 나열합니다.

표 8.74. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--profile

인증 정보 파일에서 AWS 프로필(문자열)을 지정합니다.

예제

사용 가능한 모든 리전을 나열합니다.

$ rosa list regions

8.2.8.10. 업그레이드 나열

사용 가능한 모든 클러스터 버전 및 예약된 클러스터 버전 업그레이드를 나열합니다.

구문

$ rosa list upgrades --cluster=<cluster_name> | <cluster_id> [arguments]

표 8.75. 인수

옵션정의

--cluster

필수: 사용 가능한 업그레이드가 나열될 클러스터의 이름 또는 ID(문자열)입니다.

표 8.76. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--profile

인증 정보 파일에서 AWS 프로필(문자열)을 지정합니다.

예제

mycluster 라는 클러스터에 사용 가능한 모든 업그레이드를 나열합니다.

$ rosa list upgrades --cluster=mycluster

8.2.8.11. 사용자 나열

지정된 클러스터의 클러스터 관리자 및 전용 관리자 사용자를 나열합니다.

구문

$ rosa list users --cluster=<cluster_name> | <cluster_id> [arguments]

표 8.77. 인수

옵션정의

--cluster

필수: 클러스터 관리자가 나열할 클러스터의 이름 또는 ID(문자열)입니다.

표 8.78. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--profile

인증 정보 파일에서 AWS 프로필(문자열)을 지정합니다.

예제

mycluster 라는 클러스터의 모든 클러스터 관리자와 전용 관리자를 나열합니다.

$ rosa list users --cluster=mycluster

8.2.8.12. 버전 목록

클러스터를 만드는 데 사용할 수 있는 모든 OpenShift 버전을 나열합니다.

구문

$ rosa list versions [arguments]

표 8.79. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--profile

인증 정보 파일에서 AWS 프로필(문자열)을 지정합니다.

예제

모든 OpenShift Container Platform 버전을 나열합니다.

$ rosa list versions

8.2.8.13. 관리자 설명

지정된 cluster-admin 사용자의 세부 정보와 클러스터에 로그인하는 명령을 표시합니다.

구문

$ rosa describe admin --cluster=<cluster_name> | <cluster_id> [arguments]

표 8.80. 인수

옵션정의

--cluster

필수: cluster-admin이 속한 클러스터의 이름 또는 ID(문자열)입니다.

표 8.81. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--profile

인증 정보 파일에서 AWS 프로필(문자열)을 지정합니다.

예제

mycluster 라는 클러스터의 cluster-admin 사용자를 설명합니다.

$ rosa describe admin --cluster=mycluster

8.2.8.14. 애드온 설명

관리 서비스 애드온의 세부 정보를 표시합니다.

구문

$ rosa describe addon <addon_id> | <addon_name> [arguments]

표 8.82. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--profile

인증 정보 파일에서 AWS 프로필(문자열)을 지정합니다.

예제

dbaas-operator 라는 애드온을 설명합니다.

$ rosa describe addon dbaas-operator

8.2.8.15. break glass 인증 정보 설명

특정 클러스터의 break glass 인증 정보 세부 정보를 표시합니다.

구문

$ rosa describe break-glass-credential --id=<break_glass_credential_id> --cluster=<cluster_name>| <cluster_id> [arguments]

표 8.83. 인수

옵션정의

--cluster

필수: 클러스터의 이름 또는 ID(문자열)입니다.

--id

필수: 유리 인증 정보의 ID(문자열)입니다.

--kubeconfig

선택 사항: break glass 인증 정보에서 kubeconfig를 검색합니다.

표 8.84. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--profile

인증 정보 파일에서 AWS 프로필(문자열)을 지정합니다.

8.2.8.16. 클러스터 설명

클러스터의 세부 정보를 표시합니다.

구문

$ rosa describe cluster --cluster=<cluster_name> | <cluster_id> [arguments]

표 8.85. 인수

옵션정의

--cluster

필수: 클러스터의 이름 또는 ID(문자열)입니다.

표 8.86. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--profile

인증 정보 파일에서 AWS 프로필(문자열)을 지정합니다.

예제

mycluster 라는 클러스터를 설명합니다.

$ rosa describe cluster --cluster=mycluster

8.2.8.17. kubeletconfig 설명

사용자 정의 KubeletConfig 오브젝트의 세부 정보를 표시합니다.

구문

$ rosa describe kubeletconfig --cluster=<cluster_name|cluster_id> [flags]

표 8.87. 플래그

옵션정의

-c, --cluster <cluster_name>|<cluster_id>

필수 항목입니다. KubeletConfig 오브젝트를 볼 클러스터의 이름 또는 ID입니다.

-h, --help

이 명령에 대한 도움말을 표시합니다.

-o, --output 문자열

출력 형식입니다. json 또는 yaml 중 하나를 지정할 수 있습니다.

8.2.8.18. machinepool 설명

클러스터에 구성된 특정 머신 풀을 설명합니다.

구문

$ rosa describe machinepool --cluster=<cluster_name> --machinepool=<machinepool_name>| <cluster_id> <machinepool_id> [arguments]

표 8.88. 인수

옵션정의

--cluster

필수: 클러스터의 이름 또는 ID(문자열)입니다.

--machinepool

필수: machinepool의 이름 또는 ID(문자열)입니다.

표 8.89. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--profile

인증 정보 파일에서 AWS 프로필(문자열)을 지정합니다.

예제

mycluster 라는 클러스터에서 mymachinepool 이라는 시스템 풀을 설명합니다.

$ rosa describe machinepool --cluster=mycluster --machinepool=mymachinepool

8.2.9. 오브젝트 취소

이 섹션에서는 클러스터 및 리소스의 취소 명령에 대해 설명합니다.

8.2.9.1. revoke-break-glass-credential

외부 인증이 활성화된 지정된 호스팅 컨트롤 플레인 클러스터에서 모든 중단 유리 인증 정보를 취소합니다.

구문

$ rosa revoke break-glass-credential --cluster=<cluster_name> | <cluster_id>

표 8.90. 인수

옵션정의

--cluster

필수: 중단 유리 인증 정보가 삭제될 클러스터의 이름 또는 ID(문자열)입니다.

표 8.91. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--profile

인증 정보 파일에서 AWS 프로필(문자열)을 지정합니다.

--yes

작업을 확인하기 위해 yes 에 자동으로 응답합니다.

예제

mycluster 라는 클러스터에서 중단된 자격 증명을 취소합니다.

$ rosa revoke break-glass-credential --cluster=mycluster

8.2.10. 오브젝트 업그레이드 및 삭제

이 섹션에서는 오브젝트의 업그레이드 명령 사용에 대해 설명합니다.

8.2.10.1. 클러스터 업그레이드

클러스터 업그레이드 예약.

구문

$ rosa upgrade cluster --cluster=<cluster_name> | <cluster_id> [arguments]

표 8.92. 인수

옵션정의

--cluster

필수: 업그레이드를 예약할 클러스터의 이름 또는 ID(문자열)입니다.

--interactive

대화형 모드를 활성화합니다.

--version

클러스터가 업그레이드될 OpenShift Container Platform의 버전(문자열)입니다.

--schedule-date

업그레이드가 지정된 시간에 실행되는 다음 날짜(문자열)입니다. 형식: yyyy-mm-dd

--schedule-time

다음 번에 지정된 날짜에 업그레이드가 실행됩니다. 형식: HH:mm

--node-drain-grace-period [1]

업그레이드 중에 Pod 중단 예산 보호 워크로드를 준수하는 기간에 대한 유예 기간(문자열)을 설정합니다. 이 유예 기간이 지나면 노드에서 성공적으로 드레이닝되지 않은 Pod 중단 예산으로 보호되는 모든 워크로드가 강제로 제거됩니다. 기본값: 1시간

--control-plane [2]

클러스터의 호스팅 컨트롤 플레인을 업그레이드합니다.

  1. 클래식 클러스터만 해당
  2. HCP 클러스터만 있는 ROSA

표 8.93. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

mycluster 라는 클러스터에서 대화식으로 업그레이드를 예약합니다.

$ rosa upgrade cluster --cluster=mycluster --interactive

mycluster 라는 클러스터의 시간 내에 클러스터 업그레이드를 예약합니다.

$ rosa upgrade cluster --cluster=mycluster --version 4.5.20

8.2.10.2. 클러스터 업그레이드 삭제

예약된 클러스터 업그레이드를 취소합니다.

구문

$ rosa delete upgrade --cluster=<cluster_name> | <cluster_id>

표 8.94. 인수

옵션정의

--cluster

필수: 업그레이드가 취소될 클러스터의 이름 또는 ID(문자열)입니다.

표 8.95. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--yes

작업을 확인하기 위해 yes 에 자동으로 응답합니다.

8.2.10.3. 머신 풀 업그레이드

클러스터에 구성된 특정 머신 풀을 업그레이드합니다.

참고

machinepools의 업그레이드 명령은 HCP 클러스터의 ROSA에만 적용됩니다.

구문

$ rosa upgrade machinepool --cluster=<cluster_name> <machinepool_name>

표 8.96. 인수

옵션정의

--cluster

필수: 클러스터의 이름 또는 ID(문자열)입니다.

표 8.97. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--profile

인증 정보 파일에서 AWS 프로필(문자열)을 지정합니다.

예제

mycluster 라는 클러스터에서 머신 풀을 업그레이드합니다.

$ rosa upgrade machinepool --cluster=mycluster

8.2.10.4. Machinepool 업그레이드 삭제

예약된 머신 풀 업그레이드를 취소합니다.

구문

$ rosa delete upgrade --cluster=<cluster_name> <machinepool_name>

표 8.98. 인수

옵션정의

--cluster

필수: 클러스터의 이름 또는 ID(문자열)입니다.

표 8.99. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--profile

인증 정보 파일에서 AWS 프로필(문자열)을 지정합니다.

8.3. ROSA CLI를 사용하여 계정 및 버전 정보 확인

다음 명령을 사용하여 계정 및 버전 정보를 확인합니다.

8.3.1. whoami

다음 명령 구문을 사용하여 AWS 및 Red Hat 계정에 대한 정보를 표시합니다.

구문

$ rosa whoami [arguments]

표 8.100. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--profile

인증 정보 파일에서 AWS 프로필(문자열)을 지정합니다.

예제

$ rosa whoami

8.3.2. 버전

다음 명령 구문을 사용하여 rosa CLI 버전을 표시합니다.

구문

$ rosa version [arguments]

표 8.101. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--profile

인증 정보 파일에서 AWS 프로필(문자열)을 지정합니다.

예제

$ rosa version

8.4. ROSA CLI를 사용하여 로그 확인

다음 명령을 사용하여 설치 및 제거 로그를 확인합니다.

8.4.1. 로그 설치

다음 명령 구문을 사용하여 클러스터 설치 로그를 표시합니다.

구문

$ rosa logs install --cluster=<cluster_name> | <cluster_id> [arguments]

표 8.102. 인수

옵션정의

--cluster

필수: 로그를 가져올 클러스터의 이름 또는 ID(문자열)입니다.

--tail

로그 끝에서 가져올 행의 수(정수)입니다. 기본값: 2000

--watch

로그를 가져온 후 변경 사항을 감시합니다.

표 8.103. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--profile

인증 정보 파일에서 AWS 프로필(문자열)을 지정합니다.

mycluster 라는 클러스터의 마지막 100개의 설치 로그 행을 표시합니다.

$ rosa logs install mycluster --tail=100

mycluster 라는 클러스터의 설치 로그를 표시합니다.

$ rosa logs install --cluster=mycluster

8.4.2. 로그 제거

다음 명령 구문을 사용하여 클러스터 설치 제거 로그를 표시합니다.

구문

$ rosa logs uninstall --cluster=<cluster_name> | <cluster_id> [arguments]

표 8.104. 인수

옵션정의

--cluster

로그를 가져올 클러스터의 이름 또는 ID(문자열)입니다.

--tail

로그 끝에서 가져올 행의 수(정수)입니다. 기본값: 2000

--watch

로그를 가져온 후 변경 사항을 감시합니다.

표 8.105. 상위 명령에서 상속된 선택적 인수

옵션정의

--help

이 명령에 대한 도움말을 표시합니다.

--debug

디버그 모드를 활성화합니다.

--profile

인증 정보 파일에서 AWS 프로필(문자열)을 지정합니다.

예제

mycluster 라는 클러스터의 마지막 100 제거 로그를 표시합니다.

$ rosa logs uninstall --cluster=mycluster --tail=100

8.5. ROSA CLI 명령에 대한 권한 권한 최소

최소 권한 주체를 준수하는 권한을 사용하여 역할을 생성할 수 있으며, 이 경우 역할을 할당한 사용자에게 수행해야 하는 특정 작업 범위 이상으로 다른 권한이 할당되지 않습니다. 이러한 정책에는 ROSA(Red Hat OpenShift Service on AWS) CLI(명령줄 인터페이스)를 사용하여 특정 작업을 수행하는 데 필요한 최소 권한만 포함됩니다.

중요

이 항목에 제공된 정책 및 명령이 서로 함께 작동하지만 AWS 환경 내에 특정 요구 사항에 따라 이러한 명령에 대한 정책이 충분하지 않을 수 있습니다. Red Hat은 다른 AWS Identity and Access Management(IAM) 제한이 없는 경우 기준선으로 이러한 예제를 제공합니다.

참고

나열된 예제에서는 가장 일반적인 ROSA CLI 명령 몇 가지를 다룹니다. ROSA CLI 명령에 대한 자세한 내용은 공통 명령 및 인수를 참조하십시오.

AWS 콘솔에서 권한, 정책 및 역할을 구성하는 방법에 대한 자세한 내용은 AWS 문서의 AWS Identity and Access Management 를 참조하십시오.

8.5.1. 일반적인 ROSA CLI 명령에 대한 권한 권한 최소

나열된 ROSA CLI 명령에 필요한 다음과 같은 최소 권한은 호스팅된 컨트롤 플레인(HCP) 및 클래식 클러스터에 적용할 수 있습니다.

8.5.1.1. 관리형 OpenID Connect(OIDC) 공급자 생성

지정된 권한으로 다음 명령을 실행하여 자동 모드를 사용하여 관리되는 OIDC 공급자를 생성합니다.

입력

$ rosa create oidc-config --mode auto

정책

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "CreateOidcConfig",
            "Effect": "Allow",
            "Action": [
                "iam:TagOpenIDConnectProvider",
                "iam:CreateOpenIDConnectProvider"
            ],
            "Resource": "*"
        }
    ]
}

8.5.1.2. 관리되지 않는 OpenID Connect 공급자 생성

지정된 권한으로 다음 명령을 실행하여 자동 모드를 사용하여 관리되지 않는 OIDC 공급자를 생성합니다.

입력

$ rosa create oidc-config --mode auto --managed=false

정책

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "iam:GetRole",
                "iam:TagOpenIDConnectProvider",
                "iam:ListRoleTags",
                "iam:ListRoles",
                "iam:CreateOpenIDConnectProvider",
                "s3:CreateBucket",
                "s3:PutObject",
                "s3:PutBucketTagging",
                "s3:PutBucketPolicy",
                "s3:PutObjectTagging",
                "s3:PutBucketPublicAccessBlock",
                "secretsmanager:CreateSecret",
                "secretsmanager:TagResource"
            ],
            "Resource": "*"
        }
    ]
}

8.5.1.3. 계정 역할 나열

지정된 권한으로 다음 명령을 실행하여 계정 역할을 나열합니다.

입력

$ rosa list account-roles

정책

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "ListAccountRoles",
            "Effect": "Allow",
            "Action": [
                "iam:ListRoleTags",
                "iam:ListRoles"
            ],
            "Resource": "*"
        }
    ]
}

8.5.1.4. Operator 역할 나열

지정된 권한으로 다음 명령을 실행하여 Operator 역할을 나열합니다.

입력

$ rosa list operator-roles

정책

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "ListOperatorRoles",
            "Effect": "Allow",
            "Action": [
                "iam:ListRoleTags",
                "iam:ListAttachedRolePolicies",
                "iam:ListRoles",
                "iam:ListPolicyTags"
            ],
            "Resource": "*"
        }
    ]
}

8.5.1.5. OIDC 공급자 나열

지정된 권한으로 다음 명령을 실행하여 OIDC 공급자를 나열합니다.

입력

$ rosa list oidc-providers

정책

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "ListOidcProviders",
            "Effect": "Allow",
            "Action": [
                "iam:ListOpenIDConnectProviders",
                "iam:ListOpenIDConnectProviderTags"
            ],
            "Resource": "*"
        }
    ]
}

8.5.1.6. 할당량 확인

지정된 권한으로 다음 명령을 실행하여 할당량을 확인합니다.

입력

$ rosa verify quota

정책

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VerifyQuota",
            "Effect": "Allow",
            "Action": [
                "elasticloadbalancing:DescribeAccountLimits",
                "servicequotas:ListServiceQuotas"
            ],
            "Resource": "*"
        }
    ]
}

8.5.1.7. 관리 OIDC 구성 삭제

지정된 권한으로 다음 명령을 실행하여 자동 모드를 사용하여 관리되는 OIDC 구성을 삭제합니다.

입력

$ rosa delete oidc-config -–mode auto

정책

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "DeleteOidcConfig",
            "Effect": "Allow",
            "Action": [
                "iam:ListOpenIDConnectProviders",
                "iam:DeleteOpenIDConnectProvider"
            ],
            "Resource": "*"
        }
    ]
}

8.5.1.8. 관리되지 않는 OIDC 구성 삭제

지정된 권한으로 다음 명령을 실행하여 자동 모드를 사용하여 관리되지 않는 OIDC 구성을 삭제합니다.

입력

$ rosa delete oidc-config -–mode auto

정책

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "iam:ListOpenIDConnectProviders",
                "iam:DeleteOpenIDConnectProvider",
                "secretsmanager:DeleteSecret",
                "s3:ListBucket",
                "s3:DeleteObject",
                "s3:DeleteBucket"
            ],
            "Resource": "*"
        }
    ]
}

8.5.2. HCP CLI 명령을 사용하여 일반적인 ROSA에 대한 권한 권한 최소

다음 예제에서는 호스팅된 컨트롤 플레인(HCP) 클러스터를 사용하여 ROSA를 빌드할 때 가장 일반적인 ROSA CLI 명령에 필요한 최소 권한 권한을 보여줍니다.

8.5.2.1. 클러스터 생성

지정된 권한으로 다음 명령을 실행하여 HCP 클러스터로 ROSA를 생성합니다.

입력

$ rosa create cluster --hosted-cp

정책

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "CreateCluster",
            "Effect": "Allow",
            "Action": [
                "iam:GetRole",
                "iam:ListRoleTags",
                "iam:ListAttachedRolePolicies",
                "iam:ListRoles",
                "ec2:DescribeSubnets",
                "ec2:DescribeRouteTables",
                "ec2:DescribeAvailabilityZones"
            ],
            "Resource": "*"
        }
    ]
}

8.5.2.2. 계정 역할 및 Operator 역할 생성

지정된 권한으로 다음 명령을 실행하여 자동 모드를 사용하여 계정 및 Operator 역할을 생성합니다.

입력

$ rosa create account-roles --mode auto --hosted-cp

정책

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "CreateAccountRoles",
            "Effect": "Allow",
            "Action": [
                "iam:GetRole",
                "iam:UpdateAssumeRolePolicy",
                "iam:ListRoleTags",
                "iam:GetPolicy",
                "iam:TagRole",
                "iam:ListRoles",
                "iam:CreateRole",
                "iam:AttachRolePolicy",
                "iam:ListPolicyTags"
            ],
            "Resource": "*"
        }
    ]
}

8.5.2.3. 계정 역할 삭제

지정된 권한으로 다음 명령을 실행하여 자동 모드에서 계정 역할을 삭제합니다.

입력

$ rosa delete account-roles -–mode auto

정책

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "DeleteAccountRoles",
            "Effect": "Allow",
            "Action": [
                "iam:GetRole",
                "iam:ListInstanceProfilesForRole",
                "iam:DetachRolePolicy",
                "iam:ListAttachedRolePolicies",
                "iam:ListRoles",
                "iam:DeleteRole",
                "iam:ListRolePolicies"
            ],
            "Resource": "*"
        }
    ]
}

8.5.2.4. Operator 역할 삭제

지정된 권한으로 다음 명령을 실행하여 자동 모드에서 Operator 역할을 삭제합니다.

입력

$ rosa delete operator-roles -–mode auto

정책

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "DeleteOperatorRoles",
            "Effect": "Allow",
            "Action": [
                "iam:GetRole",
                "iam:DetachRolePolicy",
                "iam:ListAttachedRolePolicies",
                "iam:ListRoles",
                "iam:DeleteRole"
            ],
            "Resource": "*"
        }
    ]
}

8.5.3. 일반적인 ROSA Classic CLI 명령에 대한 권한 권한 최소

다음 예제에서는 ROSA Classic 클러스터를 빌드할 때 가장 일반적인 ROSA CLI 명령에 필요한 최소한의 권한 권한을 보여줍니다.

8.5.3.1. 클러스터 생성

지정된 권한으로 다음 명령을 실행하여 권한 권한이 가장 적은 ROSA Classic 클러스터를 생성합니다.

입력

$ rosa create cluster

정책

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "CreateCluster",
            "Effect": "Allow",
            "Action": [
                "iam:GetRole",
                "iam:ListRoleTags",
                "iam:ListRoles"
            ],
            "Resource": "*"
        }
    ]
}

8.5.3.2. 계정 역할 및 Operator 역할 생성

지정된 권한으로 다음 명령을 실행하여 'auto' 모드에서 계정 및 Operator 역할을 생성합니다.

입력

$ rosa create account-roles --mode auto --classic

정책

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "CreateAccountOperatorRoles",
            "Effect": "Allow",
            "Action": [
                "iam:GetRole",
                "iam:UpdateAssumeRolePolicy",
                "iam:ListRoleTags",
                "iam:GetPolicy",
                "iam:TagRole",
                "iam:ListRoles",
                "iam:CreateRole",
                "iam:AttachRolePolicy",
                "iam:TagPolicy",
                "iam:CreatePolicy",
                "iam:ListPolicyTags"
            ],
            "Resource": "*"
        }
    ]
}

8.5.3.3. 계정 역할 삭제

지정된 권한으로 다음 명령을 실행하여 자동 모드에서 계정 역할을 삭제합니다.

입력

$ rosa delete account-roles -–mode auto

정책

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "iam:GetRole",
                "iam:ListInstanceProfilesForRole",
                "iam:DetachRolePolicy",
                "iam:ListAttachedRolePolicies",
                "iam:ListRoles",
                "iam:DeleteRole",
                "iam:ListRolePolicies",
                "iam:GetPolicy",
                "iam:ListPolicyVersions",
                "iam:DeletePolicy"
            ],
            "Resource": "*"
        }
    ]
}

8.5.3.4. Operator 역할 삭제

지정된 권한으로 다음 명령을 실행하여 자동 모드에서 Operator 역할을 삭제합니다.

입력

$ rosa delete operator-roles -–mode auto

정책

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "iam:GetRole",
                "iam:ListInstanceProfilesForRole",
                "iam:DetachRolePolicy",
                "iam:ListAttachedRolePolicies",
                "iam:ListRoles",
                "iam:DeleteRole",
                "iam:ListRolePolicies",
                "iam:GetPolicy",
                "iam:ListPolicyVersions",
                "iam:DeletePolicy"
            ],
            "Resource": "*"
        }
    ]
}

8.5.4. 필요한 권한이 없는 ROSA CLI 명령

다음 ROSA CLI 명령을 실행하려면 권한 또는 정책이 필요하지 않습니다. 대신 액세스 키와 구성된 시크릿 키 또는 연결된 역할이 필요합니다.

표 8.106. 명령

명령입력

클러스터 나열

$ Rosa list 클러스터

버전 목록

$ Rosa 목록 버전

클러스터 설명

$ Rosa describe cluster -c <cluster name>

관리자 생성

$ Rosa create admin -c <cluster name>

사용자 나열

$ Rosa list users -c <cluster-name>

업그레이드 나열

$ Rosa 목록 업그레이드

OIDC 구성 나열

$ Rosa list oidc-config

ID 공급자 나열

$ Rosa list idps -c <cluster-name>

수신 목록

$ Rosa list ingresses -c <cluster-name>

8.5.5. 추가 리소스

법적 공지

Copyright © 2024 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.