Skip to content

Commit 2fa79eb

Browse files
authored
Merge pull request #1 from stackql/feature/provider-dev
move to microsite
2 parents 7402b0c + 066db87 commit 2fa79eb

File tree

49 files changed

+11693
-189
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+11693
-189
lines changed
File renamed without changes.
File renamed without changes.

README.md

Lines changed: 149 additions & 186 deletions
Large diffs are not rendered by default.

package-lock.json

Lines changed: 527 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
"dependencies": {
1717
"@stackql/pgwire-lite": "^1.0.1",
18-
"@stackql/provider-utils": "^0.4.6"
18+
"@stackql/provider-utils": "^0.5.0"
1919
},
2020
"keywords": [
2121
"stackql",

website/docs/.gitkeep

Whitespace-only changes.

website/docs/index.md

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
---
2+
title: k8s
3+
hide_title: false
4+
hide_table_of_contents: false
5+
keywords:
6+
- k8s
7+
- stackql
8+
- infrastructure-as-code
9+
- configuration-as-data
10+
- cloud inventory
11+
description: Query, deploy and manage Kubernetes resources using SQL
12+
custom_edit_url: null
13+
image: /img/stackql-k8s-provider-featured-image.png
14+
id: 'provider-intro'
15+
---
16+
17+
import CopyableCode from '@site/src/components/CopyableCode/CopyableCode';
18+
19+
Open source container management platform.
20+
21+
:::info Provider Summary (v23.03.00121)
22+
23+
<div class="row">
24+
<div class="providerDocColumn">
25+
<span>total services:&nbsp;<b>5</b></span><br />
26+
<span>total methods:&nbsp;<b>267</b></span><br />
27+
</div>
28+
<div class="providerDocColumn">
29+
<span>total resources:&nbsp;<b>33</b></span><br />
30+
<span>total selectable resources:&nbsp;<b>24</b></span><br />
31+
</div>
32+
</div>
33+
34+
:::
35+
36+
See also:
37+
[[` SHOW `]](https://stackql.io/docs/language-spec/show) [[` DESCRIBE `]](https://stackql.io/docs/language-spec/describe) [[` REGISTRY `]](https://stackql.io/docs/language-spec/registry)
38+
* * *
39+
40+
## Installation
41+
42+
To pull the latest version of the `k8s` provider, run the following command:
43+
44+
```bash
45+
REGISTRY PULL k8s;
46+
```
47+
> To view previous provider versions or to pull a specific provider version, see [here](https://stackql.io/docs/language-spec/registry).
48+
49+
## Authentication
50+
51+
52+
:::note
53+
54+
<b><CopyableCode code="cluster_addr" /></b> is a required parameter for all operations using the <code>k8s</code> provider, for example:
55+
56+
```sql
57+
SELECT name, namespace, uid, creationTimestamp
58+
FROM k8s.core_v1.service_account
59+
WHERE cluster_addr = '35.244.65.136' AND namespace = 'kube-system'
60+
ORDER BY name ASC;
61+
```
62+
:::
63+
64+
### Example using `kubectl proxy`
65+
`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.
66+
67+
:::note
68+
69+
The <CopyableCode code="protocol" /> parameter is required when accessing a Kubernetes cluster via `kubectl proxy`, see the example below:
70+
71+
```sql
72+
select name, namespace, uid, creationTimestamp
73+
from k8s.core_v1.pod
74+
where protocol = 'http'
75+
and cluster_addr = 'localhost:8080'
76+
order by name asc limit 3;
77+
```
78+
:::
79+
80+
### Example using direct cluster access
81+
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):
82+
83+
```bash
84+
export K8S_TOKEN='eyJhbGciOiJ...'
85+
AUTH='{ "k8s": { "type": "bearer", "credentialsenvvar": "K8S_TOKEN" } }'
86+
stackql shell --auth="${AUTH}" --tls.CABundle k8s_cert_bundle.pem
87+
```
88+
:::note
89+
90+
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):
91+
92+
```bash
93+
kubectl get secret -o jsonpath="{.items[?(@.type=="kubernetes.io/service-account-token")].data['ca\.crt']}" | base64 -i --decode > k8s_cert_bundle.pem
94+
```
95+
96+
Alternatively, you could add the <CopyableCode code="--tls.allowInsecure=true" /> argument to the `stackql` command, it is not recommended however.
97+
98+
:::
99+
100+
101+
## Server Parameters
102+
103+
104+
The following parameters may be required for the `k8s` provider:
105+
106+
- <CopyableCode code="protocol" /> - <code>https</code> or <code>http</code> (default: <code>https</code>)
107+
- <CopyableCode code="cluster_addr" /> - The hostname of the Kubernetes cluster (default: <code>localhost</code>)
108+
109+
This parameter would be supplied to the `WHERE` clause of each `SELECT` statement.
110+
111+
## Services
112+
<div class="row">
113+
<div class="providerDocColumn">
114+
<a href="/services/admissionregistration/">admissionregistration</a><br />
115+
<a href="/services/admissionregistration_v1/">admissionregistration_v1</a><br />
116+
<a href="/services/apiextensions/">apiextensions</a><br />
117+
</div>
118+
<div class="providerDocColumn">
119+
<a href="/services/core/">core</a><br />
120+
<a href="/services/core_v1/">core_v1</a><br />
121+
</div>
122+
</div>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
title: admissionregistration
3+
hide_title: false
4+
hide_table_of_contents: false
5+
keywords:
6+
- admissionregistration
7+
- admissionregistration
8+
- k8s
9+
- stackql
10+
- infrastructure-as-code
11+
- configuration-as-data
12+
- cloud inventory
13+
description: Query, deploy and manage Kubernetes resources using SQL
14+
custom_edit_url: null
15+
image: /img/services/stackql-k8s-provider-featured-image.png
16+
---
17+
18+
import CopyableCode from '@site/src/components/CopyableCode/CopyableCode';
19+
20+
21+
22+
23+
## Overview
24+
<table><tbody>
25+
<tr><td><b>Name</b></td><td><code>admissionregistration</code></td></tr>
26+
<tr><td><b>Type</b></td><td>Resource</td></tr>
27+
<tr><td><b>Id</b></td><td><CopyableCode code="k8s.admissionregistration.admissionregistration" /></td></tr>
28+
</tbody></table>
29+
30+
## Fields
31+
| Name | Datatype | Description |
32+
|:-----|:---------|:------------|
33+
| <CopyableCode code="name" /> | `string` | name is the name of the group. |
34+
| <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 |
35+
| <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 |
36+
| <CopyableCode code="preferredVersion" /> | `object` | GroupVersion contains the "group/version" and "version" string of a version. It is made a struct to keep extensibility. |
37+
| <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. |
38+
| <CopyableCode code="versions" /> | `array` | versions are the versions supported in this group. |
39+
## Methods
40+
| Name | Accessible by | Required Params |
41+
|:-----|:--------------|:----------------|
42+
| <CopyableCode code="getAdmissionregistrationAPIGroup" /> | `SELECT` | <CopyableCode code="cluster_addr, protocol" /> |
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
title: admissionregistration
3+
hide_title: false
4+
hide_table_of_contents: false
5+
keywords:
6+
- admissionregistration
7+
- k8s
8+
- stackql
9+
- infrastructure-as-code
10+
- configuration-as-data
11+
- cloud inventory
12+
description: Query, deploy and manage Kubernetes resources using SQL
13+
custom_edit_url: null
14+
image: /img/services/stackql-k8s-provider-featured-image.png
15+
---
16+
17+
admission registration api
18+
19+
:::info Service Summary
20+
21+
<div class="row">
22+
<div class="providerDocColumn">
23+
<span>total resources:&nbsp;<b>1</b></span><br />
24+
<span>total selectable resources:&nbsp;<b>1</b></span><br />
25+
<span>total methods:&nbsp;<b>1</b></span><br />
26+
</div>
27+
</div>
28+
29+
:::
30+
31+
## Overview
32+
<table><tbody>
33+
<tr><td><b>Name</b></td><td><code>k8s.admissionregistration</code></td></tr>
34+
<tr><td><b>Type</b></td><td>Service</td></tr>
35+
<tr><td><b>Title</b></td><td>Kubernetes - admissionregistration</td></tr>
36+
<tr><td><b>Description</b></td><td>admission registration api</td></tr>
37+
<tr><td><b>Id</b></td><td><code>admissionregistration:v23.03.00121</code></td></tr>
38+
</tbody></table>
39+
40+
## Resources
41+
<div class="row">
42+
<div class="providerDocColumn">
43+
<a href="/services/admissionregistration/admissionregistration/">admissionregistration</a><br />
44+
</div>
45+
<div class="providerDocColumn">
46+
</div>
47+
</div>
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
title: admissionregistration_v1
3+
hide_title: false
4+
hide_table_of_contents: false
5+
keywords:
6+
- admissionregistration_v1
7+
- admissionregistration_v1
8+
- k8s
9+
- stackql
10+
- infrastructure-as-code
11+
- configuration-as-data
12+
- cloud inventory
13+
description: Query, deploy and manage Kubernetes resources using SQL
14+
custom_edit_url: null
15+
image: /img/services/stackql-k8s-provider-featured-image.png
16+
---
17+
18+
import CopyableCode from '@site/src/components/CopyableCode/CopyableCode';
19+
20+
21+
22+
23+
## Overview
24+
<table><tbody>
25+
<tr><td><b>Name</b></td><td><code>admissionregistration_v1</code></td></tr>
26+
<tr><td><b>Type</b></td><td>Resource</td></tr>
27+
<tr><td><b>Id</b></td><td><CopyableCode code="k8s.admissionregistration_v1.admissionregistration_v1" /></td></tr>
28+
</tbody></table>
29+
30+
## Fields
31+
| Name | Datatype | Description |
32+
|:-----|:---------|:------------|
33+
| <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 |
34+
| <CopyableCode code="groupVersion" /> | `string` | groupVersion is the group and version this APIResourceList is for. |
35+
| <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 |
36+
| <CopyableCode code="resources" /> | `array` | resources contains the name of the resources and if they are namespaced. |
37+
## Methods
38+
| Name | Accessible by | Required Params |
39+
|:-----|:--------------|:----------------|
40+
| <CopyableCode code="getAdmissionregistrationV1APIResources" /> | `SELECT` | <CopyableCode code="cluster_addr, protocol" /> |

0 commit comments

Comments
 (0)