Posts

Showing posts with the label gcp

Google Cloud Platform Practice Series

Image
Introduction Google Cloud Platform (GCP) is a suite of cloud computing services provided by Google. It allows you to build, deploy, and scale applications, websites, and services on the same infrastructure that Google uses internally for its end-user products like Google Search, Gmail, and YouTube. Key Features of GCP Compute Services: Includes virtual machines (VMs) with Google Compute Engine, serverless computing with Google Cloud Functions, and container orchestration with Google Kubernetes Engine (GKE). Storage and Databases: Offers various storage options like Google Cloud Storage for object storage, Google Cloud SQL for managed relational databases, and Google Bigtable for NoSQL databases. Networking: Provides a global network infrastructure with services like Virtual Private Cloud (VPC), Cloud Load Balancing, and Cloud CDN for content delivery. Big Data and Machine Learning: Includes tools like BigQuery for data warehousing, Dataflow for stream and batch data processing, and AI

Kubernetes Practice Series

Image
Introduction Kubernetes (often abbreviated as K8s ) is an open-source system designed to automate the deployment, scaling, and management of containerized applications. This page serves as a collection of articles related to Kubernetes (K8s) , including theoretical concepts and practical guides on using Kubernetes to set up essential tools for the software development process. I will continue to update this series with new articles as ideas come to mind, to ensure the series becomes more comprehensive. The articles are arranged in increasing order of difficulty to make it easier for you to follow. If you have time, it's recommended that you start from the beginning of the series to acquire the necessary knowledge and information that will prepare you for the subsequent articles. Key Topics Covered in This Series Basic Knowledge : Fundamental concepts, common commands, etc. Resources : Pod, Deployment, Service, StatefulSet, Ingress, etc. Pod Autoscaler : Horizontal vs. Vertical sc

SSH to Google Compute Engine

Image
Introduction I previously wrote a guide on creating a Virtual Machine (VM) instance on Google Cloud and accessing it via gcloud . However, if your Google Cloud account lacks permission to manage VM instances, or if you want to create a VM instance that allows SSH for easy sharing with other users and compatibility with various SSH tools, follow the steps below. Configure SSH access for VM instance Firstly, you need to create a compute instance as follows: gcloud compute instances create {instance name} \ --zone={zone} \ --machine-type= { machine type} # ex: gcloud compute instances create instance-1 \ --zone=asia-southeast1-a \ --machine-type=e2-micro Next, SSH into this VM to perform the necessary configurations. Typically, a Google VM instance will have a Distributor ID of Debian . Use the following command to check this before proceeding with the next steps. lsb_release -a Next, set the password for the root account as follows: sudo passwd Next, use t

Helm for beginer - Deploy nginx to Google Kubernetes Engine

Image
Introduction Helm is a package manager for Kubernetes , which simplifies the process of deploying and managing applications on Kubernetes clusters. Helm uses a packaging format called charts , which are collections of files that describe a related set of Kubernetes resources. Key Components of Helm Charts : Helm packages are called charts. A chart is a collection of files that describe a related set of Kubernetes resources. A single chart might be used to deploy something simple, like a memcached pod, or something complex, like a full web app stack with HTTP servers , databases, caches, and so on. Values : Charts can be customized with values, which are configuration settings that specify how the chart should be installed on the cluster. These values can be set in a ` values.yaml ` file or passed on the command line. Releases : When you install a chart, a new release is created. This means that one chart can be installed multiple times into the same cluster, and each can be indep

Github CI/CD with Google Cloud Build

Image
Introduction Continuous Integration (CI) : This is the process of building, testing, and performing necessary actions to ensure code quality before it gets merged into the main branch for deployment. Continuous Delivery (CD) : This usually happens after CI and includes steps to deploy the source code to various environments like staging and production . This guide will show you how to set up CI/CD on Github using Google Cloud Build . While Github provides shared runners, if you or your organization have many jobs that need executing during development, setting up your own runner is a better choice. Before proceeding, you should understand some basics about Google Cloud Run to build and deploy Docker images. You can refer to this article for more details: Build Docker image for NodeJS Typescript Server . Setting Up GitHub CI/CD First, create a Github repository. You can choose either a public or private repository. You can use a NodeJS TypeScript application, following my guide o

Using Google Cloud Run to Deploy Docker Image

Image
Introduction Google Cloud Run (GCR) makes deploying a Docker image as easy as running it locally. GCR also includes customizable configuration options for managing services, simplifying the deployment process significantly. Build Docker Image The key step in deploying with a Docker image is successfully building that image. In this guide, we’ll use a NodeJS server Docker image created in this article . Follow the steps to build your Docker image (or use an existing one), and push it to Google Artifact Registry before proceeding. Deploy Docker Image To deploy a Docker image using Google Cloud Run , simply use the following command: gcloud run deploy express-ts --image {docker image} --port {port container} --region {region id} --max-instances {number of instance} --allow-unauthenticated --image : is the link to the Docker image on Google Artifact Registry or Docker Hub --port : is the container port you are exposing --max-instances : is the number of instances

Deploy React Application to Google Kubernetes Engine

Image
Introduction In this article, I will guide you through deploying a React Application to Google Kubernetes Engine (GKE) . Previously, I wrote an article about deploying a NodeJS Application to GKE , which you can refer to for some basic information before continuing. Steps to Follow The process is quite similar to deploying a NodeJS Application and includes the following steps: Create a React Application Build a Docker image Push the Docker image Deploy the Docker image to GKE You will notice that when working with Kubernetes , the main difference is in the step where you build the Docker image . Depending on the application you need to deploy, there are different ways to build the Docker image . However, the common point is that once you build the Docker image , you have completed almost half of the process. This is because the subsequent steps involving Kubernetes are entirely the same. Detailed Process 1. Create a React Application In this step, you can either use an existing R

Deploy NodeJS Typescript to Google App Engine

Image
Introduction In this guide, I will walk you through deploying a NodeJS Typescript application to Google App Engine (GAE) . GAE offers a straightforward and quick deployment process for various programming languages. If you're developing your NodeJS app using JavaScript , deploying it is pretty straightforward. However, if you're using Typescript , there's an extra step you'll need to take, which I'll explain here. Prerequisites Before we proceed, ensure you have the following: A Google Cloud account with Google App Engine enabled. The gcloud CLI installed. Creating a NodeJS Typescript Project First, create a file named ` src/main.ts ` with the following content: import express from 'express' const app = express () const port = 8080 app . get ( '/' , ( req , res ) => { res . send ( 'This is NodeJS Typescript Application! Current time is ' + Date . now ()) }) app . listen ( port , () => { console . log ( `Server is runn

Kubernetes Pod Cheatsheet

Image
Introduction This article is here to guide you on using Pod  in Kubernetes . I'll give you some concepts and commands that Kubernetes often uses to handle Pod . Pod Introduction A Pod is the smallest deployable unit in Kubernetes . Here are some key points about Pods: Multiple Containers : A Pod can contain more than one container, and there's no limit to how many containers you can run inside a Pod. These containers are relatively tightly coupled and share resources such as disk. Shared Resources : All the containers inside a Pod are connected via localhost and share the same memory space. They also share storage (volumes), IP address, and configuration information. Unique IP Address : Each Pod gets a unique IP address. Ephemeral Nature : Pods are ephemeral in nature; they can be created, deleted, and updated. Prerequisites Before we begin, make sure you have the following: For Kubernetes systems, you can use minikube or have permissions to provision resources on cloud pro