Giter VIP home page Giter VIP logo

catalog-example's Introduction

Catalog Structure Format

All packages are put under /catalog/ dir (this is configurable). The directory structure follows a predefined format:

/catalog/ # a catalog consists of multiple packages 
|-- <package> # a package consists of multiple versions
    |-- package.yaml
    |-- 1.0
        |-- modules.yaml
        |-- caps.yaml
        |-- conditions/
            |-- check-crd.yaml
        |-- hooks/
            |-- pre-install.yaml
    |-- 2.0 # must be semver
|-- <package>
  • Note that each package directory name will be the package name. Each version directory name will be the version name.

  • package.yaml: This is package-level metadata.

    description: |
      More details about this package.
    maintainers:
      - "@github_id"
      - "[email protected]"
    license: "Apache License Version 2.0"
    url: "https://homepage.io"
    
    tags: # This will be indexed and serve in package searching.
      - helm
      - autoscaling
      - light-weight
      - cloud-native
  • definitions.yaml: This defines the definitions that a pacakge (in specific version) provides. It tells the name, the type (Application/Component/Trait), and the json schema exposed for user input.

    - name: WebService
      type: Component
      schema:
        path: ../schema/webservice.schema.json
    - name: Routing
      type: Trait
      schema:
        path: ../schema/routing.schema.json
    - name: MyApp
      type: Application
      schema:
        path: ../schema/myapp.schema.json
  • modules.yaml: It defines the modules that contain the actual resources, e.g. Helm Charts or Terraform modules. Note that the design extensible to more module/package formats (e.g. CloudFormation templates).

    modules:
      - helm: # Helm module to install/upgrade
          repo: https://wonderflow.info/kubewatch/archives/
          name: kubewatch
          version: 0.1.0
      - native: # Native k8s yaml to apply
          path: definitions/trait.yaml # relative path to the modules.yaml
          url: https://git.io/vPieo
  • conditions/: It defines conditional checks before deploying this package. For example, check if a CRD with specific version exist, if not then the deployment should fail.

    # check-crd.yaml
    conditions:
    - target:
        apiVersion: apiextensions.k8s.io/v1
        kind: CustomResourceDefinition
        name: test.example.com
        fieldPath: spec.versions[0].name
      op: eq
      value: "v1"
  • hooks/:lifecycle hooks on deploying this package. These are the k8s jobs, and consists of pre-install, post-install, pre-uninstall, post-uninstall.

    # pre-install.yaml
    pre-install:
    - job:
        apiVersion: batch/v1
        kind: Job
        spec:
          template:
            spec:
              containers:
              - name: pre-install-job
                image: "pre-install:v1"
                command: ["/bin/pre-install"]

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.