docs/reference/build.md

22 KiB
Raw Blame History

Packages:

build.knative.dev

Package v1alpha1 is the v1alpha1 version of the API.

Resource Types:

Build

Build represents a build of a container image. A Build is made up of a source, and a set of steps. Steps can mount volumes to share data between themselves. A build may be created by instantiating a BuildTemplate.

Field Description
apiVersion
string
build.knative.dev/v1alpha1
kind
string
Build
metadata
Kubernetes meta/v1.ObjectMeta
Refer to the Kubernetes API documentation for the fields of the metadata field.
spec
BuildSpec


generation
int64
(Optional)

TODO: Generation does not work correctly with CRD. They are scrubbed by the APIserver (https://github.com/kubernetes/kubernetes/issues/58778) So, we add Generation here. Once that gets fixed, remove this and use ObjectMeta.Generation instead.

source
SourceSpec

Source specifies the input to the build.

steps
[]Kubernetes core/v1.Container

Steps are the steps of the build; each step is run sequentially with the source mounted into /workspace.

volumes
[]Kubernetes core/v1.Volume

Volumes is a collection of volumes that are available to mount into the steps of the build.

serviceAccountName
string

The name of the service account as which to run this build.

template
TemplateInstantiationSpec

Template, if specified, references a BuildTemplate resource to use to populate fields in the build, and optional Arguments to pass to the template. The default Kind of template is BuildTemplate

nodeSelector
map[string]string
(Optional)

NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a nodes labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/

timeout
Kubernetes meta/v1.Duration
(Optional)

Time after which the build times out. Defaults to 10 minutes. Specified build timeout should be less than 24h. Refer Gos ParseDuration documentation for expected format: https://golang.org/pkg/time/#ParseDuration

affinity
Kubernetes core/v1.Affinity
(Optional)

If specified, the pods scheduling constraints

status
BuildStatus

BuildTemplate

BuildTemplate is a template that can used to easily create Builds.

Field Description
apiVersion
string
build.knative.dev/v1alpha1
kind
string
BuildTemplate
metadata
Kubernetes meta/v1.ObjectMeta
Refer to the Kubernetes API documentation for the fields of the metadata field.
spec
BuildTemplateSpec


generation
int64
(Optional)

TODO: Generation does not work correctly with CRD. They are scrubbed by the APIserver (https://github.com/kubernetes/kubernetes/issues/58778) So, we add Generation here. Once that gets fixed, remove this and use ObjectMeta.Generation instead.

parameters
[]ParameterSpec

Parameters defines the parameters that can be populated in a template.

steps
[]Kubernetes core/v1.Container

Steps are the steps of the build; each step is run sequentially with the source mounted into /workspace.

volumes
[]Kubernetes core/v1.Volume

Volumes is a collection of volumes that are available to mount into the steps of the build.

ClusterBuildTemplate

ClusterBuildTemplate is a template that can used to easily create Builds.

Field Description
apiVersion
string
build.knative.dev/v1alpha1
kind
string
ClusterBuildTemplate
metadata
Kubernetes meta/v1.ObjectMeta
Refer to the Kubernetes API documentation for the fields of the metadata field.
spec
BuildTemplateSpec


generation
int64
(Optional)

TODO: Generation does not work correctly with CRD. They are scrubbed by the APIserver (https://github.com/kubernetes/kubernetes/issues/58778) So, we add Generation here. Once that gets fixed, remove this and use ObjectMeta.Generation instead.

parameters
[]ParameterSpec

Parameters defines the parameters that can be populated in a template.

steps
[]Kubernetes core/v1.Container

Steps are the steps of the build; each step is run sequentially with the source mounted into /workspace.

volumes
[]Kubernetes core/v1.Volume

Volumes is a collection of volumes that are available to mount into the steps of the build.

ArgumentSpec

(Appears on: TemplateInstantiationSpec)

ArgumentSpec defines the actual values to use to populate a templates parameters.

Field Description
name
string

Name is the name of the argument.

value
string

Value is the value of the argument.

BuildProvider (string alias)

(Appears on: BuildStatus)

BuildProvider defines a build execution implementation.

BuildSpec

(Appears on: Build)

BuildSpec is the spec for a Build resource.

Field Description
generation
int64
(Optional)

TODO: Generation does not work correctly with CRD. They are scrubbed by the APIserver (https://github.com/kubernetes/kubernetes/issues/58778) So, we add Generation here. Once that gets fixed, remove this and use ObjectMeta.Generation instead.

source
SourceSpec

Source specifies the input to the build.

steps
[]Kubernetes core/v1.Container

Steps are the steps of the build; each step is run sequentially with the source mounted into /workspace.

volumes
[]Kubernetes core/v1.Volume

Volumes is a collection of volumes that are available to mount into the steps of the build.

serviceAccountName
string

The name of the service account as which to run this build.

template
TemplateInstantiationSpec

Template, if specified, references a BuildTemplate resource to use to populate fields in the build, and optional Arguments to pass to the template. The default Kind of template is BuildTemplate

nodeSelector
map[string]string
(Optional)

NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a nodes labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/

timeout
Kubernetes meta/v1.Duration
(Optional)

Time after which the build times out. Defaults to 10 minutes. Specified build timeout should be less than 24h. Refer Gos ParseDuration documentation for expected format: https://golang.org/pkg/time/#ParseDuration

affinity
Kubernetes core/v1.Affinity
(Optional)

If specified, the pods scheduling constraints

BuildStatus

(Appears on: Build)

BuildStatus is the status for a Build resource

Field Description
builder
BuildProvider
cluster
ClusterSpec

Cluster provides additional information if the builder is Cluster.

google
GoogleSpec

Google provides additional information if the builder is Google.

startTime,omitEmpty
Kubernetes meta/v1.Time

StartTime is the time the build is actually started.

completionTime,omitEmpty
Kubernetes meta/v1.Time

CompletionTime is the time the build completed.

stepStates,omitEmpty
[]Kubernetes core/v1.ContainerState

StepStates describes the state of each build step container.

stepsCompleted
[]string

StepsCompleted lists the name of build steps completed.

conditions
github.com/knative/pkg/apis/duck/v1alpha1.Conditions

Conditions describes the set of conditions of this build.

BuildTemplateInterface

BuildTemplateInterface is implemented by BuildTemplate and ClusterBuildTemplate

BuildTemplateSpec

(Appears on: BuildTemplate, ClusterBuildTemplate)

BuildTemplateSpec is the spec for a BuildTemplate.

Field Description
generation
int64
(Optional)

TODO: Generation does not work correctly with CRD. They are scrubbed by the APIserver (https://github.com/kubernetes/kubernetes/issues/58778) So, we add Generation here. Once that gets fixed, remove this and use ObjectMeta.Generation instead.

parameters
[]ParameterSpec

Parameters defines the parameters that can be populated in a template.

steps
[]Kubernetes core/v1.Container

Steps are the steps of the build; each step is run sequentially with the source mounted into /workspace.

volumes
[]Kubernetes core/v1.Volume

Volumes is a collection of volumes that are available to mount into the steps of the build.

ClusterSpec

(Appears on: BuildStatus)

ClusterSpec provides information about the on-cluster build, if applicable.

Field Description
namespace
string

Namespace is the namespace in which the pod is running.

podName
string

PodName is the name of the pod responsible for executing this builds steps.

GCSSourceSpec

(Appears on: SourceSpec)

GCSSourceSpec describes source input to the Build in the form of an archive, or a source manifest describing files to fetch.

Field Description
type
GCSSourceType

Type declares the style of source to fetch.

location
string

Location specifies the location of the source archive or manifest file.

GCSSourceType (string alias)

(Appears on: GCSSourceSpec)

GCSSourceType defines a type of GCS source fetch.

GitSourceSpec

(Appears on: SourceSpec)

GitSourceSpec describes a Git repo source input to the Build.

Field Description
url
string

URL of the Git repository to clone from.

revision
string

Git revision (branch, tag, commit SHA or ref) to clone. See https://git-scm.com/docs/gitrevisions#_specifying_revisions for more information.

GoogleSpec

(Appears on: BuildStatus)

GoogleSpec provides information about the GCB build, if applicable.

Field Description
operation
string

Operation is the unique name of the GCB API Operation for the build.

ParameterSpec

(Appears on: BuildTemplateSpec)

ParameterSpec defines the possible parameters that can be populated in a template.

Field Description
name
string

Name is the unique name of this template parameter.

description
string

Description is a human-readable explanation of this template parameter.

default
string

Default, if specified, defines the default value that should be applied if the build does not specify the value for this parameter.

SourceSpec

(Appears on: BuildSpec)

SourceSpec defines the input to the Build

Field Description
git
GitSourceSpec

Git represents source in a Git repository.

gcs
GCSSourceSpec

GCS represents source in Google Cloud Storage.

custom
Kubernetes core/v1.Container

Custom indicates that source should be retrieved using a custom process defined in a container invocation.

subPath
string

SubPath specifies a path within the fetched source which should be built. This option makes parent directories inaccessible to the build steps. (The specific source type may, in fact, not even fetch files not in the SubPath.)

Template

Template is an interface for accessing the BuildTemplateSpec from various forms of template (namespace-/cluster-scoped).

TemplateInstantiationSpec

(Appears on: BuildSpec)

TemplateInstantiationSpec specifies how a BuildTemplate is instantiated into a Build.

Field Description
name
string

Name references the BuildTemplate resource to use.

The template is assumed to exist in the Builds namespace.

kind
TemplateKind

The Kind of the template to be used, possible values are BuildTemplate or ClusterBuildTemplate. If nothing is specified, the default if is BuildTemplate

arguments
[]ArgumentSpec

Arguments, if specified, lists values that should be applied to the parameters specified by the template.

env
[]Kubernetes core/v1.EnvVar

Env, if specified will provide variables to all build template steps. This will override any of the templates steps environment variables.

TemplateKind (string alias)

(Appears on: TemplateInstantiationSpec)

TemplateKind defines the type of BuildTemplate used by the build.


Generated with gen-crd-api-reference-docs on git commit 9485975.