Git Product home page Git Product logo

build's Introduction

Work in Progress

The build Kubernetes API

Codenamed build-v2

An API to build container-images on Kubernetes using popular strategies and tools like source-to-image, buildpack-v3, kaniko, jib and buildah, in an extensible way.

How

The following are the BuildStrategies supported by this operator, out-of-the-box:

Users have the option to define their own BuildStrategies and make them available for consumption by Builds.

Operator Resources

This operator ships two CRDs in order to register a strategy and then start the actual application builds using a registered strategy.

BuildStrategy

The resource BuildStrategy (buildstrategies.build.dev/v1alpha1) allows you to define a shared group of steps needed to fullfil the application build. Those steps are defined as containers/v1 entries.

---
apiVersion: build.dev/v1alpha1
kind: BuildStrategy
metadata:
  name: source-to-image
spec:
  buildSteps:
...

Well-known strategies can be boostrapped from here.

Build

The resource Build (builds.dev/v1alpha1) binds together source-code and BuildStrategy culminating in the actual appplication build process being executed in Kubernetes. Please consider the following example:

---
apiVersion: build.dev/v1alpha1
kind: Build
metadata:
  name: example-build-buildpack 
spec:
  source:
    url: https://github.com/sclorg/nodejs-ex
    credentials:
      name: source-repository-credentials
  strategy:
    name: buildpacks-v3
    namespace: openshift
  builder:
    image: heroku/buildpacks:18
    credentials: quayio-olemefer
  output:
    image: quay.io/olemefer/nodejs-ex:v1
    credentials:
      name: quayio-olemefer

The resource is updated as soon as the current building status changes:

$ kubectl get builds.build.dev buildpacks
NAME         STATUS
buildpacks   Running

And finally:

$ kubectl get builds.build.dev buildpacks
NAME         STATUS
buildpacks   Succeeded

Examples

Examples of Build resource using the example strategies shipped with this operator.


Try it!

  1. Install Tekton, optionally you could use OpenShift Pipelines Community Operator

  2. Install operator-sdk

  3. Create a project or namespace called build-examples

  4. Execute make local to register well-known build strategies including Kaniko and start the operator.

  5. Start a Kaniko build

---
apiVersion: build.dev/v1alpha1
kind: Build
metadata:
  name: kaniko-golang-build
  namespace: build-examples
spec:
  source:
    url: https://github.com/sbose78/taxi
  strategy:
    name: kaniko
    namespace: build-examples
  dockerfile: Dockerfile
  pathContext: ./
  output:
    image: image-registry.openshift-image-registry.svc:5000/build-examples/taxi-app

Development


Roadmap

Build Strategies Support

Build Strategy Alpha Beta GA
Source-to-Image
Buildpacks-v3 ☑️
Kaniko ☑️
Buildah ☑️

Features

Feature Alpha Beta GA
Private Git Repos ☑️
Private Output Image Registry ☑️
Private Builder Image Registry ☑️
Cluster scope BuildStrategy ☑️
Runtime Base Image ⚪️
Binary builds
Image Caching
ImageStreams support
Entitlements

build's People

Contributors

avni-sharma avatar baijum avatar openshift-merge-robot avatar otaviof avatar qu1queee avatar sbose78 avatar zhangtbj 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.