Alexander “surma” Surma
voxelbrain, GDG Berlin Golang
2013-07-01
Google has commited to unify their cloud products under the Google Cloud Platform brand.
| GCP Name | AWS equivalent |
|---|---|
| Google App Engine | Elastic Beanstalk |
| Google Compute Engine | EC2 |
| Cloud Storage | S3 |
| BigQuery | DynamoDB |
| Cloud SQL | RDS |
Comparison is hard, especially for the high-profile types. Specs don’t
match up exactly and Amazon have their own CPU metric (ECU: EC2 Compute Unit).
Bottom line: Prices are the same
| EC2 | GCE | |
|---|---|---|
| Europe West | ✔ | ✔ |
| US West/Central (2x) | ✔ | ✔ |
| US East | ✔ | ✘ |
| Asia Pacific (3x) | ✔ | ✘ |
| South America | ✔ | ✘ |
Powerful and simple mechanism to inject data (credentials, configuration, ressources etc.) into the machine’s userland.
TOKEN=$(curl http://metadata/computeMetadata/v1beta1/project/attributes/dnsimpleToken)
ID=$(curl http://metadata/computeMetadata/v1beta1/instance/attributes/dnsimpleEntryId)
IP=$(curl http://metadata/.../instance/network-interfaces/0/access-configs/0/external-ip)
curl \
-H 'X-DNSimple-Domain-Token: '$TOKEN \
-X PUT \
-d '{
"record": {"name": "workstation", "content": "'$IP'"}
}' \
https://dnsimple.com/domains/haxigon.com/records/$ID
Example usage: sshKeys is automatically injected into authorized_keys
Service accounts are bogus users which have completed the OAuth flow and have been given the permissions of your choice.
curl http://metadata/computeMetadata/v1beta1/instance/service-accounts/default/token
{
"access_token": "ya29.AHES6ZQYuCmaO_zInBy8xQgYpx-MVFbToxUy1_lmY5cfmg",
"expires_in": 3599,
"token_type": "Bearer"
}
curl \
-H 'Authorization: Bearer ya29.AHES6ZQYuCmaO_zInBy8xQgYpx-MVFbToxUy1_lmY5cfmg' \
https://www.googleapis.com/compute/v1beta15/projects/surma-workstation/zones/europe-west1-a/instances
{
"id": "projects/surma-workstation/zones/europe-west1-a/instances",
"items": [
{
"status": "RUNNING",
"name": "workstation",
"id": "2674708656722824331",
"creationTimestamp": "2013-05-30T02:47:11.861-07:00",
...
Currently, there’s no Ubuntu. There used to be, but the images are shown as deleted. There’s Debian 6, Debian 7 and CentOS.
A reboot is reboot. A shutdown is a “Now go hang in VM limbo”. There are no powered-off instances, you have to destroy them (using the API) to stop billing.
On every reboot the SSH Host key is regenerated giving you:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@I patched my image.
There doesn't seem to be a way to give other users administrative access to a machine or project.
There's no off-the-shelf load-balancing.
Yet! The session at Google I/O shows a loadbalancing feature which is supposed to be shipped within a few months.
gcutilQuestions?
emailasu@voxelbrain.com
g++AlexanderSurma
twittersurmair
githubsurma