Skip to content

Commit

Permalink
Update custom image docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mboersma committed Oct 9, 2024
1 parent 2a4e9ef commit ff0c1e4
Showing 1 changed file with 38 additions and 4 deletions.
42 changes: 38 additions & 4 deletions docs/book/src/self-managed/custom-images.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,25 @@ This document will help you get a CAPZ Kubernetes cluster up and running with yo

An *image* defines the operating system and Kubernetes components that will populate the disk of each node in your cluster.

By default, images offered by "capi" in the [Azure Marketplace][azure-marketplace] are used.
By default, images published by the Cluster API for Azure team are used. These images live in an Azure [community gallery](https://learn.microsoft.com/azure/virtual-machines/share-gallery-community).

You can list these *reference images* with this command:
You can list these *reference images* with these commands:

```bash
az vm image list --publisher cncf-upstream --offer capi --all -o table
# List the image definitions (distro and version)
az sig image-definition list-community \
--public-gallery-name capzed-489de9a5-a0a0-4e79-a806-ad5479ec43a5 \
--location northcentralus
# List the versions for an image definition (Ubuntu 24.04 for example)
# Version names are Kubernetes releases, such as "1.28.14" or "1.31.1".
az sig image-version list-community \
--public-gallery-name capzed-489de9a5-a0a0-4e79-a806-ad5479ec43a5 \
--gallery-image-definition capi-ubun2-2404 \
--location northcentralus
```

The reference images are replicated to the set of regions used in CAPZ e2e tests. To see if a reference image is available in the location where you intend to provision a cluster, change the `northcentralus` argument in the previous command.

It is recommended to use the latest patch release of Kubernetes for a [supported minor release][supported-k8s].

<aside class="note warning">
Expand All @@ -22,7 +33,7 @@ It is recommended to use the latest patch release of Kubernetes for a [supported

The Cluster API for Azure team publishes *reference images* for each Kubernetes release, for both Linux and Windows.

Reference images for versions of Kubernetes which have known security issues or which are no longer [supported by Cluster API][supported-capi] will be removed from the Azure Marketplace.
Reference images for versions of Kubernetes which have known security issues or which are no longer [supported by Cluster API][supported-capi] will be removed from the Azure Marketplace and the CAPZ community gallery.

</aside>

Expand Down Expand Up @@ -131,6 +142,29 @@ spec:

This will make API calls to create Virtual Machines or Virtual Machine Scale Sets to have the `Plan` correctly set.

### Using a community gallery

A "community gallery" is an Azure Compute Gallery with "community" permissions, but it has a globally unique name, is available to all Azure users, and is accessed differently.

The CAPZ project publishes reference images to a community gallery. But as mentioned at the top of this document, they are the default. You don't need to specify a custom image section in your template to use the reference images.

To use an image from a community gallery, set the `name`, `gallery`, and `version` fields:

```yaml
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: AzureMachineTemplate
metadata:
name: capz-community-gallery-example
spec:
template:
spec:
image:
computeGallery:
name: "capzed-489de9a5-a0a0-4e79-a806-ad5479ec43a5"
gallery: "capi-ubun2-2404"
version: "1.31.1"
```

### Using image ID

To use a managed image resource by ID, only the `id` field must be set:
Expand Down

0 comments on commit ff0c1e4

Please sign in to comment.