Table: consul_service - Query OCI Consul Services using SQL
Consul is a service networking solution to connect and secure services across any runtime platform and public or private cloud. It provides a full featured control plane with service discovery, configuration, and segmentation functionality. Given that, Consul enables rapid deployment, configuration, and maintenance of service-oriented architectures at a massive scale.
Table Usage Guide
The consul_service
table provides insights into Consul Services within Oracle Cloud Infrastructure (OCI). As a network administrator, explore service-specific details through this table, including service configurations, status, and associated metadata. Utilize it to uncover information about services, such as those with specific configurations, the relationships between services, and the verification of service status.
Examples
Basic info
Explore the various services within your network infrastructure to identify their associated data centers and namespaces. This can help you better understand the overall structure and organization of your services, which is useful in managing and optimizing your network resources.
select id, node, address, datacenter, service_id, service_name, namespacefrom consul_service;
select id, node, address, datacenter, service_id, service_name, namespacefrom consul_service;
List services present in default namespace
Explore which services are present in the default namespace. This can help in understanding the configuration and organization of your services, and identify any areas for optimization or restructuring.
select id, node, address, datacenter, service_id, service_name, namespacefrom consul_servicewhere namespace = 'default';
select id, node, address, datacenter, service_id, service_name, namespacefrom consul_servicewhere namespace = 'default';
List services which are not associated with any health checks
Uncover the details of services that are not linked with any health checks. This can be useful for identifying potential vulnerabilities in your system, as these services may not be monitored for issues or failures.
select id, node, address, datacenter, service_id, service_name, namespacefrom consul_servicewhere checks is null;
select id, node, address, datacenter, service_id, service_name, namespacefrom consul_servicewhere checks is null;
List services with a specific tag
Explore which services are associated with a specific tag to better manage and organize your resources. This can be particularly useful for identifying patterns or issues related to a specific service category.
select id, node, address, datacenter, service_id, service_name, namespacefrom consul_servicewhere service_tag = 'http';
select id, node, address, datacenter, service_id, service_name, namespacefrom consul_servicewhere service_tag = 'http';
List services running in a specific node
Explore which services are actively running within a specific node for effective management and monitoring. This is particularly useful for identifying any potential issues or inconsistencies within your network infrastructure.
select id, node, address, datacenter, service_id, service_name, namespacefrom consul_servicewhere node = 'ip-172-25-34-191';
select id, node, address, datacenter, service_id, service_name, namespacefrom consul_servicewhere node = 'ip-172-25-34-191';
List services where service tags can be overridden
Explore which services allow for tag overrides, useful for identifying areas where service tagging behavior can be customized to suit specific requirements. This can be beneficial in managing and organizing your services more effectively.
select id, node, address, datacenter, service_id, service_name, namespacefrom consul_servicewhere service_enable_tag_override;
select id, node, address, datacenter, service_id, service_name, namespacefrom consul_servicewhere service_enable_tag_override = 1;
Schema for consul_service
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form, e.g. connection_name. | |
address | text | The IP address or hostname of the service. | |
checks | jsonb | The health checks associated with the service. | |
create_index | bigint | The index of the create operation that created the service. | |
datacenter | text | The datacenter where the service is running. | |
id | text | A unique identifier for the service. | |
modify_index | bigint | The index of the last modify operation that modified the service. | |
namespace | text | = | The namespace of the service. |
node | text | The name of the node where the service is running. | |
node_meta | jsonb | A map of metadata associated with the node where the service is running. | |
partition | text | The partition of the service. | |
service_address | text | The IP address or hostname of the service instance. | |
service_enable_tag_override | boolean | A boolean indicating whether service tags can be overridden. | |
service_id | text | The unique identifier for the service instance. | |
service_meta | jsonb | A map of metadata associated with the service. | |
service_name | text | = | The name of the service. |
service_port | bigint | The port on which the service instance is listening. | |
service_proxy | jsonb | The proxy configuration for the service. | |
service_tag | text | The service tag. | |
service_tagged_addresses | jsonb | A map of service tags to service addresses. | |
service_weights | jsonb | The weights associated with the service. | |
tagged_addresses | jsonb | A map of service tags to IP addresses or hostnames. | |
title | text | The title of the service. |
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)" -- consul
You can pass the configuration to the command with the --config
argument:
steampipe_export_consul --config '<your_config>' consul_service