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_job
A Job creates one or more Pods and will continue to retry execution of the Pods until a specified number of them successfully terminate.
Examples
Basic Info
select name, namespace, active, succeeded, failed, completions, start_time, completion_time, age( coalesce(completion_time, current_timestamp), start_time ) as duration, active_deadline_seconds, parallelism, selector, labels, annotationsfrom kubernetes_job;
List active jobs
select name, namespace, start_time, age( coalesce(completion_time, current_timestamp), start_time ) as duration, active, succeeded, failedfrom kubernetes_jobwhere active > 0;
List failed jobs
select name, namespace, start_time, age( coalesce(completion_time, current_timestamp), start_time ) as duration, active, succeeded, failedfrom kubernetes_jobwhere failed > 0;
Get list of container and images for jobs
select name, namespace, jsonb_agg(elems.value -> 'name') as containers, jsonb_agg(elems.value -> 'image') as imagesfrom kubernetes_job, jsonb_array_elements(template -> 'spec' -> 'containers') as elemsgroup by name, namespace;
List manifest resources
select name, namespace, active, succeeded, failed, completions, parallelism, selector, labels, annotations, pathfrom kubernetes_jobwhere path is not null;
Query examples
- cluster_jobs_count
- containers_for_cronjob
- containers_for_job
- cronjob_jobs_detail
- cronjob_pods_detail
- cronjob_tree
- cronjobs_for_job
- job_1_year_count
- job_24_hours_count
- job_30_90_days_count
- job_30_days_count
- job_90_365_days_count
- job_age_table
- job_annotations
- job_by_context
- job_by_context_name
- job_by_creation_month
- job_by_namespace
- job_container_host_ipc
- job_container_host_ipc_count
- job_container_host_network
- job_container_host_network_count
- job_container_host_pid
- job_container_host_pid_count
- job_count
- job_default_namespace
- job_default_namespace_count
- job_host_table
- job_input
- job_labels
- job_overview
- job_tree
- jobs_for_cronjob
- jobs_for_namespace
- jobs_for_pod
- nodes_for_cronjob
- nodes_for_job
- pods_for_cronjob
- pods_for_job
.inspect kubernetes_job
A Job creates one or more Pods and will continue to retry execution of the Pods until a specified number of them successfully terminate.
Name | Type | Description |
---|---|---|
_ctx | jsonb | Steampipe context in JSON form, e.g. connection_name. |
active | bigint | The number of actively running pods. |
active_deadline_seconds | bigint | The duration in seconds relative to the startTime that the job may be active before the system tries to terminate it. |
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. |
backoff_limit | bigint | The number of retries before marking this job failed. Defaults to 6. |
completion_time | timestamp with time zone | Time when the job was completed. |
completions | bigint | The desired number of successfully finished pods the job should be run with. |
conditions | jsonb | The latest available observations of an object'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. |
failed | bigint | The number of pods which reached phase Failed. |
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. |
manual_selector | boolean | ManualSelector controls generation of pod labels and pod selectors. When false or unset, the system pick labels unique to this job and appends those labels to the pod template. When true, the user is responsible for picking unique labels and specifying the selector. |
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. |
parallelism | bigint | The maximum desired number of pods the job should run at any given time. The actual number of pods running in steady state will be less than this number when ((.spec.completions - .status.successful) < .spec.parallelism), i.e. when the work left to do is less than max parallelism. |
path | text | The path to the manifest file. |
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 | A label query over pods that should match the pod count. |
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. |
start_time | timestamp with time zone | Time when the job was acknowledged by the job controller. |
succeeded | bigint | The number of pods which reached phase Succeeded. |
tags | jsonb | A map of tags for the resource. This includes both labels and annotations. |
template | jsonb | Describes the pod that will be created when executing a job. |
title | text | Title of the resource. |
ttl_seconds_after_finished | bigint | limits the lifetime of a Job that has finished execution (either Complete or Failed). If this field is set, ttlSecondsAfterFinished after the Job finishes, it is eligible to be automatically deleted. |
uid | text | UID is the unique in time and space value for this object. |