Table: openshift_build_config - Query OpenShift Build Configurations using SQL
OpenShift Build Configurations are a key resource in the OpenShift platform that defines the parameters for building an application. They specify the source code repository, the build strategy (Docker, Source-to-Image, or Custom), and the output image. Build Configurations also specify triggers, which cause a new build to be run automatically when certain events occur.
Table Usage Guide
The openshift_build_config
table provides insights into the configuration details of builds within the OpenShift platform. As a DevOps engineer or system administrator, explore build-specific details through this table, including the source code repository, build strategy, output image, and triggers. Utilize it to manage and monitor the build process, ensuring that builds are configured correctly and running as expected.
Examples
Basic info
Explore which OpenShift build configurations have been created and their respective run policies. This can help in understanding the frequency of successful builds, thereby aiding in optimizing the build process.
select uid, name, namespace, run_policy, creation_timestamp, successful_builds_history_limitfrom openshift_build_config;
select uid, name, namespace, run_policy, creation_timestamp, successful_builds_history_limitfrom openshift_build_config;
List build configs present in the default namespace
Explore the build configurations present in the default workspace to understand the build policies, creation times, and history limits of successful builds. This can be useful in managing and optimizing your build processes.
select uid, name, namespace, run_policy, creation_timestamp, successful_builds_history_limitfrom openshift_build_configwhere namespace = 'default';
select uid, name, namespace, run_policy, creation_timestamp, successful_builds_history_limitfrom openshift_build_configwhere namespace = 'default';
List build configs with default run policy
Explore which build configurations are using the default 'Serial' run policy. This can help in managing and optimizing build processes in an OpenShift environment.
select uid, name, namespace, run_policy, creation_timestamp, successful_builds_history_limitfrom openshift_build_configwhere run_policy = 'Serial';
select uid, name, namespace, run_policy, creation_timestamp, successful_builds_history_limitfrom openshift_build_configwhere run_policy = 'Serial';
List build configs created in the last 30 days
Explore the recently created build configurations to understand their run policies and success rates. This can help assess the efficiency of your configurations and identify areas for improvement.
select uid, name, namespace, run_policy, creation_timestamp, successful_builds_history_limitfrom openshift_build_configwhere creation_timestamp >= now() - interval '30' day;
select uid, name, namespace, run_policy, creation_timestamp, successful_builds_history_limitfrom openshift_build_configwhere creation_timestamp >= datetime('now', '-30 day');
List common specs of the build configs
Discover the common specifications of your build configurations in OpenShift to better understand and manage your application's build process. This can be particularly useful for identifying potential areas of optimization or troubleshooting issues.
select uid, name, namespace, jsonb_pretty(common_spec) as common_specfrom openshift_build_config;
select uid, name, namespace, common_specfrom openshift_build_config;
Get triggers of the build configs
Explore which build configurations in your Openshift environment have triggers set up. This can help you understand and manage automated build processes in your system.
select uid, name, namespace, jsonb_pretty(triggers) as triggersfrom openshift_build_config;
select uid, name, namespace, triggersfrom openshift_build_config;
List builds associated with a particular build config
Explore which builds are linked to a specific configuration to understand their performance and status. This is beneficial for assessing the efficiency of different configurations and identifying any potential issues.
select b.uid, b.name, b.namespace, b.start_timestamp, b.reason, b.phase, b.cancelled, b.duration, b.completion_timestampfrom openshift_build as b, jsonb_array_elements(owner_references) as ref, openshift_build_config as cwhere ref ->> 'uid' = c.uid and c.name = 'config_name';
select b.uid, b.name, b.namespace, b.start_timestamp, b.reason, b.phase, b.cancelled, b.duration, b.completion_timestampfrom openshift_build as b, json_each(b.owner_references) as ref, openshift_build_config as cwhere json_extract(ref.value, '$.uid') = c.uid and c.name = 'config_name';
Schema for openshift_build_config
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
annotations | jsonb | Annotations is an unstructured key-value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. | |
common_spec | jsonb | CommonSpec is the desired build specification. | |
creation_timestamp | timestamp with time zone | CreationTimestamp is a timestamp representing the server time when this object was created. | |
deletion_grace_period_seconds | bigint | Number 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_timestamp | timestamp with time zone | DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. | |
failed_builds_history_limit | bigint | It is the number of old failed builds to retain. If not specified, all failed builds are retained. | |
finalizers | jsonb | Must 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_name | text | GenerateName is an optional prefix, used by the server, to generate a unique name only if the Name field has not been provided. | |
generation | bigint | A sequence number representing a specific generation of the desired state. | |
image_change_triggers | jsonb | ImageChangeTriggers captures the runtime state of any ImageChangeTrigger specified in the BuildConfigSpec, including the value reconciled by the OpenShift APIServer for the lastTriggeredImageID. | |
labels | jsonb | Map 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. | |
last_version | bigint | Last version is used to inform about the number of last triggered builds. | |
name | text | = | Name of the object. Name must be unique within a namespace. |
namespace | text | = | Namespace defines the space within which each name must be unique. |
owner_references | jsonb | List 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. | |
resource_version | text | An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. | |
run_policy | text | RunPolicy describes how the new build created from this build configuration will be scheduled for execution. This is optional, if not specified we default to Serial. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
successful_builds_history_limit | bigint | It is the number of old successful builds to retain. If not specified, all successful builds are retained. | |
title | text | Title of the resource. | |
triggers | jsonb | Triggers determine how new Builds can be launched from a BuildConfig. If no triggers are defined, a new build can only occur as a result of an explicit client build creation. | |
uid | text | UID 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_config