Multi-container stateful web application deployment to different Kubernetes environments

Image for post
Image for post

👋Introduction

Kubernetes is very helpful to understand the Cloud architecture and how we got where we are today. When you start to work with Kubernetes without understanding why we need it, it may be felt overwhelming. But if you know due to what requirements this product appeared and you actually need to use it, Kubernetes is fun to understand.

I created a CRUD application and used Docker/Docker-compose for local development in my previous post. In that post, I told “I am also planning to use Kubernetes for this project in the future” so this is the day🎉. We are going to deploy Angular 9, Spring Boot, and MySql stack Stateful CRUD web application to Google Cloud Kubernetes Engine(GKE) and local Minikube cluster for testing and development purposes. …

A Star Wars Quotes Web Application

Image for post
Image for post

👋Introduction

Most developers use Docker daily base or once in a while in the product development or at the deployment life cycle. It is very powerful and fun to play with the tool. But if you use quite a deal of docker containers, a management issue arises. Docker-composer provides a simple and fast solution for container management, on the other hand, it has its own shortcomings which lead us to systems like Kubernetes and Docker Swarm but they are more DevOps tools nevertheless knowing how they work and tampering with them don’t hurt. So I decided to show you how I use docker and docker-compose to create a CRUD web application. I used MySql for database, PhpMyAdmin for database visualization, Spring Boot(Java) as a back-end, and Angular 9 as a front-end. …

Image for post
Image for post

Plan of the post:

1. Create Node.js Web App

2. Create a Dockerfile

3. Install Google Cloud SDK

4. Create Google Cloud Project and Configure Local Environment

5. Build and Deploy Docker Image with Google Cloud Commands

6. Build and Deploy Docker Image with Docker Commands

7. Create Firewall Rules

8. Deploy Docker Image to Compute Engine and Run

Create Node.js Web App

First, create a simple Node.js “Hello world!” example.

$ mkdir node-web-app
$ cd node-web-app/
$ npm init

Image for post
Image for post

Plan of the post:

1. Creating GCP project

2. Enabling the Compute Engine Service API

3. Creating Instance

4. Starting Instance with Startup Script

— 4.a — Creating Bucket

— 4.b — Creating a Startup Script

— 4.c — Outcome of Startup Script

— 4.d — Last Touch: Providing the Startup Script via Cloud Storage

5. Auto Scaling Compute Engine Instance

— 5.a — Creating Instance Template and an Instance from Template

— 5.b — Creating Managed Instance Groups (MIG) and Setting Up Auto-Scaling

Creating a Project

There are three ways of creating a project in GCP the first one from GCP web UI , the second one from Terminal and the third one is via API. …

About

Kadir Emre Ozcan

Junior Full-Stack Developer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store