turbot/openshift
steampipe plugin install openshift

Table: openshift_build - Query OpenShift Builds using SQL

OpenShift Builds are a part of the OpenShift Container Platform build system, which provides a consistent method of turning application source code into a running containerized application. The build system captures source code from a version control system, processes it into a new container image, and pushes it to a container image registry. It supports several strategies to produce images.

Table Usage Guide

The openshift_build table provides insights into the build configurations within OpenShift Container Platform. As a DevOps engineer, explore build-specific details through this table, including the build strategy, source, status, and output. Utilize it to track the progress of builds, understand the build strategies being used, and verify the output of completed builds.

Examples

Basic info

Analyze the settings to understand the overall performance and status of your OpenShift builds. This query helps to pinpoint specific instances where builds may have failed or been cancelled, providing insights to improve system efficiency and stability.

select
uid,
name,
namespace,
start_timestamp,
reason,
phase,
cancelled,
duration,
completion_timestamp
from
openshift_build;
select
uid,
name,
namespace,
start_timestamp,
reason,
phase,
cancelled,
duration,
completion_timestamp
from
openshift_build;

List incomplete builds

Discover the segments that are still in progress within your OpenShift environment. This query is useful for tracking ongoing processes and identifying any builds that may be stalled or delayed.

select
uid,
name,
namespace,
start_timestamp,
reason,
phase,
cancelled,
duration,
completion_timestamp
from
openshift_build
where
phase <> 'Complete';
select
uid,
name,
namespace,
start_timestamp,
reason,
phase,
cancelled,
duration,
completion_timestamp
from
openshift_build
where
phase <> 'Complete';

List cancelled builds

Explore which builds have been cancelled in OpenShift to understand the reasons behind it and analyze the duration and time of cancellation. This helps in identifying any recurring issues and taking proactive measures to improve build success rates.

select
uid,
name,
namespace,
start_timestamp,
reason,
phase,
cancelled,
duration,
completion_timestamp
from
openshift_build
where
cancelled;
select
uid,
name,
namespace,
start_timestamp,
reason,
phase,
cancelled,
duration,
completion_timestamp
from
openshift_build
where
cancelled = 1;

List common specs of the builds

Explore the common specifications of different builds to understand their unique configurations and phases. This can aid in identifying patterns or irregularities in build setups, thereby facilitating improved management and optimization of resources.

select
uid,
name,
namespace,
phase,
jsonb_pretty(common_spec) as common_spec
from
openshift_build;
select
uid,
name,
namespace,
phase,
common_spec
from
openshift_build;

Get trigger details of the builds

Analyze the settings to understand the stages and conditions that initiate specific builds in a system. This can help in identifying the triggers and resolving any issues related to the build process.

select
uid,
name,
namespace,
phase,
jsonb_pretty(triggered_by) as triggered_by
from
openshift_build;
select
uid,
name,
namespace,
phase,
triggered_by
from
openshift_build;

Get stage details of the builds

Analyze the stages of various builds to understand their progress and status, which can be useful for managing and optimizing build processes within an OpenShift environment.

select
uid,
name,
namespace,
phase,
jsonb_pretty(stages) as stages
from
openshift_build;
select
uid,
name,
namespace,
phase,
stages
from
openshift_build;

Schema for openshift_build

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
annotationsjsonbAnnotations is an unstructured key-value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata.
cancelledbooleanCancelled describes if a cancel event was triggered for the build.
common_specjsonbCommonSpec is the information that represents a build.
completion_timestamptimestamp with time zoneIt is a timestamp representing the server time when this Build was finished, whether that build failed or succeeded. It reflects the time at which the Pod running the Build terminated.
conditionstextConditions represent the latest available observations of a build's current state.
configjsonbIt is an ObjectReference to the BuildConfig this Build is based on.
creation_timestamptimestamp with time zoneCreationTimestamp is a timestamp representing the server time when this object was created.
deletion_grace_period_secondsbigintNumber of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set.
deletion_timestamptimestamp with time zoneDeletionTimestamp is RFC 3339 date and time at which this resource will be deleted.
durationbigintDuration contains time.Duration object describing build time.
finalizersjsonbMust be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed.
generate_nametextGenerateName is an optional prefix, used by the server, to generate a unique name only if the Name field has not been provided.
generationbigintA sequence number representing a specific generation of the desired state.
labelsjsonbMap of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services.
log_snippettextIt is the last few lines of the build log. This value is only set for builds that failed.
messagetextMessage is a human-readable message indicating details about why the build has this status.
nametext=Name of the object. Name must be unique within a namespace.
namespacetext=Namespace defines the space within which each name must be unique.
outputjsonbOutput describes the Docker image the build has produced.
output_docker_image_referencetextIt contains a reference to the Docker image that will be built by this build. Its value is computed from Build.Spec.Output.To, and should include the registry address, so that it can be used to push and pull the image.
owner_referencesjsonbList of objects depended by this object. If all objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.
phasetextPhase is the point in the build lifecycle. Possible values are New, Pending, Running, Complete, Failed, Error, and Cancelled.
reasontextReason is a brief CamelCase string that describes any failure and is meant for machine parsing and tidy display in the CLI.
resource_versiontextAn opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
stagesjsonbStages contain details about each stage that occurs during the build including start time, duration (in milliseconds), and the steps that occurred within each stage.
start_timestamptimestamp with time zoneIt is a timestamp representing the server time when this Build started running in a Pod.
titletextTitle of the resource.
triggered_byjsonbIt describes which triggers started the most recent update to the build configuration and contains information about those triggers.
uidtextUID is the unique in time and space value for this object.

Export

This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- openshift

You can pass the configuration to the command with the --config argument:

steampipe_export_openshift --config '<your_config>' openshift_build