{"id":21349024,"url":"https://github.com/x00real/pause-gcp","last_synced_at":"2025-07-12T18:32:19.913Z","repository":{"id":166711095,"uuid":"642224415","full_name":"vietanhduong/pause-gcp","owner":"vietanhduong","description":"Pause GCP resources to save your cost","archived":false,"fork":false,"pushed_at":"2023-06-14T03:18:08.000Z","size":174,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-06-21T14:06:46.841Z","etag":null,"topics":["gcp","gke","save-cost","sql","vm"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vietanhduong.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-18T05:08:11.000Z","updated_at":"2024-01-11T04:44:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"667626dc-99c1-49a6-962f-95fdb1e58fcd","html_url":"https://github.com/vietanhduong/pause-gcp","commit_stats":null,"previous_names":["vietanhduong/pause-gke-cluster","vietanhduong/pause-gcp"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vietanhduong%2Fpause-gcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vietanhduong%2Fpause-gcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vietanhduong%2Fpause-gcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vietanhduong%2Fpause-gcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vietanhduong","download_url":"https://codeload.github.com/vietanhduong/pause-gcp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225834503,"owners_count":17531468,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gcp","gke","save-cost","sql","vm"],"created_at":"2024-11-22T02:41:11.413Z","updated_at":"2025-07-12T18:32:14.610Z","avatar_url":"https://github.com/vietanhduong.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pause GCP\n\nA tool support you pause/unpause your GCP resources which save your cost. This tool is designed for running on CI.\n\nCurrently, we support `gke`, `vm` and `cloud sql` resources.\n\n**Note:** from `v0.2.0`, we deprecated `gcloud` CLI. You don't need to pre-install it to run `pause-gcp`.\n\n\n## Usage\n\n### Pause a GKE cluster\n```console\n$ pause-gcp gke pause --help\n\nPause a GKE cluster.\nThis command require '--location' and '--project' flags.\n\nUsage:\n  pause-gcp gke pause [CLUSTER_NAME] [flags]\n\nExamples:\n# write output from stdout\n$ pause-gcp gke pause dev-cluster -l asia-southeast1 -p develop-project \u003e output_state.json\n\n# write output to gcs bucket\n$ pause-gcp gke pause dev-cluster -l asia-southeast -p develop-project --output-dir=gs://bucket-name/gke-states\n\n# write output to a directory, pause-gcp will try to create the output dir if it not exists\n$ pause-gcp gke pause dev-cluster -p project --output-dir=output_states\n\n# pause cluster with some except pools\n$ pause-gcp gke pause dev-cluster -p project --except-pools=critical-pool\n\n\nFlags:\n      --except-pools strings                                      except node pools\n  -h, --help                                                      help for pause\n  -l, --location string                                           the cluster location (default \"asia-southeast1\")\n      --output-dir gke_\u003cproject\u003e_\u003clocation\u003e_\u003ccluster_name\u003e.json   the output directory to write the cluster state. If no path is specified, this will skip the write-to-file process. The output state file has named by format gke_\u003cproject\u003e_\u003clocation\u003e_\u003ccluster_name\u003e.json\n  -p, --project string                                            the project where contain the cluster\n```\n\nThis command will print the previous state of the input cluster after it is paused. This state is used to recover the cluster in the unpause command.\n\nIf the `--output-dir` is a GCS bucket (start with `gs://`), this tool will push the state file to the destination directly.\n\n### Unpause a GKE cluster\n\n```console\n$ pause-gcp gke unpause --help\n\nUnpause a GKE cluster.\nThis command requires a GKE state file which is created when you pause the cluster.\n\nUsage:\n  pause-gcp gke unpause [STATE_FILE] [flags]\n\nExamples:\n\n# STATE_FILE from local\n$ pause-gcp gke unpause ./gke-states/gke_develop_asia-southeast1_dev-cluster.state.json\n\n# STATE_FILE from a gcs bucket\n$ pause-gcp gke unpause gs://bucket/path/json_file.json --rm\n\n\nFlags:\n  -h, --help   help for unpause\n      --rm     Remove the cluster state after complete\n```\nThe input file must be the previos state of a cluster. The input file can be a GCS url (with `gs://` prefix).\n\n### Refresh a GKE cluster\n\n```console\n$ pause-gcp gke refresh --help\n\nRefresh a GKE cluster.\nRefresh all worker nodes in all node pools of the input cluster. This command just works with node pool has type is spot or preemptible.\n\nUsage:\n  pause-gcp gke refresh [CLUSTER_NAME] [flags]\n\nFlags:\n  -h, --help              help for refresh\n  -l, --location string   the cluster location (default \"asia-southeast1\")\n  -p, --project string    the project where contain the cluster\n      --recreate          keep the instance (node) name or delete and create with new name otherwise\n```\n\nThis command will refresh all node pools has type as `spot` or `preemptible`. This action will prevent GCP revokes your worker nodes during working hours.\n\n## FAQ\n\n### Why do I need this tool?\nThis will save your money.\n\n### Can I use `gcloud` CLI instead?\nYes, you can. If you only need to turn off a VM or a cloud SQL instance,\nyou can use cloud CLI instead of this tool. But if you need to turn off a `GKE` cluster, I recommend you use `pause-gcp` because turning off a cluster is more complicated than a VM and cloud SQL.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fx00real%2Fpause-gcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fx00real%2Fpause-gcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fx00real%2Fpause-gcp/lists"}