Posts

Showing posts with the label docker

Redis Fundamentals

Image
Introduction Redis is the world's fastest in-memory database. It offers cloud and on-premises solutions for caching, vector search, and NoSQL databases. In-memory is a concept related to how data is stored and accessed in a computer. When we talk about in-memory, we refer to storing data directly in the computer's RAM (Random Access Memory) rather than on a hard drive. Here are some key points about in-memory storage: Storing data in RAM :   When data is stored in-memory , it is kept in the computer's RAM . RAM has faster access speeds compared to hard drives, allowing for quicker data querying and processing.   The read and write speed of RAM is very fast, typically reaching several GB/s . The read and write speed of SSDs ( Solid State Drives ) usually starts from 320 MB/s and can reach thousands of megabytes per second. The read and write speed of HDDs ( Hard Disk Drives ) is lower, generally ranging from 80 MB/s to 160 MB/s. In-memory data is often used f...

Deploying a Golang Application to Google Kubernetes Engine

Image
Introduction In this article, I will guide you through deploying a Golang 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 Golang 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 Golang Application In this step, you can either use an existin...

Kubernetes Health Check and Auto Restart

Image
Introduction When you deploy an application to a production environment, various issues can cause it to stop working. These could be code bugs, database problems, or external service issues. Each problem requires a different solution. However, if you’re using Kubernetes to deploy your application and want it to automatically restart when an issue occurs, this article is for you. Prerequisites Before proceeding, ensure you have: A Kubernetes cluster set up. You can use Google Kubernetes Engine or set up a local Kubernetes cluster with Kind . Knowledge of Kubernetes , specifically how to create Deployments and Services . Kubernetes Probes In this article, I'll guide you through using three types of probes to check the status of your application: 1. Startup Probe    - As the name suggests, this probe runs when the application starts. It ensures the container has started successfully. Only after the Startup Probe succeeds do the Readiness and Liveness Probes execute. 2. Readin...

Using Kubernetes Ingress to navigate traffic to Services

Image
Introduction In the previous article, I introduced the basic concepts of Kubernetes Ingress , and how to use Ingress along with related components ( Nginx Ingress Controller and cert-manager ) to automatically issue TLS certificates when deploying HTTPS applications . In this article, I'll show you how to define rules in Ingress to route traffic to different Services based on your needs. Prepare Docker Image First, you'll need a Docker image to get started. You can either use two different Docker images or follow my next instructions to prepare a Docker image . Here's a code block to create a NodeJS server that displays a title based on an environment variable input: import express from 'express' const port = 3000 const title = 'This is NodeJS Typescript Application' const app = express () app . get ( '/' , ( _ , res ) => { res . send (( process ?. env ?. TITLE ?? title ) + '! Current time is ' + Date . now ()) ...