Table: openshift_route - Query OpenShift Routes using SQL
OpenShift Routes is a resource within Red Hat OpenShift that helps expose a service at a host name, like www.example.com, so that external clients can reach it by name. It provides a way to aggregate multiple services under the same IP address and differentiate them with the host name. OpenShift Routes makes it easy to expose services to the internet and manage traffic to your applications.
Table Usage Guide
The openshift_route
table provides insights into the route objects within Red Hat OpenShift. As a DevOps engineer, you can explore route-specific details through this table, including the host, path, and the associated services. Utilize it to manage and monitor the accessibility of your applications, ensuring they are reachable and functioning as expected.
Examples
Basic info
select uid, name, path, host, creation_timestamp, resource_version, namespacefrom openshift_route;
select uid, name, path, host, creation_timestamp, resource_version, namespacefrom openshift_route;
List routes that are present in the default namespace
select uid, name, path, host, creation_timestamp, resource_version, namespacefrom openshift_routewhere namespace = 'default';
select uid, name, path, host, creation_timestamp, resource_version, namespacefrom openshift_routewhere namespace = 'default';
List deleted routes
select uid, name, path, host, creation_timestamp, resource_version, namespacefrom openshift_routewhere deletion_timestamp is not null;
select uid, name, path, host, creation_timestamp, resource_version, namespacefrom openshift_routewhere deletion_timestamp is not null;
List routes ingresses
select uid, name, namespace, jsonb_pretty(ingress) as ingressfrom openshift_route;
select uid, name, namespace, ingressfrom openshift_route;
List routes associated with a particular service
select uid, name, path, host, creation_timestamp, resource_version, namespacefrom openshift_routewhere spec_to ->> 'kind' = 'Service' and spec_to ->> 'name' = 'console';
select uid, name, path, host, creation_timestamp, resource_version, namespacefrom openshift_routewhere json_extract(spec_to, '$.kind') = 'Service' and json_extract(spec_to, '$.name') = 'console';
List routes associated with a particular daemonset
select uid, name, or.path, host, creation_timestamp, resource_version, namespacefrom openshift_route as or, jsonb_array_elements(owner_references) ownerwhere owner ->> 'kind' = 'daemonset' and owner ->> 'name' = 'ingress-canary';
select uid, name, osr.path, host, creation_timestamp, resource_version, namespacefrom openshift_route as osr, json_each(owner_references) as ownerwhere json_extract(owner.value, '$.kind') = 'daemonset' and json_extract(owner.value, '$.name') = 'ingress-canary';
Schema for openshift_route
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
alternate_backends | jsonb | Alternate backends allow up to 3 additional backends to be assigned to the route. Only the Service kind is allowed, and it will be defaulted to Service. Use the weight field in RouteTargetReference object to specify relative preference. | |
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. | |
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. | |
host | text | Host is an alias/DNS that points to the service. Optional. If not specified a route name will typically be automatically chosen. Must follow DNS952 subdomain conventions. | |
ingress | jsonb | Ingress describes the places where the route may be exposed. The list of ingress points may contain duplicate Host or RouterName values. Routes are considered live once they are `Ready`. | |
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. | |
path | text | Path that the router watches for, to route traffic to the service. | |
port | jsonb | If specified, the port to be used by the router. Most routers will use all endpoints exposed by the service by default - set this value to instruct routers which port to use. | |
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_to | jsonb | To is an object the route should use as the primary backend. Only the Service kind is allowed, and it will be defaulted to Service. If the weight field (0-256 default 1) is set to zero, no traffic will be sent to this backend. | |
subdomain | text | Subdomain is a DNS subdomain that is requested within the ingress controller's domain (as a subdomain). If the host is set this field is ignored. An ingress controller may choose to ignore this suggested name, in which case the controller will report the assigned name in the status. | |
title | text | Title of the resource. | |
tls | jsonb | The tls field provides the ability to configure certificates and termination for the route. | |
uid | text | UID is the unique in time and space value for this object. | |
wildcard_policy | text | Wildcard policy if any for the route. Currently only 'Subdomain' or 'None' is allowed. |
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_route