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
- 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.
- The loadbalancer forwards to one of the available Pods of the deployed Services.
- The NGINX/OpenResty Pods accessing the Cloud Object Storage bucket via HMAC Authorization and caching the webcontent.
- 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:
- Paid IBM Cloud Kubernetes Custer
- local git, docker and kubectl CLIs installed
- IBM Cloud Object Storage Instance with bucket and HMAC credentials https://console.bluemix.net/docs/services/cloud-object-storage/hmac/credentials.html#using-hmac-credentials
- s3cmd installed, separate configuration not needed, everything needed will be passed by 01_s3sync.sh script http://s3tools.org/s3cmd
Installation on IBM Cloud Kubernetes Service
- clone this repo
git clone https://github.com/cloud-dach/todo-2018.git
cd todo2018
git submodule init
git submodule update
- create environment source file
cp env.local.sample env.local
- adjust settings in env.local to match your COS and Kubernetes Settings
- Sync static webcontent to your bucket
./01_s3sync.sh
- Build and push the Docker images for the ASP.NET Core and NGINX Service to the IBM Cloud Container Registry
./02_buildimages.sh
- Create a Lite Plan Cloudant NoSQL Db via the ibmcloud cli
./03_createdb.sh
- bind the cloudant credentials as kubernetes secrets in the cluster
./04_servicebind.sh
- generate deploy2kube.yaml from template (please review the generated file)
./05_deploy.sh
- deploy to kubernetes
kubectl create -f deploy2kube.yml
- Review the deployed items
kubectl describe ingress todo-app
- Open the application in the Browser based on the output from the todo-app ingress information https://todo.YOURCLUSTERSUBDOMAIN.DOMAIN/index.html