helm_charthelm_releasehelm_templatehelm_template_renderedhelm_valuekubernetes_cluster_rolekubernetes_cluster_role_bindingkubernetes_config_mapkubernetes_cronjobkubernetes_custom_resource_definitionkubernetes_daemonsetkubernetes_deploymentkubernetes_endpointkubernetes_endpoint_slicekubernetes_eventkubernetes_horizontal_pod_autoscalerkubernetes_ingresskubernetes_jobkubernetes_limit_rangekubernetes_namespacekubernetes_network_policykubernetes_nodekubernetes_persistent_volumekubernetes_persistent_volume_claimkubernetes_podkubernetes_pod_disruption_budgetkubernetes_pod_security_policykubernetes_pod_templatekubernetes_replicasetkubernetes_replication_controllerkubernetes_resource_quotakubernetes_rolekubernetes_role_bindingkubernetes_secretkubernetes_servicekubernetes_service_accountkubernetes_stateful_setkubernetes_storage_classkubernetes_{custom_resource_singular_name}
Table: kubernetes_replicaset
A ReplicaSet's purpose is to maintain a stable set of replica Pods running at any given time. As such, it is often used to guarantee the availability of a specified number of identical Pods.
Examples
Basic Info
select name, namespace, replicas as desired, ready_replicas as ready, available_replicas as available, selector, fully_labeled_replicas, age(current_timestamp, creation_timestamp)from kubernetes_replicaset;
Get container and image used in the replicaset
select name, namespace, c ->> 'name' as container_name, c ->> 'image' as imagefrom kubernetes_replicaset, jsonb_array_elements(template -> 'spec' -> 'containers') as corder by namespace, name;
List pods for a replicaset (by name)
select pod.namespace, rs.name as replicaset_name, pod.name as pod_name, pod.phase, age(current_timestamp, pod.creation_timestamp), pod.pod_ip, pod.node_namefrom kubernetes_pod as pod, jsonb_array_elements(pod.owner_references) as pod_owner, kubernetes_replicaset as rswhere pod_owner ->> 'kind' = 'ReplicaSet' and rs.uid = pod_owner ->> 'uid' and rs.name = 'frontend-56fc5b6b47'order by pod.namespace, rs.name, pod.name;
List manifest resources
select name, namespace, replicas as desired, ready_replicas as ready, available_replicas as available, selector, fully_labeled_replicas, pathfrom kubernetes_replicasetwhere path is not null;
Query examples
- cluster_repliasets_count
- containers_for_deployment
- deployment_pods_detail
- deployment_replicasets_detail
- deployment_tree
- deployments_for_pod
- deployments_for_replicaset
- deployments_for_service
- namespace_replicaset_count
- namespace_replicaset_table
- nodes_for_deployment
- pods_for_deployment
- replicaset_1_year_count
- replicaset_24_hours_count
- replicaset_30_90_days_count
- replicaset_30_days_count
- replicaset_90_365_days_count
- replicaset_age_table
- replicaset_annotations
- replicaset_by_context
- replicaset_by_context_name
- replicaset_by_creation_month
- replicaset_by_namespace
- replicaset_container_host_ipc
- replicaset_container_host_ipc_count
- replicaset_container_host_network
- replicaset_container_host_network_count
- replicaset_container_host_pid
- replicaset_container_host_pid_count
- replicaset_count
- replicaset_default_namespace
- replicaset_default_namespace_count
- replicaset_host_table
- replicaset_input
- replicaset_labels
- replicaset_overview
- replicaset_tree
- replicasets_for_deployment
- replicasets_for_namespace
- services_for_deployment
.inspect kubernetes_replicaset
Kubernetes replica set ensures that a specified number of pod replicas are running at any given time.
Name | Type | Description |
---|---|---|
_ctx | jsonb | Steampipe context in JSON form, e.g. connection_name. |
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. |
available_replicas | bigint | The number of available replicas (ready for at least minReadySeconds) for this replica set. |
conditions | jsonb | Represents the latest available observations of a replica set's current state. |
context_name | text | Kubectl config context name. |
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. |
end_line | bigint | The path to the manifest file. |
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. |
fully_labeled_replicas | bigint | The number of pods that have labels matching the labels of the pod template of the replicaset. |
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. |
min_ready_seconds | bigint | Minimum number of seconds for which a newly created pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 |
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. |
observed_generation | bigint | ObservedGeneration reflects the generation of the most recently observed ReplicaSet. |
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 | The path to the manifest file. |
ready_replicas | bigint | The number of ready replicas for this replica set. |
replicas | bigint | Replicas is the number of desired replicas. Defaults to 1. |
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. |
selector | jsonb | Selector is a label query over pods that should match the replica count. Label keys and values that must match in order to be controlled by this replica set. |
selector_query | text | A query string representation of the selector. |
source_type | text | The source of the resource. Possible values are: deployed and manifest. If the resource is fetched from the spec file the value will be manifest. |
start_line | bigint | The path to the manifest file. |
status_replicas | bigint | The most recently oberved number of replicas. |
tags | jsonb | A map of tags for the resource. This includes both labels and annotations. |
template | jsonb | Template is the object that describes the pod that will be created if insufficient replicas are detected. |
title | text | Title of the resource. |
uid | text | UID is the unique in time and space value for this object. |