Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
335 changes: 149 additions & 186 deletions README.md

Large diffs are not rendered by default.

527 changes: 527 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"dependencies": {
"@stackql/pgwire-lite": "^1.0.1",
"@stackql/provider-utils": "^0.4.6"
"@stackql/provider-utils": "^0.5.0"
},
"keywords": [
"stackql",
Expand Down
Empty file removed website/docs/.gitkeep
Empty file.
122 changes: 122 additions & 0 deletions website/docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
---
title: k8s
hide_title: false
hide_table_of_contents: false
keywords:
- k8s
- stackql
- infrastructure-as-code
- configuration-as-data
- cloud inventory
description: Query, deploy and manage Kubernetes resources using SQL
custom_edit_url: null
image: /img/stackql-k8s-provider-featured-image.png
id: 'provider-intro'
---

import CopyableCode from '@site/src/components/CopyableCode/CopyableCode';

Open source container management platform.

:::info Provider Summary (v23.03.00121)

<div class="row">
<div class="providerDocColumn">
<span>total services:&nbsp;<b>5</b></span><br />
<span>total methods:&nbsp;<b>267</b></span><br />
</div>
<div class="providerDocColumn">
<span>total resources:&nbsp;<b>33</b></span><br />
<span>total selectable resources:&nbsp;<b>24</b></span><br />
</div>
</div>

:::

See also:
[[` SHOW `]](https://stackql.io/docs/language-spec/show) [[` DESCRIBE `]](https://stackql.io/docs/language-spec/describe) [[` REGISTRY `]](https://stackql.io/docs/language-spec/registry)
* * *

## Installation

To pull the latest version of the `k8s` provider, run the following command:

```bash
REGISTRY PULL k8s;
```
> To view previous provider versions or to pull a specific provider version, see [here](https://stackql.io/docs/language-spec/registry).

## Authentication


:::note

<b><CopyableCode code="cluster_addr" /></b> is a required parameter for all operations using the <code>k8s</code> provider, for example:

```sql
SELECT name, namespace, uid, creationTimestamp
FROM k8s.core_v1.service_account
WHERE cluster_addr = '35.244.65.136' AND namespace = 'kube-system'
ORDER BY name ASC;
```
:::

### Example using `kubectl proxy`
`kubectl proxy` is the default authentication method for the `k8s` provider, no other variables or configuration is necessary to query the `k8s` provider if you are using this method.

:::note

The <CopyableCode code="protocol" /> parameter is required when accessing a Kubernetes cluster via `kubectl proxy`, see the example below:

```sql
select name, namespace, uid, creationTimestamp
from k8s.core_v1.pod
where protocol = 'http'
and cluster_addr = 'localhost:8080'
order by name asc limit 3;
```
:::

### Example using direct cluster access
If you are using an access token to access the `k8s` API, follow the instructions below (use `exec` instead of `shell` for non interactive operations):

```bash
export K8S_TOKEN='eyJhbGciOiJ...'
AUTH='{ "k8s": { "type": "bearer", "credentialsenvvar": "K8S_TOKEN" } }'
stackql shell --auth="${AUTH}" --tls.CABundle k8s_cert_bundle.pem
```
:::note

You will need to generate a certificate bundle for your cluster (`k8s_cert_bundle.pem` in the preceeding example), you can use the following code to generate this (for MacOS or Linux):

```bash
kubectl get secret -o jsonpath="{.items[?(@.type=="kubernetes.io/service-account-token")].data['ca\.crt']}" | base64 -i --decode > k8s_cert_bundle.pem
```

Alternatively, you could add the <CopyableCode code="--tls.allowInsecure=true" /> argument to the `stackql` command, it is not recommended however.

:::


## Server Parameters


The following parameters may be required for the `k8s` provider:

- <CopyableCode code="protocol" /> - <code>https</code> or <code>http</code> (default: <code>https</code>)
- <CopyableCode code="cluster_addr" /> - The hostname of the Kubernetes cluster (default: <code>localhost</code>)

This parameter would be supplied to the `WHERE` clause of each `SELECT` statement.

## Services
<div class="row">
<div class="providerDocColumn">
<a href="/services/admissionregistration/">admissionregistration</a><br />
<a href="/services/admissionregistration_v1/">admissionregistration_v1</a><br />
<a href="/services/apiextensions/">apiextensions</a><br />
</div>
<div class="providerDocColumn">
<a href="/services/core/">core</a><br />
<a href="/services/core_v1/">core_v1</a><br />
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
title: admissionregistration
hide_title: false
hide_table_of_contents: false
keywords:
- admissionregistration
- admissionregistration
- k8s
- stackql
- infrastructure-as-code
- configuration-as-data
- cloud inventory
description: Query, deploy and manage Kubernetes resources using SQL
custom_edit_url: null
image: /img/services/stackql-k8s-provider-featured-image.png
---

import CopyableCode from '@site/src/components/CopyableCode/CopyableCode';




## Overview
<table><tbody>
<tr><td><b>Name</b></td><td><code>admissionregistration</code></td></tr>
<tr><td><b>Type</b></td><td>Resource</td></tr>
<tr><td><b>Id</b></td><td><CopyableCode code="k8s.admissionregistration.admissionregistration" /></td></tr>
</tbody></table>

## Fields
| Name | Datatype | Description |
|:-----|:---------|:------------|
| <CopyableCode code="name" /> | `string` | name is the name of the group. |
| <CopyableCode code="apiVersion" /> | `string` | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources |
| <CopyableCode code="kind" /> | `string` | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds |
| <CopyableCode code="preferredVersion" /> | `object` | GroupVersion contains the "group/version" and "version" string of a version. It is made a struct to keep extensibility. |
| <CopyableCode code="serverAddressByClientCIDRs" /> | `array` | a map of client CIDR to server address that is serving this group. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR. The server returns only those CIDRs that it thinks that the client can match. For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP. |
| <CopyableCode code="versions" /> | `array` | versions are the versions supported in this group. |
## Methods
| Name | Accessible by | Required Params |
|:-----|:--------------|:----------------|
| <CopyableCode code="getAdmissionregistrationAPIGroup" /> | `SELECT` | <CopyableCode code="cluster_addr, protocol" /> |
47 changes: 47 additions & 0 deletions website/docs/services/admissionregistration/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
title: admissionregistration
hide_title: false
hide_table_of_contents: false
keywords:
- admissionregistration
- k8s
- stackql
- infrastructure-as-code
- configuration-as-data
- cloud inventory
description: Query, deploy and manage Kubernetes resources using SQL
custom_edit_url: null
image: /img/services/stackql-k8s-provider-featured-image.png
---

admission registration api

:::info Service Summary

<div class="row">
<div class="providerDocColumn">
<span>total resources:&nbsp;<b>1</b></span><br />
<span>total selectable resources:&nbsp;<b>1</b></span><br />
<span>total methods:&nbsp;<b>1</b></span><br />
</div>
</div>

:::

## Overview
<table><tbody>
<tr><td><b>Name</b></td><td><code>k8s.admissionregistration</code></td></tr>
<tr><td><b>Type</b></td><td>Service</td></tr>
<tr><td><b>Title</b></td><td>Kubernetes - admissionregistration</td></tr>
<tr><td><b>Description</b></td><td>admission registration api</td></tr>
<tr><td><b>Id</b></td><td><code>admissionregistration:v23.03.00121</code></td></tr>
</tbody></table>

## Resources
<div class="row">
<div class="providerDocColumn">
<a href="/services/admissionregistration/admissionregistration/">admissionregistration</a><br />
</div>
<div class="providerDocColumn">
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
title: admissionregistration_v1
hide_title: false
hide_table_of_contents: false
keywords:
- admissionregistration_v1
- admissionregistration_v1
- k8s
- stackql
- infrastructure-as-code
- configuration-as-data
- cloud inventory
description: Query, deploy and manage Kubernetes resources using SQL
custom_edit_url: null
image: /img/services/stackql-k8s-provider-featured-image.png
---

import CopyableCode from '@site/src/components/CopyableCode/CopyableCode';




## Overview
<table><tbody>
<tr><td><b>Name</b></td><td><code>admissionregistration_v1</code></td></tr>
<tr><td><b>Type</b></td><td>Resource</td></tr>
<tr><td><b>Id</b></td><td><CopyableCode code="k8s.admissionregistration_v1.admissionregistration_v1" /></td></tr>
</tbody></table>

## Fields
| Name | Datatype | Description |
|:-----|:---------|:------------|
| <CopyableCode code="apiVersion" /> | `string` | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources |
| <CopyableCode code="groupVersion" /> | `string` | groupVersion is the group and version this APIResourceList is for. |
| <CopyableCode code="kind" /> | `string` | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds |
| <CopyableCode code="resources" /> | `array` | resources contains the name of the resources and if they are namespaced. |
## Methods
| Name | Accessible by | Required Params |
|:-----|:--------------|:----------------|
| <CopyableCode code="getAdmissionregistrationV1APIResources" /> | `SELECT` | <CopyableCode code="cluster_addr, protocol" /> |
49 changes: 49 additions & 0 deletions website/docs/services/admissionregistration_v1/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
title: admissionregistration_v1
hide_title: false
hide_table_of_contents: false
keywords:
- admissionregistration_v1
- k8s
- stackql
- infrastructure-as-code
- configuration-as-data
- cloud inventory
description: Query, deploy and manage Kubernetes resources using SQL
custom_edit_url: null
image: /img/services/stackql-k8s-provider-featured-image.png
---

admissionregistration_v1

:::info Service Summary

<div class="row">
<div class="providerDocColumn">
<span>total resources:&nbsp;<b>3</b></span><br />
<span>total selectable resources:&nbsp;<b>3</b></span><br />
<span>total methods:&nbsp;<b>19</b></span><br />
</div>
</div>

:::

## Overview
<table><tbody>
<tr><td><b>Name</b></td><td><code>k8s.admissionregistration_v1</code></td></tr>
<tr><td><b>Type</b></td><td>Service</td></tr>
<tr><td><b>Title</b></td><td>Kubernetes - admissionregistration_v1</td></tr>
<tr><td><b>Description</b></td><td>admissionregistration_v1</td></tr>
<tr><td><b>Id</b></td><td><code>admissionregistration_v1:v23.03.00121</code></td></tr>
</tbody></table>

## Resources
<div class="row">
<div class="providerDocColumn">
<a href="/services/admissionregistration_v1/admissionregistration_v1/">admissionregistration_v1</a><br />
<a href="/services/admissionregistration_v1/mutating_webhook_configuration/">mutating_webhook_configuration</a><br />
</div>
<div class="providerDocColumn">
<a href="/services/admissionregistration_v1/validating_webhook_configuration/">validating_webhook_configuration</a><br />
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
title: mutating_webhook_configuration
hide_title: false
hide_table_of_contents: false
keywords:
- mutating_webhook_configuration
- admissionregistration_v1
- k8s
- stackql
- infrastructure-as-code
- configuration-as-data
- cloud inventory
description: Query, deploy and manage Kubernetes resources using SQL
custom_edit_url: null
image: /img/services/stackql-k8s-provider-featured-image.png
---

import CopyableCode from '@site/src/components/CopyableCode/CopyableCode';




## Overview
<table><tbody>
<tr><td><b>Name</b></td><td><code>mutating_webhook_configuration</code></td></tr>
<tr><td><b>Type</b></td><td>Resource</td></tr>
<tr><td><b>Id</b></td><td><CopyableCode code="k8s.admissionregistration_v1.mutating_webhook_configuration" /></td></tr>
</tbody></table>

## Fields
| Name | Datatype | Description |
|:-----|:---------|:------------|
| <CopyableCode code="apiVersion" /> | `string` | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources |
| <CopyableCode code="kind" /> | `string` | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds |
| <CopyableCode code="metadata" /> | `object` | ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create. |
| <CopyableCode code="webhooks" /> | `array` | Webhooks is a list of webhooks and the affected resources and operations. |
## Methods
| Name | Accessible by | Required Params | Description |
|:-----|:--------------|:----------------|:------------|
| <CopyableCode code="listAdmissionregistrationV1MutatingWebhookConfiguration" /> | `SELECT` | <CopyableCode code="cluster_addr, protocol" /> | list or watch objects of kind MutatingWebhookConfiguration |
| <CopyableCode code="readAdmissionregistrationV1MutatingWebhookConfiguration" /> | `SELECT` | <CopyableCode code="name, cluster_addr, protocol" /> | read the specified MutatingWebhookConfiguration |
| <CopyableCode code="createAdmissionregistrationV1MutatingWebhookConfiguration" /> | `INSERT` | <CopyableCode code="cluster_addr, protocol" /> | create a MutatingWebhookConfiguration |
| <CopyableCode code="deleteAdmissionregistrationV1CollectionMutatingWebhookConfiguration" /> | `DELETE` | <CopyableCode code="cluster_addr, protocol" /> | delete collection of MutatingWebhookConfiguration |
| <CopyableCode code="deleteAdmissionregistrationV1MutatingWebhookConfiguration" /> | `DELETE` | <CopyableCode code="name, cluster_addr, protocol" /> | delete a MutatingWebhookConfiguration |
| <CopyableCode code="patchAdmissionregistrationV1MutatingWebhookConfiguration" /> | `EXEC` | <CopyableCode code="name, cluster_addr, protocol" /> | partially update the specified MutatingWebhookConfiguration |
| <CopyableCode code="replaceAdmissionregistrationV1MutatingWebhookConfiguration" /> | `EXEC` | <CopyableCode code="name, cluster_addr, protocol" /> | replace the specified MutatingWebhookConfiguration |
| <CopyableCode code="watchAdmissionregistrationV1MutatingWebhookConfiguration" /> | `EXEC` | <CopyableCode code="name, cluster_addr, protocol" /> | watch changes to an object of kind MutatingWebhookConfiguration. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter. |
| <CopyableCode code="watchAdmissionregistrationV1MutatingWebhookConfigurationList" /> | `EXEC` | <CopyableCode code="cluster_addr, protocol" /> | watch individual changes to a list of MutatingWebhookConfiguration. deprecated: use the 'watch' parameter with a list operation instead. |
Loading
Loading