turbot/kubernetes
steampipe plugin install kubernetes

Table: helm_template_rendered - Query Kubernetes Helm Templates using SQL

A Helm Template in Kubernetes is a powerful tool that generates Kubernetes manifest files. It is a part of Helm, the package manager for Kubernetes, and is used to streamline the installation and management of applications within Kubernetes clusters. Helm Templates allow users to define, install, and upgrade complex Kubernetes applications, effectively serving as a deployment blueprint.

Table Usage Guide

The helm_template_rendered table provides insights into Helm Templates within Kubernetes. As a DevOps engineer or a Kubernetes administrator, explore the details of rendered templates through this table, including the configuration and deployment of applications within Kubernetes clusters. Utilize it to verify the deployment specifications, understand the configuration of applications, and manage the lifecycle of Kubernetes applications.

Examples

List fully rendered kubernetes resource templates defined in a chart

Explore the fully processed resource templates within a specific Kubernetes chart to understand its configuration. This is useful for assessing the elements within a given chart, such as 'redis', for effective management and troubleshooting.

select
path,
source_type,
rendered
from
helm_template_rendered
where
chart_name = 'redis';
select
path,
source_type,
rendered
from
helm_template_rendered
where
chart_name = 'redis';

List fully rendered kubernetes resource templates for different environments

Explore the fully rendered resource templates for different environments in Kubernetes. This is useful to understand the configuration for specific applications in development and production environments. Let's say you have two different environments for maintaining your app: dev and prod. And, you have a helm chart with 2 different set of values for your environments. For example:

connection "kubernetes" {
plugin = "kubernetes"
helm_rendered_charts = {
"my-app-dev" = {
chart_path = "~/charts/my-app"
values_file_paths = ["~/value/file/for/dev.yaml"]
}
"my-app-prod" = {
chart_path = "~/charts/my-app"
values_file_paths = ["~/value/file/for/prod.yaml"]
}
}
}

In both case, it is using same chart with a different set of values.

To list the kubernetes resource configurations defined for the dev environment, you can simply run the below query:

select
chart_name,
path,
source_type,
rendered
from
helm_template_rendered
where
source_type = 'helm_rendered:my-app-dev';
select
chart_name,
path,
source_type,
rendered
from
helm_template_rendered
where
source_type = 'helm_rendered:my-app-dev';

Similarly, to query the kubernetes resource configurations for prod,

select
chart_name,
path,
source_type,
rendered
from
helm_template_rendered
where
source_type = 'helm_rendered:my-app-prod';
select
chart_name,
path,
source_type,
rendered
from
helm_template_rendered
where
source_type = 'helm_rendered:my-app-prod';

Schema for helm_template_rendered

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
chart_nametextThe name of the chart.
pathtextThe path to the template file.
renderedtextRendered is the rendered template as byte data.
source_typetextThe source of the template.
sp_connection_nametextSteampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.

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)" -- kubernetes

You can pass the configuration to the command with the --config argument:

steampipe_export_kubernetes --config '<your_config>' helm_template_rendered