Google Cloud
Introduction
gcloud command line tool
https://cloud.google.com/sdk/downloads
https://cloud.google.com/sdk/gcloud/reference/
Kubernetes Engine
https://cloud.google.com/kubernetes-engine/docs/https://kubernetes.io/docs/reference/kubectl/cheatsheet/#kubectl-context-and-configuration https://cloud.google.com/kubernetes-engine/docs/tutorials/installing-istio
k8s login GCP preprod
gcloud container clusters get-credentials prod --zone europe-west1-b --project project-name
https://kubernetes.io/docs/reference/kubectl/cheatsheet/
https://eu.udacity.com/course/scalable-microservices-with-kubernetes–ud615
Big Table
cbt command line tool
Storage
https://console.cloud.google.com/storage/browser/
https://cloud.google.com/storage/
Load Balancing
"By default, to distribute traffic to instances, the Session Affinity is set to NONE. Google Cloud Load Balancing picks an instance based on a hash of the source IP and port, destination IP and port, and protocol. This means that incoming TCP connections are spread across instances and each new connection may go to a different instance. All packets for a connection are directed to the same instance until the connection is closed. Established connections are not taken into account when balancing.
Regardless of the session affinity setting, all packets for a connection are directed to the chosen instance until the connection is closed and have no impact on load balancing decisions for new incoming connections. This can result in imbalance between backends if long-lived TCP connections are in use.
You can choose a different Session Affinity setting if you need multiple connections from a client to go to the same instance. See sessionAffinity in the Target Pools documentation for more information." "In any of these proxy model, any traffic bound for the Service's IP:Port is proxied to an appropriate backend without the clients knowing anything about Kubernetes or Services or Pods. Client-IP based session affinity can be selected by setting service.spec.sessionAffinity to "ClientIP" (the default is "None"), and you can set the max session sticky time by setting the field service.spec.sessionAffinityConfig.clientIP.timeoutSeconds if you have already set service.spec.sessionAffinity to "ClientIP" (the default is "10800")."
Preemptible VM Instances
https://cloud.google.com/compute/docs/instances/preemptible
Deployment Manager
Deployment Manager is an infrastructure deployment service that automates the creation and management of Google Cloud Platform resources for you.
Write flexible template and configuration files and use them to create deployments that have a variety of Cloud Platform services, such as Google Cloud Storage, Google Compute Engine, and Google Cloud SQL, configured to work together.
Preview Configuration https://cloud.google.com/deployment-manager/docs/configuration/preview-configuration-file (project with activated billing is needed)
gcloud command line reference tool https://cloud.google.com/sdk/gcloud/reference/deployment-manager/
GCP API roles https://cloud.google.com/iam/docs/understanding-roles
Sample permissions for BigTable https://cloud.google.com/bigtable/docs/access-control
Alternative to deployment-manager is https://www.terraform.io/docs/providers/google/index.html
custom role
service account
add roles to service accounts
Makefile deployment
Problems encountered
Created a role bigtable.some_name , few weeks later that bigtable prefix became reserved name
Created service accouunt manually, later created account and assigned role using deployment manager. Older role was also assigned and was acting like the old one. Unassigned and assigned correct role and started working.
Was hard to find correct api resource for IAM. Cloud Resource Manager was the answer.
Terraform
Roles, IAM, ServiceAccounts, BigTable done with Terraform
Last updated