Skip to content

Commit 20ad71d

Browse files
authored
Merge pull request #5107 from mboersma/update-for-azure-rename
📖 doc: update Azure provider links to reference main branch
2 parents a48fed4 + 76ceb96 commit 20ad71d

File tree

2 files changed

+28
-28
lines changed

2 files changed

+28
-28
lines changed

docs/book/src/tasks/using-kustomize.md

+26-26
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Using Kustomize with Workload Cluster Manifests
22

3-
Although the `clusterctl generate cluster` command exposes a number of different configuration values
4-
for customizing workload cluster YAML manifests, some users may need additional flexibility above
5-
and beyond what `clusterctl generate cluster` or the example "flavor" templates that some CAPI providers
6-
supply (as an example, see [these flavor templates](https://github.com/kubernetes-sigs/cluster-api-provider-azure/tree/master/templates/flavors)
7-
for the Cluster API Provider for Azure). In the future, a [templating solution](https://github.com/kubernetes-sigs/cluster-api/issues/3252)
8-
may be integrated into `clusterctl` to help address this need, but in the meantime users can use
3+
Although the `clusterctl generate cluster` command exposes a number of different configuration values
4+
for customizing workload cluster YAML manifests, some users may need additional flexibility above
5+
and beyond what `clusterctl generate cluster` or the example "flavor" templates that some CAPI providers
6+
supply (as an example, see [these flavor templates](https://github.com/kubernetes-sigs/cluster-api-provider-azure/tree/main/templates/flavors)
7+
for the Cluster API Provider for Azure). In the future, a [templating solution](https://github.com/kubernetes-sigs/cluster-api/issues/3252)
8+
may be integrated into `clusterctl` to help address this need, but in the meantime users can use
99
`kustomize` as a solution to this need.
1010

11-
This document provides a few examples of using `kustomize` with Cluster API. All of these examples
11+
This document provides a few examples of using `kustomize` with Cluster API. All of these examples
1212
assume that you are using a directory structure that looks something like this:
1313

1414
```
@@ -25,13 +25,13 @@ assume that you are using a directory structure that looks something like this:
2525
└── workload-mhc.yaml
2626
```
2727

28-
In the overlay directories, the "base" (unmodified) Cluster API configuration (perhaps generated using
28+
In the overlay directories, the "base" (unmodified) Cluster API configuration (perhaps generated using
2929
`clusterctl generate cluster`) would be referenced as a resource in `kustomization.yaml` using `../../base`.
3030

3131
## Example: Using Kustomize to Specify Custom Images
3232

33-
Users can use `kustomize` to specify custom OS images for Cluster API nodes. Using the Cluster API
34-
Provider for AWS (CAPA) as an example, the following `kustomization.yaml` would leverage a JSON 6902 patch
33+
Users can use `kustomize` to specify custom OS images for Cluster API nodes. Using the Cluster API
34+
Provider for AWS (CAPA) as an example, the following `kustomization.yaml` would leverage a JSON 6902 patch
3535
to modify the AMI for nodes in a workload cluster:
3636

3737
```yaml
@@ -57,13 +57,13 @@ The referenced JSON 6902 patch in `custom-ami.json` would look something like th
5757
]
5858
```
5959

60-
This configuration assumes that the workload cluster _only_ uses MachineDeployments. Since
61-
MachineDeployments and the KubeadmControlPlane both leverage AWSMachineTemplates, this `kustomize`
60+
This configuration assumes that the workload cluster _only_ uses MachineDeployments. Since
61+
MachineDeployments and the KubeadmControlPlane both leverage AWSMachineTemplates, this `kustomize`
6262
configuration would catch all nodes in the workload cluster.
6363

6464
## Example: Adding a MachineHealthCheck for a Workload Cluster
6565

66-
Users could also use `kustomize` to combine additional resources, like a MachineHealthCheck (MHC), with the
66+
Users could also use `kustomize` to combine additional resources, like a MachineHealthCheck (MHC), with the
6767
base Cluster API manifest. In an overlay directory, specify the following in `kustomization.yaml`:
6868

6969
```yaml
@@ -98,24 +98,24 @@ spec:
9898
timeout: 300s
9999
```
100100

101-
You would want to ensure the `clusterName` field in the MachineHealthCheck manifest appropriately
102-
matches the name of the workload cluster, taking into account any transformations you may have specified
101+
You would want to ensure the `clusterName` field in the MachineHealthCheck manifest appropriately
102+
matches the name of the workload cluster, taking into account any transformations you may have specified
103103
in `kustomization.yaml` (like the use of "namePrefix" or "nameSuffix").
104104

105-
Running `kustomize build .` with this configuration would append the MHC to the base
105+
Running `kustomize build .` with this configuration would append the MHC to the base
106106
Cluster API manifest, thus creating the MHC at the same time as the workload cluster.
107107

108108
## Modifying Names
109109

110-
The `kustomize` "namePrefix" and "nameSuffix" transformers are not currently "Cluster API aware."
111-
Although it is possible to use these transformers with Cluster API manifests, doing so requires separate
112-
patches for Clusters versus infrastructure-specific equivalents (like an AzureCluster or a vSphereCluster).
110+
The `kustomize` "namePrefix" and "nameSuffix" transformers are not currently "Cluster API aware."
111+
Although it is possible to use these transformers with Cluster API manifests, doing so requires separate
112+
patches for Clusters versus infrastructure-specific equivalents (like an AzureCluster or a vSphereCluster).
113113
This can significantly increase the complexity of using `kustomize` for this use case.
114114

115-
Modifying the transformer configurations for `kustomize` can make it more effective with Cluster API.
116-
For example, changes to the `nameReference` transformer in `kustomize` will enable `kustomize` to know
117-
about the references between Cluster API objects in a manifest. See
118-
[here](https://github.com/kubernetes-sigs/kustomize/tree/master/examples/transformerconfigs) for more
115+
Modifying the transformer configurations for `kustomize` can make it more effective with Cluster API.
116+
For example, changes to the `nameReference` transformer in `kustomize` will enable `kustomize` to know
117+
about the references between Cluster API objects in a manifest. See
118+
[here](https://github.com/kubernetes-sigs/kustomize/tree/master/examples/transformerconfigs) for more
119119
information on transformer configurations.
120120

121121
Add the following content to the `namereference.yaml` transformer configuration:
@@ -175,7 +175,7 @@ Add the following content to the `namereference.yaml` transformer configuration:
175175
kind: MachineDeployment
176176
```
177177

178-
Including this custom configuration in a `kustomization.yaml` would then enable the use of simple
178+
Including this custom configuration in a `kustomization.yaml` would then enable the use of simple
179179
"namePrefix" and/or "nameSuffix" directives, like this:
180180

181181
```yaml
@@ -190,6 +190,6 @@ namePrefix: "blue-"
190190
nameSuffix: "-dev"
191191
```
192192

193-
Running `kustomize build. ` with this configuration would modify the name of all the Cluster API
194-
objects _and_ the associated referenced objects, adding "blue-" at the beginning and appending "-dev"
193+
Running `kustomize build. ` with this configuration would modify the name of all the Cluster API
194+
objects _and_ the associated referenced objects, adding "blue-" at the beginning and appending "-dev"
195195
at the end.

docs/book/src/user/quick-start.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@ Azure [does not currently support Calico networking](https://docs.projectcalico.
725725
726726
```bash
727727
kubectl --kubeconfig=./capi-quickstart.kubeconfig \
728-
apply -f https://raw.githubusercontent.com/kubernetes-sigs/cluster-api-provider-azure/master/templates/addons/calico.yaml
728+
apply -f https://raw.githubusercontent.com/kubernetes-sigs/cluster-api-provider-azure/main/templates/addons/calico.yaml
729729
```
730730
731731
After a short while, our nodes should be running and in `Ready` state,
@@ -743,7 +743,7 @@ kubectl --kubeconfig=./capi-quickstart.kubeconfig get nodes
743743
Delete workload cluster.
744744
```bash
745745
kubectl delete cluster capi-quickstart
746-
```
746+
```
747747
<aside class="note warning">
748748
749749
IMPORTANT: In order to ensure a proper cleanup of your infrastructure you must always delete the cluster object. Deleting the entire cluster template with `kubectl delete -f capi-quickstart.yaml` might lead to pending resources to be cleaned up manually.

0 commit comments

Comments
 (0)