Code Monkey home page Code Monkey logo

cni-poc's Introduction

Cloud Native Initialization - Proof of concept

Introdution

We have 3 methods to do the cloud native initialization task:

  1. Initialize with Helm pre-install hook and initialization containers

    If the hook depends on the service that will be installed, it will cause a deadlock.

  2. Initialize with Helm post-install hook and initialization containers

    If the hook depends on the service that will be installed,and given wrong priority (hook weight), it will cause a deadlock.

    When we assign the correct priority to the hook, the hook executes serially, and the wait time will not be as long as necessary.

    If you let helm wait for the Pods in a ready state, deadlocks can occur. This is because helm is waiting before the post-hooks execution.

  3. Initialize with Kubernetes job and initialization containers

    Without careful tuning of task priorities, it will complete the initialization work in the correct priority and shortest time.

    Since there is no helm to clean up, only the data required for initialization will remain in the cluster, and the Kubernetes environment will looks a bit messy, or need clean up manually.

Setup

The demo program requires the following prerequisites:

  • Kubernetes environment
  • The host address and port used to display the execution information
  • Running netcat in the specified host address and port

Proof of concept

Cloud Native Initialization - Demo program

This demo program contains 3 Microservice services, cm, nef and nidd, all of which depend on the database.

Let's assume that the startup time for these services and databases, database takes 10 seconds, cm takes 15 seconds, nidd takes 20 seconds. For the oneshot database initialization time, cm takes 10 seconds, nef takes 10 seconds, nidd takes 15 seconds.

Moreover, nef need oneshot initialization on cm, it takes 10 seconds。

Cloud Native Initialization - Demo program

Initialize with Helm pre-install hook and initialization containers

  1. Separate Helm charts works good.
  2. Umbrella Helm charts can deadlock, not works.

Initialize with Helm post-install hook and initialization containers

  1. Separate Helm charts works good.
  2. Umbrella Helm charts works.
  3. Umbrella Helm charts with improper hooks weight can deadlock, not works.
  4. If you let helm wait for the Pods in a ready state, deadlocks can occur.

Initialize with Kubernetes jobs and initialization containers

  1. Separate Helm charts works good.
  2. Umbrella Helm charts works good.
  3. Kubernetes jobs can do better, it run initialization tasks concurrently, reducing initialization time.
  4. Since no helm to clean up, it looks a bit messy, and add some confusion to the upgrade process.

cni-poc's People

Contributors

songdongsheng 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.