App Lifecycle Manager로 MySQL 인스턴스 배포

App Lifecycle Manager를 사용하여 Cloud SQL 인스턴스를 배포하는 방법을 알아봅니다.

시작하기 전에

  1. 로그인하여 Google 계정을 사용하세요.

    아직 계정이 없으면 새 계정을 등록하세요.

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

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  3. Verify that billing is enabled for your Google Cloud project.

  4. Enable the App Lifecycle Manager, Artifact Registry, Infrastructure Manager, Developer Connect, Cloud Build, and Cloud Storage APIs.

    Roles required to enable APIs

    To enable APIs, you need the Service Usage Admin IAM role (roles/serviceusage.serviceUsageAdmin), which contains the serviceusage.services.enable permission. Learn how to grant roles.

    Enable the APIs

  5. Create a service account:

    1. Ensure that you have the Create Service Accounts IAM role (roles/iam.serviceAccountCreator) and the Project IAM Admin role (roles/resourcemanager.projectIamAdmin). Learn how to grant roles.
    2. In the Google Cloud console, go to the Create service account page.

      Go to Create service account
    3. Select your project.
    4. In the Service account name field, enter a name. The Google Cloud console fills in the Service account ID field based on this name.

      In the Service account description field, enter a description. For example, Service account for quickstart.

    5. Click Create and continue.
    6. Grant the Project > Owner role to the service account.

      To grant the role, find the Select a role list, then select Project > Owner.

    7. Click Continue.
    8. Click Done to finish creating the service account.

  6. Google Cloud CLI를 설치합니다.

  7. 외부 ID 공급업체(IdP)를 사용하는 경우 먼저 제휴 ID로 gcloud CLI에 로그인해야 합니다.

  8. gcloud CLI를 초기화하려면, 다음 명령어를 실행합니다.

    gcloud init
  9. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  10. Verify that billing is enabled for your Google Cloud project.

  11. Enable the App Lifecycle Manager, Artifact Registry, Infrastructure Manager, Developer Connect, Cloud Build, and Cloud Storage APIs.

    Roles required to enable APIs

    To enable APIs, you need the Service Usage Admin IAM role (roles/serviceusage.serviceUsageAdmin), which contains the serviceusage.services.enable permission. Learn how to grant roles.

    Enable the APIs

  12. Create a service account:

    1. Ensure that you have the Create Service Accounts IAM role (roles/iam.serviceAccountCreator) and the Project IAM Admin role (roles/resourcemanager.projectIamAdmin). Learn how to grant roles.
    2. In the Google Cloud console, go to the Create service account page.

      Go to Create service account
    3. Select your project.
    4. In the Service account name field, enter a name. The Google Cloud console fills in the Service account ID field based on this name.

      In the Service account description field, enter a description. For example, Service account for quickstart.

    5. Click Create and continue.
    6. Grant the Project > Owner role to the service account.

      To grant the role, find the Select a role list, then select Project > Owner.

    7. Click Continue.
    8. Click Done to finish creating the service account.

  13. Google Cloud CLI를 설치합니다.

  14. 외부 ID 공급업체(IdP)를 사용하는 경우 먼저 제휴 ID로 gcloud CLI에 로그인해야 합니다.

  15. gcloud CLI를 초기화하려면, 다음 명령어를 실행합니다.

    gcloud init
  16. App Lifecycle Manager 서비스 계정에 필요한 권한을 부여합니다.
    1. App Lifecycle Manager > 개요 시작하기 로 이동합니다.

      App Lifecycle Manager 시작하기로 이동

    2. App Lifecycle Manager 계정에 필요한 권한이 부여되지 않았습니다 라는 메시지가 포함된 배너에서 권한 부여 를 클릭합니다.

복합 템플릿을 사용하여 Cloud SQL 제품 모델링

이 섹션에서는 App Lifecycle Manager를 사용하여 App Design Center를 사용하는 Cloud SQL 인스턴스로 구성된 복합 템플릿(sql-quickstart-template)을 모델링합니다.

  1. 콘솔에서 App Lifecycle Manager > SaaS 제품으로 이동합니다. Google Cloud

    SaaS 제품으로 이동

  2. 만들기 를 클릭합니다.

  3. SaaS 제품의 이름 필드에 my-sql-quickstart-saas-offering을 입력합니다.

  4. 리전 드롭다운에서 리전을 선택합니다.

    • us-central1
    • us-east1
    • us-east5

    확인 을 클릭합니다.

  5. 만들기 를 클릭합니다. my-sql-quickstart-saas-offering을 만드는 데 몇 분 정도 걸릴 수 있습니다.

    SaaS 제품 세부정보 페이지가 열립니다.

  6. SaaS 제품 세부정보 페이지에서 새 템플릿 만들기 를 클릭합니다.

  7. 새 복합 템플릿 만들기 페이지에서 다음을 수행합니다.

    1. 템플릿 ID 상자에 sql-quickstart-template을 입력합니다.
    2. 템플릿 만들기 를 클릭합니다. App Lifecycle Manager에서 복합 템플릿을 만드는 데 몇 분 정도 걸립니다.

      App Lifecycle Manager에서 템플릿을 만들면 SaaS 제품 세부정보 페이지의 연결된 애플리케이션 템플릿 섹션에 세부정보가 표시됩니다.

  8. 연결된 애플리케이션 템플릿 섹션에서 템플릿 관리 > 캔버스에서 구성 으로 이동합니다.

    콘솔 창에서 App Design Center가 열립니다. Google Cloud

  9. 구성요소 영역에서 Cloud SQL (My SQL) 템플릿을 찾아 클릭합니다.

    캔버스에 Cloud SQL (My SQL) 구성요소가 추가됩니다.

  10. 계속 > App Lifecycle Manager로 규모에 맞게 배포 를 클릭합니다.

    콘솔 창에서 App Lifecycle Manager가 열립니다. Google Cloud

  11. 연결된 애플리케이션 템플릿 섹션에서 템플릿 버전 업데이트 를 클릭합니다.

  12. 템플릿 버전 업데이트 페이지의 버전 드롭다운에서 r-2를 선택합니다.

  13. 업데이트 를 클릭합니다. 연결된 애플리케이션 템플릿 섹션에 애플리케이션 템플릿 가져오는 중 이 표시됩니다.

    App Lifecycle Manager에서 템플릿 버전을 가져오는 데 몇 분 정도 걸릴 수 있습니다. 버전 가져오기가 완료되면 단위 종류 탭에 단위 종류 목록이 채워집니다.

