Skip to content

Commit c90f658

Browse files
committed
Update docs, & fully use [email protected]
1 parent 3b96efe commit c90f658

File tree

3 files changed

+26
-14
lines changed

3 files changed

+26
-14
lines changed

README.md

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,33 +13,45 @@ Earlier releases would need some codegen changes to be compatible.
1313

1414
## Module Layout
1515

16+
NOTE: This section refers to a hypothetical dynamic-codegen endpoint.
17+
The current way of using this library is importing modules from
18+
[/x/kubernetes_apis](https://deno.land/x/kubernetes_apis).
19+
The latest Kubernetes release is used to generate the published modules,
20+
so you may start noticing a lack of parity if you are using a quite old cluster.
21+
22+
---
23+
1624
Versioning is tricky with Kubernetes APIs because every cluster can have a different surface.
1725

1826
When referring to Kubernetes API surfaces, an exhuastive module path might look like this:
1927

20-
21-
* `//[email protected]/[email protected]/apps@v1beta1/mod.ts`
22-
* `//[email protected]/[email protected]/networking.k8s.io@v1/mod.ts`
28+
* `https://k8s-apis.deno.dev/v1/[email protected]/core@v1/mod.ts`
29+
* `https://k8s-apis.deno.dev/v1/[email protected]/apps@v1beta1/mod.ts`
30+
* `https://k8s-apis.deno.dev/v1/[email protected]/networking.k8s.io@v1/mod.ts`
2331

2432
There's also third-party projects that register CRDs, such as cert-manager.
25-
It's unfortunate that OpenAPI specs aren't published by these projects,
26-
so generation will depend on access to a live cluster,
27-
or extending the codegen to accept CRD YAML files as input in place of OpenAPI JSON.
33+
OpenAPI specs are almost never published by these projects,
34+
so generating APIs for them generally means feeding CRD YAML files into the codegen and guessing.
35+
This is an imperfect art but so far works well for `cert-manager` and `exernal-dns`.
36+
Alternatively, the CRDs could be installed onto a real control plane and then the APIed extracted.
2837

2938
Several examples of addressing third party APIs might be:
3039

31-
* `//[email protected]/[email protected]/acme.cert-manager.io@v1alpha2/mod.ts`
32-
* `//[email protected]/[email protected]/externaldns.k8s.io@v1alpha1/mod.ts`
33-
* `//[email protected]/[email protected]/velero.io@v1/mod.ts`
40+
* `https://k8s-apis.deno.dev/v1/[email protected]/acme.cert-manager.io@v1alpha2/mod.ts`
41+
* `https://k8s-apis.deno.dev/v1/[email protected]/externaldns.k8s.io@v1alpha1/mod.ts`
42+
* `https://k8s-apis.deno.dev/v1/[email protected]/velero.io@v1/mod.ts`
3443

35-
There's not really any, like, directory of CRDs, so we'll need to make the list ourselves..
44+
The only sort of 'directory' of CRDs is likely [Operator Hub](https://operatorhub.io/)
45+
though it is also lacking CRDs that are not explicitly tied to an "Operator".
46+
Otherwise, there's not really any, like, directory of just CRDs,
47+
so we'll possibly need to make a further list ourselves..
3648

3749
Finally, for generating code within a cluster, it's pretty likely that a cluster's apis
38-
will be generated as one unit and stored in S3 or similar, and the paths are more straightforward:
50+
will be generated as one unit and possibly stored in S3 or similar, and the paths are more straightforward:
3951

4052
* `//k8s_api_surface/batch@v1/mod.ts`
4153

4254
In any case, the actual API client that works with authentication/transport
4355
will be served authoratatively from a normal deno repo:
4456

45-
* https://deno.land/x/[email protected].1/mod.ts
57+
* https://deno.land/x/[email protected].4/mod.ts

generation/deps.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export * as path from "https://deno.land/[email protected]/path/mod.ts";
22
export * as YAML from "https://deno.land/[email protected]/encoding/yaml.ts";
33

4-
export type { ApiKind, JSONValue } from "https://deno.land/x/[email protected].1/mod.ts";
4+
export type { ApiKind, JSONValue } from "https://deno.land/x/[email protected].4/mod.ts";

lib/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
// kubernetes_apis itself only depends on specific files,
33
// so this is provided an optional utility (as opposed to deps.ts)
44

5-
export * from "https://deno.land/x/[email protected].1/mod.ts";
5+
export * from "https://deno.land/x/[email protected].4/mod.ts";

0 commit comments

Comments
 (0)