/todo-2018

Example Todo application on Kubernetes using ASP Core .NET 2.1, Cloudant NoSQL DB and IBM Cloud Object Storage

Primary LanguageCSSMIT LicenseMIT

todo-2018

Example Todo application on Kubernetes using ASP Core .NET 2.1, Cloudant NoSQL DB and IBM Cloud Object Storage

Description

This is a small todo application with the following components:

  • Cloudant NoSQL Database => storage of todo items
  • ASP Core .NET 2.1 REST Service => microservice for CRUD of todo items
  • IBM Cloud Object Storage => S3 compatible storage of static webfile content with private HMAC bucket credentials
  • OpenResty/NGINX Caching Webserver => caching static webcontent proxy for api alt text
  1. The user sends a request to the public endpoint application which is represented by an Ingress application load balancer that load balances incoming network traffic across app pods in the cluster.
  2. The loadbalancer forwards to one of the available Pods of the deployed Services.
  3. The NGINX/OpenResty Pods accessing the Cloud Object Storage bucket via HMAC Authorization and caching the webcontent.
  4. The ASP.NET Core 2.1 todo-api provides a REST interface for CRUD operations of TODO items and is accessing the Cloudant NoSQL DB.

Prerequisites:

Installation on IBM Cloud Kubernetes Service

  1. clone this repo
git clone https://github.com/cloud-dach/todo-2018.git
cd todo2018
git submodule init
git submodule update
  1. create environment source file
cp env.local.sample env.local
  1. adjust settings in env.local to match your COS and Kubernetes Settings
  2. Sync static webcontent to your bucket
./01_s3sync.sh
  1. Build and push the Docker images for the ASP.NET Core and NGINX Service to the IBM Cloud Container Registry
./02_buildimages.sh
  1. Create a Lite Plan Cloudant NoSQL Db via the ibmcloud cli
./03_createdb.sh
  1. bind the cloudant credentials as kubernetes secrets in the cluster
./04_servicebind.sh
  1. generate deploy2kube.yaml from template (please review the generated file)
./05_deploy.sh
  1. deploy to kubernetes
kubectl create -f deploy2kube.yml
  1. Review the deployed items
kubectl describe ingress todo-app
  1. Open the application in the Browser based on the output from the todo-app ingress information https://todo.YOURCLUSTERSUBDOMAIN.DOMAIN/index.html

alt text