https://github.com/rjkroege/gocloud
Some simple tools for using GCP
https://github.com/rjkroege/gocloud
Last synced: 8 months ago
JSON representation
Some simple tools for using GCP
- Host: GitHub
- URL: https://github.com/rjkroege/gocloud
- Owner: rjkroege
- License: other
- Created: 2020-12-13T11:23:22.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-04-21T13:58:23.000Z (over 1 year ago)
- Last Synced: 2025-02-27T09:09:37.892Z (8 months ago)
- Language: Go
- Size: 284 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
Some tools to help use Google Cloud compute nodes.
* Run `sessionender` as part of launching a new node that you intend to use interactively.
It shuts the node down when the login tty has been idle for more than a configurable
value (default is 15 minutes) to save money.
* `makecloudconfig` assembles a single cloudconfig file for a GCP COS node out of a list
of services. This makes it easy to pack a number of Docker containers into a single node.
Presumably I could have used Kubernetes or `docker compose` or something similar to do
this but this was easy, predictable and cheap.
* `gocloud` tool to launch a GCP node without using `gcloud`. Smaller and faster than
using `gcloud` but does so much less. How to use:
* make a configuration file in [TOML: Tom's Obvious Minimal Language](https://toml.io/en/) toml format
```toml
defaultzone = "us-east1-b"
projectid = "liquiorg"
[instance.smallnodisk]
hardware = "e2-small"
family = "cos-cloud"
userdatafile = "path to your couldconfig file name"
githost = "Git repository to checkout for system setup"
postsshconfig = "Script to run on node bringup"
```
* Make one:
```shell
gocloud make smallnodisk myinstance
```
* I have some related tooling to provision the node. A bare node needs
a useful `cloudconfig` file, a configured service account, etc.
* I use the [mkconfig](https://github.com/rjkroege/mkconfig) tool to setup a node from
within the cloudconfig file.
* On MacOS, `gocloud` wants to read selected configuration that it will push to the GCP
metadata service from the MacOS KeyChain. The `gocloud show-meta` subcommand
will show if this is configured correctly.