Code Monkey home page Code Monkey logo

cicd-kustomize's Introduction

CICD FLow

  1. Export API from API Manager

  2. Generate deployment repo using apictl.

  3. Commit both source repo and deployment repo.

Source Repo

└── Online-Store-v1.0.0 └── Meta-information ├── api.yaml └── swagger.yaml

Deployment Repo

└── Online-Store-v1.0.0 ├── api-meta.yaml ├── certs └── params.yaml

Jenkins Flow (VM)

  1. Adding new entry to the deployment
  • Identify Online-Store-v1.0.0 is added/updated newly (Based on commit artifacts)
  • Read api-meta.yaml - It has relevant versions, url of the artifact
  • Execute following commands to deploy

apictl import api --from-file=online_store_v1_r1.zip --params params.yaml --certs ./certs

  1. Updating an existing entry
  • Identify Online-Store-v1.0.0 is added/updated newly (Based on commit artifacts)
  • Read api-meta.yaml - It has relevant versions, url of the artifact
  • Execute following commands to deploy

apictl import api --from-file=online_store_v1_r1.zip --params params.yaml --certs ./certs --update

Deployment Repo (K8s)

└── Online-Store-v1.0.0_k8s ├── api-meta.yaml ├── api_crd.yaml ├── certs └── params_cm.yaml

Jenkins Flow (K8s)

  1. Adding new entry to the deployment
  • Identify Online-Store-v1.0.0 is added/updated newly (Based on commit artifacts)
  • Read api-meta.yaml - It has relevant versions, url of the artifact
  • Get source zip from remote location
  • Read configmap name from api_crd.yaml and then create a configmap with that name
  • Deploy params_cm configmap
  • Deploy certs configmaps
  • Deploy api_crd.yaml
  1. Updating an existing entry
  • Identify Online-Store-v1.0.0 is added/updated newly (Based on commit artifacts)

Update different source zip / params/ certs : Option 1 - update timestamp

  • Commit to source repo
  • Change api-meta.yaml and api_crd.yaml (update timestamp), commit to deployment repo
  • Read api-meta.yaml - It has relevant versions, url of the artifact
  • Get source zip from remote location
  • Read configmap name from api_crd.yaml and then delete that cm, create a new configmap with that name
  • Deploy params_cm configmap
  • Deploy certs configmaps
  • Deploy api_crd.yaml

Update different source zip / params/ certs : Option 2 - API Operator watcher

  • Commit to source repo
  • Change api-meta.yaml and commit to deployment repo
  • Read api-meta.yaml - It has relevant versions, url of the artifact
  • Get source zip from remote location
  • Read configmap name from api_crd.yaml and then delete that cm, create a new configmap with that name
  • API operator watches the configmaps and do the rolling update

Update different source zip / params/ certs : Option 3 - New names for configmaps

  • Commit to source repo
  • Change api-meta.yaml and commit to deployment repo
  • Read api-meta.yaml - It has relevant versions, url of the artifact
  • Get source zip from remote location
  • Use kubectl get api foo and identify the configmap names used.
  • Create new configmaps with a different name for artifacts
  • Update api-crd.yaml with those names and reapply
  • Delete previous identified configmap names

Update different source zip / params/ certs : Option 4 - kustomize

  • Commit to source repo
  • Change api-meta.yaml and commit to deployment repo
  • Read api-meta.yaml - It has relevant versions, url of the artifact
  • Get source zip from remote location
  • Use kubectl get api foo and identify the configmap names used.
  • Create new configmaps with a different name for artifacts
  • Update api-crd.yaml with those names and reapply
  • Delete previous identified configmap names

cicd-kustomize's People

Contributors

pubudu538 avatar

Watchers

James Cloos 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.