@@ -13,33 +13,45 @@ Earlier releases would need some codegen changes to be compatible.
13
13
14
14
## Module Layout
15
15
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
+
16
24
Versioning is tricky with Kubernetes APIs because every cluster can have a different surface.
17
25
18
26
When referring to Kubernetes API surfaces, an exhuastive module path might look like this:
19
27
20
-
21
-
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`
23
31
24
32
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.
28
37
29
38
Several examples of addressing third party APIs might be:
30
39
31
- * ` //[email protected] /[email protected] /acme.cert-manager.io@v1alpha2/mod.ts`
32
- * ` //[email protected] /[email protected] /externaldns.k8s.io@v1alpha1/mod.ts`
33
-
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`
34
43
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..
36
48
37
49
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:
39
51
40
52
* ` //k8s_api_surface/batch@v1/mod.ts `
41
53
42
54
In any case, the actual API client that works with authentication/transport
43
55
will be served authoratatively from a normal deno repo:
44
56
45
- * https://deno.land/x/[email protected] .1 /mod.ts
57
+ * https://deno.land/x/[email protected] .4 /mod.ts
0 commit comments