diff --git a/modules/ob-about-buildrun.adoc b/modules/ob-about-buildrun.adoc index ce2b2602a029..3fdbb3908959 100644 --- a/modules/ob-about-buildrun.adoc +++ b/modules/ob-about-buildrun.adoc @@ -7,7 +7,7 @@ = BuildRun resource [role="_abstract"] -A `BuildRun` resource invokes a build on the cluster similar to a Tekton task run. It represents a workload that instantiates a build for execution with specific parameters. Each BuildRun defines a unique name for monitoring, references a Build instance, and specifies a service account within a namespace. +A `BuildRun` resource invokes a build on the cluster similar to a Tekton task run. It represents a workload that instantiates a build for execution with specific parameters. Each `BuildRun` defines a unique name for monitoring, references a Build instance, and specifies a service account within a namespace. A `BuildRun` resource helps you to define the following elements: diff --git a/modules/ob-basic-authentication.adoc b/modules/ob-basic-authentication.adoc index 7e5ee37f45ac..e824e68e24d5 100644 --- a/modules/ob-basic-authentication.adoc +++ b/modules/ob-basic-authentication.adoc @@ -7,7 +7,7 @@ = Basic authentication [role="_abstract"] -Configure basic authentication credentials for a Git repository by creating a Kubernetes secret with a username and password. The following example shows a Git basic-auth secret referenced by a build: +Configure Basic authentication credentials for a Git repository by creating a Kubernetes secret with a username and password. The following example shows a Git basic-auth secret referenced by a build: [source,yaml] ---- @@ -24,5 +24,5 @@ stringData: ---- where: -`type`:: Specifies the Kubernetes secret type. `kubernetes.io/basic-auth` indicates that the secret contains credentials for basic authentication. -`stringData`:: Specifies the username and password used for basic authentication to the Git repository referenced by the build. \ No newline at end of file +`type`:: Specifies the Kubernetes secret type. `kubernetes.io/basic-auth` indicates that the secret contains credentials for Basic authentication. +`stringData`:: Specifies the username and password used for Basic authentication to the Git repository referenced by the build. \ No newline at end of file diff --git a/modules/ob-build-run-status.adoc b/modules/ob-build-run-status.adoc index 54409fb69823..9f7290e367f1 100644 --- a/modules/ob-build-run-status.adoc +++ b/modules/ob-build-run-status.adoc @@ -10,7 +10,7 @@ Monitor the progress and completion of your image builds by checking the status of the `BuildRun` custom resource (CR). A `BuildRun` CR stores status information in the status.conditions field. This field includes the status, the reason for that status, and a descriptive message. For example, a `Succeeded` condition type means the build finished successfully. -The following examples show how to view the status of a specific BuildRun CR. +The following examples show how to view the status of a specific `BuildRun` CR. Unknown status:: An `Unknown` status indicates the build is still starting or in progress. The following example shows a `BuildRun` with `Unknown` status: diff --git a/modules/ob-configuring-pods-in-build-run.adoc b/modules/ob-configuring-pods-in-build-run.adoc index ac8a15305476..d48a4d2e3106 100644 --- a/modules/ob-configuring-pods-in-build-run.adoc +++ b/modules/ob-configuring-pods-in-build-run.adoc @@ -11,7 +11,7 @@ Configure pod scheduling and placement for {builds-shortname} by using optional Use the following fields to configure {builds-shortname} pods: -* `spec.tolerations`: Specifies pod tolerations. Note: Only the NoSchedule taint effect is supported. +* `spec.tolerations`: Specifies pod tolerations. Note: Only the `NoSchedule` taint effect is supported. * `spec.nodeSelector`: Specifies the nodes where the pod must run. diff --git a/modules/ob-configuring-pods-in-build.adoc b/modules/ob-configuring-pods-in-build.adoc index 500a01b67896..4bbc17092a6b 100644 --- a/modules/ob-configuring-pods-in-build.adoc +++ b/modules/ob-configuring-pods-in-build.adoc @@ -20,6 +20,6 @@ Use the following optional `Build` CR fields to configure {builds-shortname} pod [NOTE] ==== -If you define these fields in the Build and BuildRun CRs, the BuildRun values take priority. +If you define these fields in the Build and `BuildRun` CRs, the `BuildRun` values take priority. ==== diff --git a/modules/ob-creating-a-buildah-build-network-restricted.adoc b/modules/ob-creating-a-buildah-build-network-restricted.adoc new file mode 100644 index 000000000000..651fd607b8a8 --- /dev/null +++ b/modules/ob-creating-a-buildah-build-network-restricted.adoc @@ -0,0 +1,227 @@ +// Module included in the following assemblies: +// +// * work_with_builds/creating-container-images-in-a-network-restricted-environment.adoc + +:_mod-docs-content-type: PROCEDURE +[id='ob-creating-a-buildah-build-in-a-network-restricted-environment_{context}'] += Creating a buildah build in a network-restricted environment + +[role="_abstract"] +Create a `buildah` build in a network-restricted environment by mirroring the images that `buildah` build strategy requires. Mirroring the images eliminates the need for public registry access. This ensures clusters use only images that comply with external content controls. + +.Prerequisites + +* You have installed the {builds-operator} on the {ocp-product-title} cluster. +* You have installed the `oc` CLI. +* Optional: You have installed the link:https://console.redhat.com/openshift/downloads[`shp` CLI]. +* Your cluster can connect and interact with the Git source that you can use to create the buildah build. +* You have the builder-image required to create the `buildah` build in your local registry. If the builder-image is not present in the local registry, mirror the source image. + +.Procedure + +. Run the following command to mirror the images that `buildah` build strategy requires: ++ +[source,terminal] +---- +$ oc image mirror --insecure -a registry.redhat.io/ubi8/buildah@sha256:1c89cc3cab0ac0fc7387c1fe5e63443468219aab6fd531c8dad6d22fd999819e //ubi8_buildah +---- ++ +where: + +``:: Specifies the authentication credentials used to access a container registry. This is required when pushing to or pulling from a private registry. +``:: Specifies the registry where the image you want to mirror is stored. + +. Create a `Build` resource and apply it to the {ocp-product-title} cluster. You can +do so by using the `oc` command or the `shp` command: ++ +[source,terminal] +---- +$ oc apply -f - < registry.redhat.io/source-to-image/source-to-image-rhel8@sha256:d041c1bbe503d152d0759598f79802e257816d674b342670ef61c6f9e6d401c5 //source-to-image-source-to-image-rhel8 +---- ++ +where: + +``:: Specifies the authentication credentials used to access a container registry. This is required when pushing to or pulling from a private registry. +``:: Specifies the registry where the image you want to mirror is stored. + +. Create a `Build` resource and apply it to the {ocp-product-title} cluster. You can do so by using the `oc` command or the `shp` command: ++ +[source,terminal] +---- +$ oc apply -f - </s2i-nodejs-example + pushSecret: registry-credential +EOF +---- ++ +-- +where: + +`source`:: Defines the location where the source code is placed. +`strategy`:: Defines the build strategy that you use to build the container. +`paramValues`:: Defines the parameters for the build strategy. For `source-to-image` builds, this includes the `builder-image` parameter that specifies the base image used to build your application. +`output`:: Defines the location where the built image is pushed. In this procedural example, the built image is pushed to the {ocp-product-title} cluster internal registry. `buildah-example` is the name of the current project. Ensure that the specified project exists to allow the image push. +`pushSecret`:: Defines the secret name that stores the credentials for pushing container images. To generate a secret of the type `docker-registry` for authentication, see "Authentication to container registries". +-- + ++ +[source,terminal] +---- +$ shp build create s2i-nodejs-build \ +--source-url="https://github.com/redhat-openshift-builds/samples" --source-context-dir="s2i-build/nodejs" \ +--strategy-name="source-to-image" \ +--builder-image="quay.io/centos7/nodejs-12-centos7" \ +--output-image="quay.io//s2i-nodejs-example" \ +--output-credentials-secret="registry-credential" +---- ++ +where: + +`source-context-dir`:: Defines the location where the source code is placed. +`strategy-name`:: The build strategy that you use to build the container. +`builder-image`:: The parameter defined in the build strategy. For `source-to-image` builds, this specifies the base image used to build your application. +`output-image`:: The location where the built image is pushed. In this procedural example, the built image is pushed to the {ocp-product-title} cluster internal registry. `buildah-example` is the name of the current project. Ensure that the specified project exists to allow the image push. +`output-credentials-secret`:: The secret name that stores the credentials for pushing container images. To generate a secret of the type `docker-registry` for authentication, see "Authentication to container registries". + +. Check if the `Build` resource is created. You can do so by using the `oc` command or the `shp` command: ++ +[source,terminal] +---- +$ oc get builds.shipwright.io s2i-nodejs-build +---- + ++ +[source,terminal] +---- +$ shp build list +---- + +. Create a `BuildRun` resource and apply it to the {ocp-product-title} cluster. You can do so by using the `oc` command or the `shp` command: ++ +[source,terminal] +---- +$ oc apply -f - </s2i-nodejs-example + pushSecret: registry-credential +EOF +---- ++ +-- +where: + +`source`:: Defines the location where the source code is placed. +`strategy`:: Defines the build strategy that you use to build the container. +`paramValues`:: Defines the parameters for the build strategy. For `source-to-image` builds, this includes the `builder-image` parameter that specifies the base image used to build your application. +`output`:: Defines the location where the built image is pushed. In this procedural example, the built image is pushed to the {ocp-product-title} cluster internal registry. `buildah-example` is the name of the current project. Ensure that the specified project exists to allow the image push. +`pushSecret`:: Defines the secret name that stores the credentials for pushing container images. To generate a secret of the type `docker-registry` for authentication, see "Authentication to container registries". +-- + ++ +[source,terminal] +---- +$ shp build create s2i-nodejs-build \ +--source-url="https://github.com/redhat-openshift-builds/samples" --source-context-dir="s2i-build/nodejs" \ +--strategy-name="source-to-image" \ +--builder-image="quay.io/centos7/nodejs-12-centos7" \ +--output-image="quay.io//s2i-nodejs-example" \ +--output-credentials-secret="registry-credential" +---- ++ +where: + +`source-context-dir`:: Defines the location where the source code is placed. +`strategy-name`:: The build strategy that you use to build the container. +`builder-image`:: The parameter defined in the build strategy. For `source-to-image` builds, this specifies the base image used to build your application. +`output-image`:: The location where the built image is pushed. In this procedural example, the built image is pushed to the {ocp-product-title} cluster internal registry. `buildah-example` is the name of the current project. Ensure that the specified project exists to allow the image push. +`output-credentials-secret`:: The secret name that stores the credentials for pushing container images. To generate a secret of the type `docker-registry` for authentication, see "Authentication to container registries". + +. Check if the `Build` resource is created. You can do so by using the `oc` command or the `shp` command: ++ +[source,terminal] +---- +$ oc get builds.shipwright.io s2i-nodejs-build +---- + ++ +[source,terminal] +---- +$ shp build list +---- + +. Create a `BuildRun` resource and apply it to the {ocp-product-title} cluster. You can do so by using the `oc` command or the `shp` command: ++ +[source,terminal] +---- +$ oc apply -f - <