Table: openshift_project - Query OpenShift Projects using SQL
OpenShift Projects are a top-level scope for managing and organizing resources in an OpenShift cluster. They provide a logical, hierarchical organization for a set of resources and users. Projects are essentially Kubernetes namespaces with additional annotations, providing a unique scope for objects such as pods, services, and replication controllers.
Table Usage Guide
The openshift_project
table provides insights into Projects within OpenShift. As a DevOps engineer or system administrator, explore project-specific details through this table, including metadata, status, and specifications. Utilize it to uncover information about projects, such as those with specific resource quotas, role bindings, and service accounts, aiding in the management and organization of your OpenShift cluster.
Examples
Basic info
select uid, name, resource_version, phase, creation_timestamp, deletion_grace_period_seconds, generate_namefrom openshift_project;
select uid, name, resource_version, phase, creation_timestamp, deletion_grace_period_seconds, generate_namefrom openshift_project;
List inactive projects
select uid, name, resource_version, phase, creation_timestamp, deletion_grace_period_seconds, generate_namefrom openshift_projectwhere phase <> 'Active';
select uid, name, resource_version, phase, creation_timestamp, deletion_grace_period_seconds, generate_namefrom openshift_projectwhere phase <> 'Active';
List projects created in the last 30 days
select uid, name, resource_version, phase, creation_timestamp, deletion_grace_period_seconds, generate_namefrom openshift_projectwhere creation_timestamp >= now() - interval '30' day;
select uid, name, resource_version, phase, creation_timestamp, deletion_grace_period_seconds, generate_namefrom openshift_projectwhere creation_timestamp >= datetime('now', '-30 day');
List deleted projects
select uid, name, resource_version, phase, creation_timestamp, deletion_grace_period_seconds, generate_namefrom openshift_projectwhere deletion_timestamp is not null;
select uid, name, resource_version, phase, creation_timestamp, deletion_grace_period_seconds, generate_namefrom openshift_projectwhere deletion_timestamp is not null;
Get project annotations
select uid, name, phase, creation_timestamp, jsonb_pretty(annotations) as annotationsfrom openshift_project;
select uid, name, phase, creation_timestamp, annotationsfrom openshift_project;
Get project labels
select uid, name, phase, creation_timestamp, jsonb_pretty(labels) as labelsfrom openshift_project;
select uid, name, phase, creation_timestamp, labelsfrom openshift_project;
Schema for openshift_project
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. | |
conditions | jsonb | Represents the latest available observations of the project's current state. | |
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. | |
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. | |
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. | |
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. | |
phase | text | Phase is the current lifecycle phase of the project. | |
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. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
spec_finalizers | jsonb | Finalizers is an opaque list of values that must be empty to permanently remove an object from storage. | |
title | text | Title of the resource. | |
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_project