Build configuration resources

Use the following procedure to configure build settings.

Build controller configuration parameters

The build.config.openshift.io/cluster resource offers the following configuration parameters.

ParameterDescription

Build

Holds cluster-wide information on how to handle builds. The canonical, and only valid name is cluster.

spec: Holds user-settable values for the build controller configuration.

buildDefaults

Controls the default information for builds.

defaultProxy: Contains the default proxy settings for all build operations, including image pull or push and source download.

You can override values by setting the HTTP_PROXY, HTTPS_PROXY, and NO_PROXY environment variables in the BuildConfig strategy.

gitProxy: Contains the proxy settings for Git operations only. If set, this overrides any proxy settings for all Git commands, such as git clone.

Values that are not set here are inherited from DefaultProxy.

env: A set of default environment variables that are applied to the build if the specified variables do not exist on the build.

imageLabels: A list of labels that are applied to the resulting image. You can override a default label by providing a label with the same name in the BuildConfig.

resources: Defines resource requirements to execute the build.

ImageLabel

name: Defines the name of the label. It must have non-zero length.

buildOverrides

Controls override settings for builds.

imageLabels: A list of labels that are applied to the resulting image. If you provided a label in the BuildConfig with the same name as one in this table, your label will be overwritten.

nodeSelector: A selector which must be true for the build pod to fit on a node.

tolerations: A list of tolerations that overrides any existing tolerations set on a build pod.

BuildList

items: Standard object’s metadata.

Configuring build settings

You can configure build settings by editing the build.config.openshift.io/cluster resource.

Procedure

  • Edit the build.config.openshift.io/cluster resource:

    1. $ oc edit build.config.openshift.io/cluster

    The following is an example build.config.openshift.io/cluster resource:

    1. apiVersion: config.openshift.io/v1
    2. kind: Build(1)
    3. metadata:
    4. annotations:
    5. release.openshift.io/create-only: "true"
    6. creationTimestamp: "2019-05-17T13:44:26Z"
    7. generation: 2
    8. name: cluster
    9. resourceVersion: "107233"
    10. selfLink: /apis/config.openshift.io/v1/builds/cluster
    11. uid: e2e9cc14-78a9-11e9-b92b-06d6c7da38dc
    12. spec:
    13. buildDefaults:(2)
    14. defaultProxy:(3)
    15. httpProxy: http://proxy.com
    16. httpsProxy: https://proxy.com
    17. noProxy: internal.com
    18. env:(4)
    19. - name: envkey
    20. value: envvalue
    21. gitProxy:(5)
    22. httpProxy: http://gitproxy.com
    23. httpsProxy: https://gitproxy.com
    24. noProxy: internalgit.com
    25. imageLabels:(6)
    26. - name: labelkey
    27. value: labelvalue
    28. resources:(7)
    29. limits:
    30. cpu: 100m
    31. memory: 50Mi
    32. requests:
    33. cpu: 10m
    34. memory: 10Mi
    35. buildOverrides:(8)
    36. imageLabels:(9)
    37. - name: labelkey
    38. value: labelvalue
    39. nodeSelector:(10)
    40. selectorkey: selectorvalue
    41. tolerations:(11)
    42. - effect: NoSchedule
    43. key: node-role.kubernetes.io/builds
    44. operator: Exists
    1Build: Holds cluster-wide information on how to handle builds. The canonical, and only valid name is cluster.
    2buildDefaults: Controls the default information for builds.
    3defaultProxy: Contains the default proxy settings for all build operations, including image pull or push and source download.
    4env: A set of default environment variables that are applied to the build if the specified variables do not exist on the build.
    5gitProxy: Contains the proxy settings for Git operations only. If set, this overrides any Proxy settings for all Git commands, such as git clone.
    6imageLabels: A list of labels that are applied to the resulting image. You can override a default label by providing a label with the same name in the BuildConfig.
    7resources: Defines resource requirements to execute the build.
    8buildOverrides: Controls override settings for builds.
    9imageLabels: A list of labels that are applied to the resulting image. If you provided a label in the BuildConfig with the same name as one in this table, your label will be overwritten.
    10nodeSelector: A selector which must be true for the build pod to fit on a node.
    11tolerations: A list of tolerations that overrides any existing tolerations set on a build pod.