Giter Club home page Giter Club logo

gitops-app-distribution's Introduction

gitops-app-distribution

As a software vendor I want to distribute my application in a reliable manner to service providers that will host the app on their own Kubernetes clusters e.g. EKS, AKS/Linkerd, GKE/Istio.

The application is composed of several containerized micro-services: frontend, backend, cache and database. Each micro-service receives periodically updates via container image releases and configuration changes. These updates should be tested in isolation with automated e2e testing. Once the updates are made available to service providers, the release on production clusters should be gated by conformance tests.

In order to ensure that the service providers SLAs are not being broken by new releases, the release process will expose a micro-service new version to live traffic in a progressive manner, while measuring the service level objectives (SLOs) like availability, error rate percentage and average response time. If a drop in performance is noticed during the SLOs analysis, the release will be automatically rolled back with minimum impact to end-users.

Service providers should have the option to customize the app to fit their SLAs e.g. set different resources requests and limits, tweak the auto-scaling thresholds or manual approval of canary releases.

Technical solution:

  • create a repository with the manifests required to distribute the app on Kubernetes
  • create a dedicated distribution for each service provider environment type
  • use Kustomize to build each environment type (distribution) while keeping the YAML duplication at minimum
  • use GitHub Actions and Kubernetes Kind to validate changes
  • use Flux to distribute changes on the service providers clusters
    • reconcile a target cluster with an app distribution
    • monitor the base distribution and update the target cluster on spec changes
  • use Flagger to automate the production releases on the service providers clusters
    • run conformance tests before exposing an updated micro-service to live traffic
    • run canary style deployments with progressive traffic shifting for frontend and backend micro-services
    • run blue/green style deployments for cache and database micro-services

Distribution

GitOps

A service provider will use Kustomize and FluxCD to deploy the app on production clusters.

Git repository structure:

app/
├── .flux.yaml
└── kustomization.yaml

The service provider will use one of the distributions as the kustomization base: dist//app-kubernetes or dist//app-istio or dist//app-linkerd.

kustomization.yaml

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: app
bases:
  - github.com/stefanprodan/gitops-app-distribution/dist//app-istio?ref=1.0.0

The service provider can further customize the application installation, for example on an Istio cluster, the ingress could be replaced with Istio Gateway and on a Linkerd cluster the ingress could be replaced with Gloo.

.flux.yaml

version: 1
commandUpdated:
  generators:
    - command: kustomize build .

Change management

Let's assume the vendor wants to release a new frontend version that requires configuration changes as well as a container image update.

Vendor workflow:

  • the frontend team releases a new container image tagged frontend:v2.0.0
  • the frontend teams creates a PR with the frontend image tag and configuration file changes
  • the PR is being validated in CI with e2e tests for all distributions (Kubernetes, Istio, Linkerd)
  • the PR is merged into master followed by a GitHub release e.g. 1.1.0

Service provider workflow:

  • the provider is notified about the update
  • the provider create a PR on one of the production cluster git repos and changes the base to dist//app-istio?ref=1.1.0
  • the PR is being validated in CI with e2e tests for the Istio distribution
  • the PR is merged into master
  • Flux detects the changes in git and fetches the upstream manifests
  • Flux applies the kustomization on the cluster
  • Flagger detects that the frontend image and configuration file has changed
  • Flagger runs the conformance tests for the frontend micro-service
  • Flagger starts to gradually shift traffic towards the new frontend version
  • Flagger runs the canary analysis and validates the service level objectives (SLOs)
  • Flagger promotes the new frontend version by upgrading the config and rolling the v2 image in production
  • Flagger notifies the service provider on Slack or MS Teams that frontend was updated

gitops-app-distribution's People

Contributors

stefanprodan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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