Git Product home page Git Product logo

build-old-fork's Introduction

Knative Build

This repository implements Build and BuildTemplate custom resources for Kubernetes, and a controller for making them work.

For complete Knative Build documentation, see Knative Build or Knative docs to learn about Knative.

If you are interested in contributing, see CONTRIBUTING.md and DEVELOPMENT.md.

Objective

Kubernetes is emerging as the predominant (if not de facto) container orchestration layer. It is also quickly becoming the foundational layer on top of which the ecosystem is building higher-level compute abstractions (PaaS, FaaS). In order to increase developer velocity, these higher-level compute abstractions typically operate on source, not just containers, which must be built.

This repository provides an implementation of the Build CRD that runs Builds on-cluster (by default), because that is the lowest common denominator that we expect users to have available. It is also possible to write a pkg/builder implementation that delegates Builds to hosted services (e.g. Google Container Builder), but these are typically more restrictive.

This project as it exists today is not a complete standalone product that could be used for CI/CD, but it provides a building block to facilitate the expression of Builds as part of larger systems. It might provide a building block for CI/CD in the future

Terminology and Conventions

Getting Started

You can install the latest release of the Build CRD by running:

kubectl create -f https://storage.googleapis.com/knative-releases/latest/release-build.yaml

Your account must have the cluster-admin role in order to do this. If your account does not have this role, you can add it:

kubectl create clusterrolebinding myname-cluster-admin-binding \
    --clusterrole=cluster-admin \
    [email protected]

Run your first Build

apiVersion: build.knative.dev/v1alpha1
kind: Build
metadata:
  name: hello-build
spec:
  steps:
  - name: hello
    image: busybox
    args: ['echo', 'hello', 'build']

Run it on your Kubernetes cluster:

$ kubectl apply -f build.yaml
build "hello-build" created

Check that it was created:

$ kubectl get builds
NAME          AGE
hello-build   4s

Get more information about the build:

$ kubectl get build hello-build -oyaml
apiVersion: build.knative.dev/v1alpha1
kind: Build
...
status:
  builder: Cluster
  cluster:
    namespace: default
    podName: hello-build-jx4ql
  conditions:
  - state: Complete
    status: "True"
  stepStates:
  - terminated:
      reason: Completed
  - terminated:
      reason: Completed

This indicates that the build finished successfully, and that it ran on a pod named hello-build-jx4ql -- your build will run on a pod with a different name. Let's dive into that pod!

$ kubectl get pod hello-build-jx4ql -oyaml
...lots of interesting stuff!

Here's a shortcut for getting a build's underlying podName:

$ kubectl get build hello-build -ojsonpath={.status.cluster.podName}

The build's underlying pod also contains the build's logs, in an init container named after the build step's name. In the case of this example, the build step's name was hello, so the pod will have an init container named build-step-hello which ran the step.

$ kubectl logs $(kubectl get build hello-build -ojsonpath={.status.cluster.podName}) -c build-step-hello
hello build

๐ŸŽ‰

build-old-fork's People

Contributors

adrcunha avatar bkrannich avatar bobcatfish avatar bsnchan avatar dgageot avatar dprotaso avatar evankanderson avatar imjasonh avatar jonjohnsonjr avatar labadav avatar mattmoor avatar mchmarny avatar mdemirhan avatar n3wscott avatar pmorie avatar rootfs avatar scothis avatar sebgoa avatar shashwathi avatar sixolet avatar steuhs avatar

Watchers

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