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-8Body =
{
Auth header = Add OAuth token
"settings": {
"activationPolicy": "NEVER"
}
}
-
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 설정 필요
-
Configure the execution 탭에서 설정
-
-
Target type = HTTP
URL = https://container.googleapis.com/v1/projects/{프로젝트ID}/locations/{Region또는Zone}/clusters/{클러스터이름}/nodePools/{노드풀이름}:setSize
→ Zonal Cluster는 Zone을, Regional Cluster는 Region을 입력해야함.
→ Zone을 입력하면 해당 Zone에 대해서만 node 숫자를 변경하며, Region을 입력하면 Zone당 node 숫자로 변경하게 되므로 주의가 필요함.HTTP metohd = POST
HTTP headers
Name = Content-Type
Value = application/jsonBody =
{
Auth header = Add OAuth tokenService Account = Compute Engine default service account (또는 GKE 조정 할 수 있는 Service Account)
"nodeCount": 0 → Zone 별 Node 숫자. 원하는 숫자 입력
}
-
- 참고자료: https://nangman14.tistory.com/82#%2B)%20Schedule%20based%20Scaling%C2%A0-1