Skip to content

A containerized application deployed to IBM Cloud Kubernetes Service. The app consists of Python-Flask Backend API Service, ReactJS Frontend, and Mongo Database. Full Automation of this project can be done via the Terraform project

Notifications You must be signed in to change notification settings

nifeoluyemi/helloworld-microservices

Repository files navigation

Hello, World Microservices

This is a Hello World project where you can add a programming language and its hello world code. It comprises of a frontend ReactJS application, a Python Flask backend API application, and a MongoDB database. The goal of this project is to compile each individual service into its own container image and deploy to a kubernetes cluster on IBM Cloud.

Web UI

  • Add a new Language with Hello World code (URL: /new) Add new Language

  • List all Languages (URL: /) All Languages

Steps to Run the Project

Create an IBM Cloud account

Create an IBM Cloud account if you haven't done so already

Create IBM CLoud IAM API Key

  • Open IBM Cloud console
  • Go to Manage > Access (IAM)
  • In the new window, on the left navigation menu, select API Keys, and Create an IBM Cloud API Key. Add new API Key
  • Copy the key and store it somewhere safe

Create an IBM Cloud Container Registry

  • Click on "Catalog" in the header menu on IBM Cloud
  • Search for "Container Registry", and select "Container Registry"
  • Click on Create button, to create a new Container Registry
  • Navigate to the "Namespaces", and click "Create +" button to add a new namespace.

Install Docker

Install Docker on your machine

  • Install Docker Desktop, and login to Docker Desktop Create Docker Hub Account Here, If you don't already have one.

Login to your container registry

docker login us.icr.io/<container_registry_namespace> -u iamapikey -p <ibm_iam_cloud_api_key>

Pull Mongo DB image from Docker Hub

docker pull mongo:4.2.6

Build and Push the Hello World Flask and React Applications

Still in the root directory of this project, run the commands to build and push the image for each service:

HelloWorld Flask

docker build -t us.icr.io/<container_registry_namespace>/helloworld-flask helloworld-flask
docker push us.icr.io/<container_registry_namespace>/helloworld-flask

HelloWorld React

docker build -t us.icr.io/<container_registry_namespace>/helloworld-react helloworld-react
docker push us.icr.io/<container_registry_namespace>/helloworld-react

Deploy Kubernetes Resources

See Runbook Here

Running the Projects

To Run each individual project, see their respective README

Using Terraform

I created a terraform script to deploy a free kubernetes cluster to ibm cloud, and run the deploy the kubernetes resources using a bash script. See Runbook Here

About

A containerized application deployed to IBM Cloud Kubernetes Service. The app consists of Python-Flask Backend API Service, ReactJS Frontend, and Mongo Database. Full Automation of this project can be done via the Terraform project

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published