Skip to content

Commit

Permalink
ASOAPI: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nojnhuh committed May 6, 2024
1 parent 7e0ce0c commit 2e74514
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
1 change: 1 addition & 0 deletions docs/book/install-and-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ genCRDAPIReferenceDocs="${genCRDAPIReferenceDocsPath}/gen-crd-api-reference-docs

${genCRDAPIReferenceDocs} -config "${genCRDAPIReferenceDocsPath}/example-config.json" -template-dir "${genCRDAPIReferenceDocsPath}/template" -api-dir ./api/v1beta1 -out-file ./docs/book/src/reference/v1beta1-api-raw.html
${genCRDAPIReferenceDocs} -config "${genCRDAPIReferenceDocsPath}/example-config.json" -template-dir "${genCRDAPIReferenceDocsPath}/template" -api-dir ./exp/api/v1beta1 -out-file ./docs/book/src/reference/v1beta1-exp-api-raw.html
${genCRDAPIReferenceDocs} -config "${genCRDAPIReferenceDocsPath}/example-config.json" -template-dir "${genCRDAPIReferenceDocsPath}/template" -api-dir ./exp/api/v1alpha1 -out-file ./docs/book/src/reference/v1alpha1-exp-api-raw.html

# Finally build the book.
(cd docs/book && /tmp/mdbook build)
1 change: 1 addition & 0 deletions docs/book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@
- [Reference](./reference/reference.md)
- [v1beta1 API](./reference/v1beta1-api.md)
- [v1beta1 exp API](./reference/v1beta1-exp-api.md)
- [v1alpha1 exp API](./reference/v1alpha1-exp-api.md)
1 change: 1 addition & 0 deletions docs/book/src/reference/v1alpha1-exp-api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ #include v1alpha1-exp-api-raw.html }}
17 changes: 8 additions & 9 deletions docs/book/src/topics/aso.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ An example configuration file and demo for `Azure Cache for Redis` can be found

## Experimental ASO API

CAPZ has begun to experiment with a new flavor of APIs that attempt to address the following limitations of
New in CAPZ v1.15.0 is a new flavor of APIs that addresses the following limitations of
the existing CAPZ APIs for advanced use cases:

- A limited set of Azure resource types can be represented.
Expand All @@ -97,7 +97,7 @@ This new experimental API defines new AzureASOManagedCluster, AzureASOManagedCon
AzureASOManagedMachinePool resources. An AzureASOManagedCluster might look like this:

```yaml
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: AzureASOManagedCluster
metadata:
name: my-cluster
Expand All @@ -112,6 +112,8 @@ spec:
location: eastus
```
See [here](https://github.com/kubernetes-sigs/cluster-api-provider-azure/blob/main/templates/cluster-template-aks-aso.yaml) for a full AKS example using all the new resources.
The main element of the new API is `spec.resources` in each new resource, which defines arbitrary, literal ASO
resources inline to be managed by CAPZ. These inline ASO resource definitions take the place of almost all
other configuration currently defined by CAPZ. e.g. Instead of a CAPZ-specific `spec.location` field on the
Expand All @@ -120,15 +122,12 @@ resource defined in an AzureASOManagedControlPlane's `spec.resources`. This patt
full, any ASO-supported version of a resource type in any of these new CAPZ resources.

The obvious tradeoff with this new style of API is that CAPZ resource definitions can become more verbose for
basic use cases. To address this, CAPZ will still offer flavor templates that use this API with all of the
basic use cases. To address this, CAPZ still offers flavor templates that use this API with all of the
boilerplate predefined to serve as a starting point for customization.

The overall theme of this API is to leverage ASO as much as possible for representing Azure resources in the
Kubernetes API, thereby making CAPZ the thinnest possible translation layer between ASO and Cluster API.

This experiment will help inform CAPZ whether this pattern may be a candidate for a potential v2 API. If
you're interested in trying this out, stay tuned! This functionality is available, but under heavy
construction and not yet in a usable state, behind the `ASOAPI` feature flag (set by the `EXP_ASO_API`
environment variable).

Feedback is welcome!
This experiment will help inform CAPZ whether this pattern may be a candidate for a potential v2 API. This
functionality is available behind the `ASOAPI` feature flag (set by the `EXP_ASO_API` environment variable).
Please try it out and offer any feedback!

0 comments on commit 2e74514

Please sign in to comment.