Coder Social home page Coder Social logo

cortex-kustomize's Introduction

Cortex Kustomize

Kustomize background

Kustomize is a CNCF project that is a part of Kubernetes. It's included in the kubectl in order to allow users to customize their configurations without introducing templates.

Usage

kustomize encourages defining multiple variants - e.g. dev, staging and prod, as overlays on a common base.

It’s possible to create an additional overlay to compose these variants together - just declare the overlays as the bases of a new kustomization.

cortex-kustomize provides a common base for Blocks Storage deployment to Kubernetes. People should Create variants using overlays to deploy Cortex in their own environment.

An overlay is just another kustomization, referring to the base, and referring to patches to apply to that base. This arrangement makes it easy to manage your configuration with git. The base could have files from an upstream repository managed by someone else. The overlays could be in a repository you own. Arranging the repo clones as siblings on disk avoids the need for git submodules (though that works fine, if you are a submodule fan).

Example

This is an example of monitoring Cortex by adding prometheus and grafana using kustomize

  1. Create development Environment

    mkdir -p deploy/overlays/dev

  1. Create kustomization.yaml (note that this is not the complete file):

    apiVersion: kustomize.config.k8s.io/v1beta1
    kind: Kustomization
    
    namespace: cortex-monitoring-system
    
    resources:
    - github.com/qclaogui/cortex-kustomize/deploy/base/blocks?ref=main
    - add-grafana-dep.yaml
    - add-grafana-svc.yaml
    - add-retrieval-dep.yaml
    - add-retrieval-svc.yaml
    
    patchesStrategicMerge:
    - patch-nginx-svc.yaml
    
    images:
    - name: quay.io/cortexproject/cortex
     newTag: master-b6eea5f
    - name: minio/minio
     newTag: RELEASE.2021-06-17T00-10-46Z

File structure:

└── deploy
   └── overlays
       └── dev
           ├── add-grafana-dep.yaml
           ├── add-grafana-svc.yaml
           ├── add-retrieval-dep.yaml
           ├── add-retrieval-svc.yaml
           ├── kustomization.yaml
           └── patch-nginx-svc.yaml
  1. Deploy to a cluster

kustomize build deploy/overlays/dev | kubectl apply -f -

More example detailed https://github.com/qclaogui/cortex-kustomize-demo.

Happy Cortex

cortex-kustomize's People

Contributors

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