Git Product home page Git Product logo

containernanny's Introduction

Kuber.NET

Monitoring solution for container jobs scale

Architecture

Basic Architecture

The proposed solution uses an Azure Function to get the message count from a Service Bus Queue. Is is triggered every n minutes. If there is any message, Function calls Kubernetes API in order to scale it up, creating a job on Kube.

Every job has the following pattern: It continuously peek, process and delete messages from queue. If there is no messages in a definied interval, the process finishes.

Basic Architecture

Basic Architecture + DevOps Included

The solution above can be extended to embrace a DevOps process. In the following proposed architecture a Jenkins instance is triggered by a git repository. Then it builds the container image and pushes to an Azure Container Registry. Right after, Jenkins calls Kubernetes API and notifies the new container image.

Basic Architecture + DevOps Included

Documentation (/docs):

  1. Initial Deployment
  2. Kubernetes Setup
  3. Certificate Setup
  4. SDK Development
  5. Function Development
  6. Deployment and Jobs

Projects (/src):

Library

This .NET Full library implements:

  • Authentication
  • Deployments scaling
  • Jobs creation

Function

The C# Azure Function with the following code snippets:

  • Kube.csx: handles calls to Kuber.NET private assembly
  • Queue.csx: handles calls to Service Bus Queue using its SDK
  • Settings.csx: stores all settings related to the project
  • run.csx: business logic inside container scaling rules

Example\Queue:

  • Queue.Checker: Check if there is any item in a Queue and use Kuber.NET to increase the number of containers (.NET Full, Project to be deploy inside an Azure Function)
  • Queue.Producer: Inserts items in Service Bus Queue (.NET Full, Simulate other enviroment microservices)
  • Queue.Consumer: Reads items in Service Bus Queue (.NET Core, Simulate container inside Kubernetes)

Scripts

Scripts for automation (used in our Jenkins instance).

  • buildandpush.sh: Builds the .NET core project, create the docker image and deploys it to Azure Container Registry.
  • buildimage_example.sh: Example that uses the script above.
  • deployment_template.yaml: Uses a previously built image from Azure Container Registry and creates a Deployment on Kubernetes.
  • job_template.yaml: Uses a previously built image from Azure Container Registry and creates a Job on Kubernetes.

References

containernanny's People

Contributors

allantargino avatar fabioharams avatar viniciussouza avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.