App Lifecycle Manager를 사용하여 Cloud SQL 인스턴스 프로비저닝

이 섹션에서는 us-central1 리전에 Cloud SQL 인스턴스가 있는 단위 (my-sql-quickstart-unit)를 만들고 프로비저닝합니다.

  1. my-sql-quickstart-saas-offeringSaaS 제품 세부정보 페이지에서 프로비저닝 을 클릭합니다.

    프로비저닝 페이지가 열립니다.

  2. 프로비저닝 페이지의 리전 드롭다운에서 us-central1을 선택합니다.

    추가 를 클릭하여 SaaS 제품에 단위를 추가합니다.

  3. 프로비저닝할 단위 추가 패널에서 다음을 수행합니다.

    1. 단위 이름 상자에 my-sql-quickstart-unit-1을 입력합니다.
    2. 단위 종류 드롭다운에서 sql-quickstart-template 단위 종류를 선택합니다.
    3. 출시 버전 드롭다운에서 (r-3)을 선택합니다.
    4. 서비스 계정 드롭다운에서 시작하기 전에 섹션에서 만든 서비스 계정을 선택합니다.
  4. 테넌트 프로젝트 변수 추가 를 클릭합니다.

    1. 리소스 프로비저닝을 위한 프로젝트를 선택합니다.
  5. 프로비저닝할 단위 추가 패널의 기타 입력 변수 섹션에서 다음을 수행합니다.

    1. sql-my-sql-1_database_version 드롭다운을 클릭합니다.

      • 변수 값 상자에 MY_SQL_8_0을 입력합니다.

      완료 를 클릭합니다.

    2. sql-my-sql-1_name 드롭다운을 클릭합니다.

      • 변수 값 상자에 my-sql-db-1을 입력합니다.

      완료 를 클릭합니다.

    3. sql-my-sql-1_project_id 드롭다운을 클릭합니다.

      • 변수 값 상자에 프로젝트 ID를 입력합니다.

      완료 를 클릭합니다.

    4. sql-my-sql-1_region 드롭다운을 클릭합니다.

      • 변수 값 상자에 us-central1을 입력합니다.

      완료 를 클릭합니다.

    추가 를 클릭합니다. 프로비저닝할 단위 표에 my-sql-quickstart-unit-1이 표시됩니다.

  6. 프로비저닝 을 클릭하여 SaaS 제품에서 라이브 Cloud SQL 인스턴스를 만드는 my-sql-quickstart-unit-1을 프로비저닝합니다.

    App Lifecycle Manager에서 my-sql-quickstart-unit-1을 프로비저닝하는 데 몇 분 정도 걸릴 수 있습니다.

배포된 Cloud SQL 인스턴스 보기

이제 App Lifecycle Manager를 사용하여 Cloud SQL 인스턴스를 배포했습니다.

이 빠른 시작에서 배포한 Cloud SQL 인스턴스를 보려면 다음 안내를 따르세요.

  1. 콘솔에서 App Lifecycle Manager > 단위 > 단위 세부정보 페이지로 이동합니다. Google Cloud

    단위로 이동

  2. 단위 이름(my-sql-quickstart-unit-1)을 클릭합니다.

  3. 단위 세부정보 페이지에서 다음을 확인합니다.

    1. 상태 가 다음과 같습니다.

      • Cloud SQL 인스턴스가 프로비저닝된 경우 준비
      • 작업이 아직 진행 중인 경우 프로비저닝 중

정리

이 페이지에서 사용한 리소스 비용이 Google Cloud 계정에 청구되지 않도록 하려면 다음 단계를 수행합니다.

프로젝트 삭제

새 Google Cloud 프로젝트에 Cloud SQL 인스턴스를 배포했고 프로젝트가 더 이상 필요 없으면 다음 단계에 따라 이를 삭제합니다.

  1. 콘솔에서 리소스 관리 페이지로 이동합니다. Google Cloud

    리소스 관리로 이동

  2. 프로젝트 목록에서 삭제할 프로젝트를 선택하고 삭제를 클릭합니다.
  3. 프롬프트에서 프로젝트 ID를 입력한 후 종료 를 클릭합니다.

다음 단계