빠른 시작: Cloud Run에 샘플 작업자 풀 배포

이 페이지에서는 샘플 작업자 풀 컨테이너를 배포하는 방법을 보여줍니다. 배포 후 작업자 풀에서 지속적으로 로그 메시지를 작성합니다.

시작하기 전에

  1. Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  3. Make sure that billing is enabled for your Google Cloud project.

  4. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  5. Make sure that billing is enabled for your Google Cloud project.

  6. Cloud Run Admin API를 사용 설정합니다.
    Cloud Run Admin API 사용 설정
  7. gcloud CLI를 설치하고 초기화합니다.
  8. 구성요소를 업데이트합니다.
    gcloud components update

작업자 풀 배포

샘플 작업자 풀 컨테이너를 배포하려면 다음 단계를 따르세요.

  1. In the Google Cloud console, activate Cloud Shell.

    Activate Cloud Shell

    At the bottom of the Google Cloud console, a Cloud Shell session starts and displays a command-line prompt. Cloud Shell is a shell environment with the Google Cloud CLI already installed and with values already set for your current project. It can take a few seconds for the session to initialize.

  2. 다음 명령어를 실행합니다.

    gcloud beta run worker-pools deploy example-worker-pool
      --image us-docker.pkg.dev/cloudrun/container/worker-pool:latest
      --region europe-west1
    작업자 풀에 원하는 이름이나 리전을 사용할 수 있습니다. 이 빠른 시작에서는 이름 example-worker-pool 및 리전 europe-west1을 사용한다고 가정합니다.

  3. 배포가 성공적으로 완료되면 Cloud Run에 다음과 유사한 메시지가 표시됩니다.

    Worker pool [my-example-worker-pool] revision [my-example-worker-pool-REVISION] has been deployed

  4. 작업자 풀에서 작성한 로그를 확인합니다.

    1. Google Cloud 콘솔에서 Cloud Run 페이지로 이동합니다.

      Cloud Run으로 이동

    2. 작업자 풀을 클릭합니다.

    3. 작업자 풀 목록에서 작업자 풀을 클릭합니다.

    4. 로그 탭을 클릭하여 이 작업자 풀의 모든 버전에 대한 컨테이너 로그를 가져옵니다. 작업자 풀에서 Cloud Run Worker Pool instance is running! 로그 메시지를 계속 작성합니다.

삭제

샘플 작업자 풀은 지속적으로 로그를 작성합니다. 따라서 중지하려면 작업자 풀을 삭제해야 합니다.

작업자 풀을 삭제하려면 다음 명령어를 사용하세요.

gcloud beta run worker-pools delete my-example-workerpool 
--region europe-west1

배포할 때 다른 이름을 사용한 경우 my-example-workerpool을 작업자 풀의 이름으로 바꾸고, 배포할 때 다른 리전을 사용한 경우 europe-west1을 해당하는 리전으로 바꿉니다.

다음 단계

작업자 풀에 대한 자세한 내용은 다음을 참조하세요.