Cloud Computing & MSA

[GCP] Cloud Scheduler를 이용한 Cloud SQL stop/start 및 GKE node 스케일링(scaling)

혀뇽뇽이·2025년 2월 4일·조회 1,373

Cloud SQL

  • Cloud SQL Admin API 활성화 필요 
  • Stop
    • Scheduler의 job 생성 시, URL/Header/Body 설정 필요
    •  
    • Configure the execution 탭에서 설정

    • Target type = HTTP

      URL = https://sqladmin.googleapis.com/sql/v1beta4/projects/{프로젝트ID}/instances/{SQL인스턴스ID}

      HTTP metohd = PATCH

      HTTP headers

       Name = Content-Type
       Value = application/json; charset=utf-8

      Body = 

      {
        "settings": {
          "activationPolicy": "NEVER"
        }
      }
       

      Auth header = Add OAuth token

    • Service Account = Compute Engine default service account (또는 Cloud SQL 을 stop/start 할 수 있는 Service Account)
  •  
    •  
    • Start는 Stop과 동일하며 , Body 만 다음과 같이 입력
      {
        "settings": {
          "activationPolicy": "ALWAYS"
        }
      }

GKE

  • Node 숫자 줄이기/늘리기
    • Scheduler의 job 생성 시, URL/Header/Body 설정 필요
    •  

댓글 0

로그인 후 댓글을 남길 수 있습니다.

아직 댓글이 없습니다.