Chapter 4. Build [config.openshift.io/v1]
- Description
- Build configures the behavior of OpenShift builds for the entire cluster. This includes default settings that can be overridden in BuildConfig objects, and overrides which are applied to all builds. The canonical name is "cluster" Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
- Type
-
object
- Required
-
spec
-
4.1. Specification
Property | Type | Description |
---|---|---|
|
| APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources |
|
| Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds |
| Standard object’s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata | |
|
| Spec holds user-settable values for the build controller configuration |
4.1.1. .spec
- Description
- Spec holds user-settable values for the build controller configuration
- Type
-
object
Property | Type | Description |
---|---|---|
|
| AdditionalTrustedCA is a reference to a ConfigMap containing additional CAs that should be trusted for image pushes and pulls during builds. The namespace for this config map is openshift-config. DEPRECATED: Additional CAs for image pull and push should be set on image.config.openshift.io/cluster instead. |
|
| BuildDefaults controls the default information for Builds |
|
| BuildOverrides controls override settings for builds |
4.1.2. .spec.additionalTrustedCA
- Description
- AdditionalTrustedCA is a reference to a ConfigMap containing additional CAs that should be trusted for image pushes and pulls during builds. The namespace for this config map is openshift-config. DEPRECATED: Additional CAs for image pull and push should be set on image.config.openshift.io/cluster instead.
- Type
-
object
- Required
-
name
-
Property | Type | Description |
---|---|---|
|
| name is the metadata.name of the referenced config map |
4.1.3. .spec.buildDefaults
- Description
- BuildDefaults controls the default information for Builds
- Type
-
object
Property | Type | Description |
---|---|---|
|
|
DefaultProxy contains the default proxy settings for all build operations, including image pull/push and source download. Values can be overrode by setting the |
|
| Env is a set of default environment variables that will be applied to the build if the specified variables do not exist on the build |
|
| EnvVar represents an environment variable present in a Container. |
|
| GitProxy contains the proxy settings for git operations only. If set, this will override any Proxy settings for all git commands, such as git clone. Values that are not set here will be inherited from DefaultProxy. |
|
| ImageLabels is a list of docker labels that are applied to the resulting image. User can override a default label by providing a label with the same name in their Build/BuildConfig. |
|
| |
|
| Resources defines resource requirements to execute the build. |
4.1.4. .spec.buildDefaults.defaultProxy
- Description
-
DefaultProxy contains the default proxy settings for all build operations, including image pull/push and source download. Values can be overrode by setting the
HTTP_PROXY
,HTTPS_PROXY
, andNO_PROXY
environment variables in the build config’s strategy. - Type
-
object
Property | Type | Description |
---|---|---|
|
| httpProxy is the URL of the proxy for HTTP requests. Empty means unset and will not result in an env var. |
|
| httpsProxy is the URL of the proxy for HTTPS requests. Empty means unset and will not result in an env var. |
|
| noProxy is a comma-separated list of hostnames and/or CIDRs and/or IPs for which the proxy should not be used. Empty means unset and will not result in an env var. |
|
| readinessEndpoints is a list of endpoints used to verify readiness of the proxy. |
|
| trustedCA is a reference to a ConfigMap containing a CA certificate bundle. The trustedCA field should only be consumed by a proxy validator. The validator is responsible for reading the certificate bundle from the required key "ca-bundle.crt", merging it with the system default trust bundle, and writing the merged trust bundle to a ConfigMap named "trusted-ca-bundle" in the "openshift-config-managed" namespace. Clients that expect to make proxy connections must use the trusted-ca-bundle for all HTTPS requests to the proxy, and may use the trusted-ca-bundle for non-proxy HTTPS requests as well. The namespace for the ConfigMap referenced by trustedCA is "openshift-config". Here is an example ConfigMap (in yaml): apiVersion: v1 kind: ConfigMap metadata: name: user-ca-bundle namespace: openshift-config data: ca-bundle.crt: | -----BEGIN CERTIFICATE----- Custom CA certificate bundle. -----END CERTIFICATE----- |
4.1.5. .spec.buildDefaults.defaultProxy.trustedCA
- Description
- trustedCA is a reference to a ConfigMap containing a CA certificate bundle. The trustedCA field should only be consumed by a proxy validator. The validator is responsible for reading the certificate bundle from the required key "ca-bundle.crt", merging it with the system default trust bundle, and writing the merged trust bundle to a ConfigMap named "trusted-ca-bundle" in the "openshift-config-managed" namespace. Clients that expect to make proxy connections must use the trusted-ca-bundle for all HTTPS requests to the proxy, and may use the trusted-ca-bundle for non-proxy HTTPS requests as well. The namespace for the ConfigMap referenced by trustedCA is "openshift-config". Here is an example ConfigMap (in yaml): apiVersion: v1 kind: ConfigMap metadata: name: user-ca-bundle namespace: openshift-config data: ca-bundle.crt: \| -----BEGIN CERTIFICATE----- Custom CA certificate bundle. -----END CERTIFICATE-----
- Type
-
object
- Required
-
name
-
Property | Type | Description |
---|---|---|
|
| name is the metadata.name of the referenced config map |
4.1.6. .spec.buildDefaults.env
- Description
- Env is a set of default environment variables that will be applied to the build if the specified variables do not exist on the build
- Type
-
array
4.1.7. .spec.buildDefaults.env[]
- Description
- EnvVar represents an environment variable present in a Container.
- Type
-
object
- Required
-
name
-
Property | Type | Description |
---|---|---|
|
| Name of the environment variable. Must be a C_IDENTIFIER. |
|
| Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "". |
|
| Source for the environment variable’s value. Cannot be used if value is not empty. |
4.1.8. .spec.buildDefaults.env[].valueFrom
- Description
- Source for the environment variable’s value. Cannot be used if value is not empty.
- Type
-
object
Property | Type | Description |
---|---|---|
|
| Selects a key of a ConfigMap. |
|
|
Selects a field of the pod: supports metadata.name, metadata.namespace, |
|
| Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported. |
|
| Selects a key of a secret in the pod’s namespace |
4.1.9. .spec.buildDefaults.env[].valueFrom.configMapKeyRef
- Description
- Selects a key of a ConfigMap.
- Type
-
object
- Required
-
key
-
Property | Type | Description |
---|---|---|
|
| The key to select. |
|
| Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid? |
|
| Specify whether the ConfigMap or its key must be defined |
4.1.10. .spec.buildDefaults.env[].valueFrom.fieldRef
- Description
-
Selects a field of the pod: supports metadata.name, metadata.namespace,
metadata.labels['<KEY>']
,metadata.annotations['<KEY>']
, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs. - Type
-
object
- Required
-
fieldPath
-
Property | Type | Description |
---|---|---|
|
| Version of the schema the FieldPath is written in terms of, defaults to "v1". |
|
| Path of the field to select in the specified API version. |
4.1.11. .spec.buildDefaults.env[].valueFrom.resourceFieldRef
- Description
- Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
- Type
-
object
- Required
-
resource
-
Property | Type | Description |
---|---|---|
|
| Container name: required for volumes, optional for env vars |
|
| Specifies the output format of the exposed resources, defaults to "1" |
|
| Required: resource to select |
4.1.12. .spec.buildDefaults.env[].valueFrom.secretKeyRef
- Description
- Selects a key of a secret in the pod’s namespace
- Type
-
object
- Required
-
key
-
Property | Type | Description |
---|---|---|
|
| The key of the secret to select from. Must be a valid secret key. |
|
| Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid? |
|
| Specify whether the Secret or its key must be defined |
4.1.13. .spec.buildDefaults.gitProxy
- Description
- GitProxy contains the proxy settings for git operations only. If set, this will override any Proxy settings for all git commands, such as git clone. Values that are not set here will be inherited from DefaultProxy.
- Type
-
object
Property | Type | Description |
---|---|---|
|
| httpProxy is the URL of the proxy for HTTP requests. Empty means unset and will not result in an env var. |
|
| httpsProxy is the URL of the proxy for HTTPS requests. Empty means unset and will not result in an env var. |
|
| noProxy is a comma-separated list of hostnames and/or CIDRs and/or IPs for which the proxy should not be used. Empty means unset and will not result in an env var. |
|
| readinessEndpoints is a list of endpoints used to verify readiness of the proxy. |
|
| trustedCA is a reference to a ConfigMap containing a CA certificate bundle. The trustedCA field should only be consumed by a proxy validator. The validator is responsible for reading the certificate bundle from the required key "ca-bundle.crt", merging it with the system default trust bundle, and writing the merged trust bundle to a ConfigMap named "trusted-ca-bundle" in the "openshift-config-managed" namespace. Clients that expect to make proxy connections must use the trusted-ca-bundle for all HTTPS requests to the proxy, and may use the trusted-ca-bundle for non-proxy HTTPS requests as well. The namespace for the ConfigMap referenced by trustedCA is "openshift-config". Here is an example ConfigMap (in yaml): apiVersion: v1 kind: ConfigMap metadata: name: user-ca-bundle namespace: openshift-config data: ca-bundle.crt: | -----BEGIN CERTIFICATE----- Custom CA certificate bundle. -----END CERTIFICATE----- |
4.1.14. .spec.buildDefaults.gitProxy.trustedCA
- Description
- trustedCA is a reference to a ConfigMap containing a CA certificate bundle. The trustedCA field should only be consumed by a proxy validator. The validator is responsible for reading the certificate bundle from the required key "ca-bundle.crt", merging it with the system default trust bundle, and writing the merged trust bundle to a ConfigMap named "trusted-ca-bundle" in the "openshift-config-managed" namespace. Clients that expect to make proxy connections must use the trusted-ca-bundle for all HTTPS requests to the proxy, and may use the trusted-ca-bundle for non-proxy HTTPS requests as well. The namespace for the ConfigMap referenced by trustedCA is "openshift-config". Here is an example ConfigMap (in yaml): apiVersion: v1 kind: ConfigMap metadata: name: user-ca-bundle namespace: openshift-config data: ca-bundle.crt: \| -----BEGIN CERTIFICATE----- Custom CA certificate bundle. -----END CERTIFICATE-----
- Type
-
object
- Required
-
name
-
Property | Type | Description |
---|---|---|
|
| name is the metadata.name of the referenced config map |
4.1.15. .spec.buildDefaults.imageLabels
- Description
- ImageLabels is a list of docker labels that are applied to the resulting image. User can override a default label by providing a label with the same name in their Build/BuildConfig.
- Type
-
array
4.1.16. .spec.buildDefaults.imageLabels[]
- Description
- Type
-
object
Property | Type | Description |
---|---|---|
|
| Name defines the name of the label. It must have non-zero length. |
|
| Value defines the literal value of the label. |
4.1.17. .spec.buildDefaults.resources
- Description
- Resources defines resource requirements to execute the build.
- Type
-
object
Property | Type | Description |
---|---|---|
|
| Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. This field is immutable. It can only be set for containers. |
|
| ResourceClaim references one entry in PodSpec.ResourceClaims. |
|
| Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ |
|
| Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. Requests cannot exceed Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ |
4.1.18. .spec.buildDefaults.resources.claims
- Description
- Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. This field is immutable. It can only be set for containers.
- Type
-
array
4.1.19. .spec.buildDefaults.resources.claims[]
- Description
- ResourceClaim references one entry in PodSpec.ResourceClaims.
- Type
-
object
- Required
-
name
-
Property | Type | Description |
---|---|---|
|
| Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container. |
4.1.20. .spec.buildOverrides
- Description
- BuildOverrides controls override settings for builds
- Type
-
object
Property | Type | Description |
---|---|---|
|
| ForcePull overrides, if set, the equivalent value in the builds, i.e. false disables force pull for all builds, true enables force pull for all builds, independently of what each build specifies itself |
|
| ImageLabels is a list of docker labels that are applied to the resulting image. If user provided a label in their Build/BuildConfig with the same name as one in this list, the user’s label will be overwritten. |
|
| |
|
| NodeSelector is a selector which must be true for the build pod to fit on a node |
|
| Tolerations is a list of Tolerations that will override any existing tolerations set on a build pod. |
|
| The pod this Toleration is attached to tolerates any taint that matches the triple <key,value,effect> using the matching operator <operator>. |
4.1.21. .spec.buildOverrides.imageLabels
- Description
- ImageLabels is a list of docker labels that are applied to the resulting image. If user provided a label in their Build/BuildConfig with the same name as one in this list, the user’s label will be overwritten.
- Type
-
array
4.1.22. .spec.buildOverrides.imageLabels[]
- Description
- Type
-
object
Property | Type | Description |
---|---|---|
|
| Name defines the name of the label. It must have non-zero length. |
|
| Value defines the literal value of the label. |
4.1.23. .spec.buildOverrides.tolerations
- Description
- Tolerations is a list of Tolerations that will override any existing tolerations set on a build pod.
- Type
-
array
4.1.24. .spec.buildOverrides.tolerations[]
- Description
- The pod this Toleration is attached to tolerates any taint that matches the triple <key,value,effect> using the matching operator <operator>.
- Type
-
object
Property | Type | Description |
---|---|---|
|
| Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. |
|
| Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys. |
|
| Operator represents a key’s relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category. |
|
| TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system. |
|
| Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string. |
4.2. API endpoints
The following API endpoints are available:
/apis/config.openshift.io/v1/builds
-
DELETE
: delete collection of Build -
GET
: list objects of kind Build -
POST
: create a Build
-
/apis/config.openshift.io/v1/builds/{name}
-
DELETE
: delete a Build -
GET
: read the specified Build -
PATCH
: partially update the specified Build -
PUT
: replace the specified Build
-
/apis/config.openshift.io/v1/builds/{name}/status
-
GET
: read status of the specified Build -
PATCH
: partially update status of the specified Build -
PUT
: replace status of the specified Build
-
4.2.1. /apis/config.openshift.io/v1/builds
- HTTP method
-
DELETE
- Description
- delete collection of Build
HTTP code | Reponse body |
---|---|
200 - OK |
|
401 - Unauthorized | Empty |
- HTTP method
-
GET
- Description
- list objects of kind Build
HTTP code | Reponse body |
---|---|
200 - OK |
|
401 - Unauthorized | Empty |
- HTTP method
-
POST
- Description
- create a Build
Parameter | Type | Description |
---|---|---|
|
| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed |
|
| fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. |
Parameter | Type | Description |
---|---|---|
|
|
HTTP code | Reponse body |
---|---|
200 - OK |
|
201 - Created |
|
202 - Accepted |
|
401 - Unauthorized | Empty |
4.2.2. /apis/config.openshift.io/v1/builds/{name}
Parameter | Type | Description |
---|---|---|
|
| name of the Build |
- HTTP method
-
DELETE
- Description
- delete a Build
Parameter | Type | Description |
---|---|---|
|
| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed |
HTTP code | Reponse body |
---|---|
200 - OK |
|
202 - Accepted |
|
401 - Unauthorized | Empty |
- HTTP method
-
GET
- Description
- read the specified Build
HTTP code | Reponse body |
---|---|
200 - OK |
|
401 - Unauthorized | Empty |
- HTTP method
-
PATCH
- Description
- partially update the specified Build
Parameter | Type | Description |
---|---|---|
|
| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed |
|
| fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. |
HTTP code | Reponse body |
---|---|
200 - OK |
|
401 - Unauthorized | Empty |
- HTTP method
-
PUT
- Description
- replace the specified Build
Parameter | Type | Description |
---|---|---|
|
| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed |
|
| fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. |
Parameter | Type | Description |
---|---|---|
|
|
HTTP code | Reponse body |
---|---|
200 - OK |
|
201 - Created |
|
401 - Unauthorized | Empty |
4.2.3. /apis/config.openshift.io/v1/builds/{name}/status
Parameter | Type | Description |
---|---|---|
|
| name of the Build |
- HTTP method
-
GET
- Description
- read status of the specified Build
HTTP code | Reponse body |
---|---|
200 - OK |
|
401 - Unauthorized | Empty |
- HTTP method
-
PATCH
- Description
- partially update status of the specified Build
Parameter | Type | Description |
---|---|---|
|
| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed |
|
| fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. |
HTTP code | Reponse body |
---|---|
200 - OK |
|
401 - Unauthorized | Empty |
- HTTP method
-
PUT
- Description
- replace status of the specified Build
Parameter | Type | Description |
---|---|---|
|
| When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed |
|
| fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. |
Parameter | Type | Description |
---|---|---|
|
|
HTTP code | Reponse body |
---|---|
200 - OK |
|
201 - Created |
|
401 - Unauthorized | Empty |