Tag: Google Cloud Platform
-
GCP: Pushing Codebase from IntelliJ IDEA to VM Instance
OBJECTIVE To push codebase from IntelliJ IDEA (or any JetBrains products) on a local machine to a VM instance in Google Cloud Platform. To run the codebase remotely. WHY DO THIS You want to leverage all the power of a modern IDE on your 4K screen. You do not want to use remote desktop tools… Read More…
-
GCP + Container Registry: Pushing/Pulling Images
PROBLEM You want to push a new image to Google Container Registry (GCR) or pull an existing image from GCR. SOLUTION Pushing a New Image to GCR Prepare your Dockerfile. Create an image and tag it with a path pointing to GCR within a project. There are several variations of GCR’s hostname (ex: gcr.io, us.gcr.io,… Read More…
-
GCP Logging Agent: Converting Unstructured to Structured Logging
BACKGROUND The GCP logging agent uses modified fluentd, which allows us to do either unstructured logging or structured logging. The structured logging relies on JSON payload while the unstructured logging can be any texts. The advantage of structured logging is we can leverage log features in GCP Log Viewer. UNSTRUCTURED LOGGING Installing the unstructured logging… Read More…
-
GCP Stackdriver Agent: “write_gcm: can not take infinite value” Error
PROBLEM When running the stackdriver-agent (v6.x), the log file contains the following errors:- SOLUTION By default, the swap metric is enabled. To verify, go to /etc/stackdriver/collectd.conf and locate the following configuration:- This error occurs because the VM instance does not have swap memory, hence this metric plugin tries to divide by 0. To verify the… Read More…
-
GCP: Deleting Project with Lien… Quickly
PROBLEM The whole idea of placing a lien on a project is to prevent accidental deletion. But, sometimes it’s a little pain in the ass to attempt a project deletion in GCP Console only to find out a lien was set, especially during the development phase. Then, we grumpily open up Cloud Shell and run… Read More…
-
Terraform: Skipping Buggy Provider Version
PROBLEM Given the following required_providers block… … it will allow the following Google provider version: >= 3.8, < 4.0. As of today (May 10), the latest Google provider is 3.20.0. A quick terraform init confirms that. However, sometimes, there’s a need to skip a buggy version. For example, 3.20.0 breaks google_compute_firewall. SOLUTION To achieve that,… Read More…