Skip to content

Commit 9c03a1c

Browse files
committed
docs: updates the dev and user docs
Signed-off-by: Richard Case <[email protected]>
1 parent d421a43 commit 9c03a1c

File tree

2 files changed

+76
-17
lines changed

2 files changed

+76
-17
lines changed

docs/book/src/development/amis.md

Lines changed: 65 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,82 @@
11
# Publish AMIs
22

3-
Publishing new AMIs is currently a manual process but it will be automated in th every near future (see [this issue](https://github.com/kubernetes-sigs/cluster-api-provider-aws/issues/1982) for progress).
3+
Publishing new AMIs is done via manually invoking a GitHub Actions workflow.
44

5-
## Pre-reqs
5+
> NOTE: the plan is to ultimately fully automate the process in the future (see [this issue](https://github.com/kubernetes-sigs/cluster-api-provider-aws/issues/1982) for progress).
66
7-
- You must have admin access to the CNCF AWAS account used for the AMIs (819546954734)
7+
> NOTE: there are some issues with the RHEL based images at present.
8+
9+
## Get build inputs
10+
11+
For a new Kubernetes version that you want to build an AMI for you will need to determine the following values:
12+
13+
| Input | Description |
14+
| ----------------- | ----------- |
15+
| kubernetes_semver | The semver version of k8s you want to build an AMI for. In format vMAJOR.MINOR.PATCH. |
16+
| kubernetes_series | The release series for the Kubernetes version. In format vMAJOR.MINOR. |
17+
| kubernetes_deb_version | The version of the debian package for the release. |
18+
| kubernetes_rpm_version | The version of the rpm package for the release |
19+
| kubernetes_cni_semver | The version of CNI to include. It needs to match the k8s release. |
20+
| kubernetes_cni_deb_version | The version of the debian package for the CNI release to use |
21+
| crictl_version | The vesion of the cri-tools package to install into the AMI |
22+
23+
You can determine these values directly or by looking at the publish debian apt repositories for the k8s release.
24+
25+
## Build
26+
27+
### Using GitHub Actions Workflow
28+
29+
To build the AMI using GitHub actions you must have write access to the CAPA repository (i.e. be a maintainer or part of release team).
30+
31+
To build the new version:
832

9-
## Process
33+
1. Got to the GitHub Action
34+
2. Click the **Start Workflow** button
35+
3. Fill in the details of the build
36+
4. Click **Run**
37+
38+
### Manually
39+
40+
> **WARNING: the manual process should only be followed in exceptional circumstances.
41+
42+
To build manually you must have admin access to the CNCF AWS account used for the AMIs.
43+
44+
The steps to build manually are:
1045

1146
1. Clone [image-builder](https://github.com/kubernetes-sigs/image-builder)
1247
2. Open a terminal
13-
3. Set the AWS environment variables for the AMI account
48+
3. Set the AWS environment variables for the CAPA AMI account
1449
4. Change directory into `images/capi`
15-
5. Install dependencies by running:
50+
5. Create a new file called `vars.json` with the following content (substituing the values with the build inputs):
51+
52+
```json
53+
{
54+
"kubernetes_rpm_version": "<INSERT_INPUT_VALUE>",
55+
"kubernetes_semver": "<INSERT_INPUT_VALUE>",
56+
"kubernetes_series": "<INSERT_INPUT_VALUE>",
57+
"kubernetes_deb_version": "<INSERT_INPUT_VALUE>",
58+
"kubernetes_cni_semver": "<INSERT_INPUT_VALUE>",
59+
"kubernetes_cni_deb_version": "<INSERT_INPUT_VALUE>",
60+
"crictl_version": "<INSERT_INPUT_VALUE>"
61+
}
62+
```
63+
6. Install dependencies by running:
1664

1765
```shell
1866
make deps-ami
1967
```
2068

21-
6. Build the AMIs using:
69+
7. Build the AMIs using:
2270

2371
```shell
24-
make build-ami-ubuntu-2004
25-
make build-ami-ubuntu-2204
26-
make build-ami-ubuntu-2404
27-
make build-ami-flatcar
28-
make build-ami-rhel-8
72+
PACKER_VAR_FILES=vars.json make build-ami-ubuntu-2204
73+
PACKER_VAR_FILES=vars.json make build-ami-ubuntu-2404
74+
PACKER_VAR_FILES=vars.json make build-ami-flatcar
75+
PACKER_VAR_FILES=vars.json make build-ami-rhel-8
2976
```
30-
> NOTE: there are some issues with the RHEL based images at present.
77+
## Additional Information
78+
79+
- The AMIs are hosted in a CNCF owned AWS account (819546954734).
80+
- The AWS resources that are needed to support the GitHub Actions workflow are created via terraform. Source is [here](https://github.com/kubernetes/k8s.io/tree/main/infra/aws/terraform/cncf-k8s-infra-aws-capa-ami).
81+
- OIDC and IAM Roles are used to grant access via short lived credentials to the GitHub Action workflow instance when it runs.
82+

docs/book/src/topics/images/built-amis.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
11
# Pre-built Kubernetes AMIs
22

3-
New AMIs are built on a best effort basis when a new Kubernetes version is released. for each supported OS distribution and then published to supported regions.
3+
New AMIs are built on a best effort basis when a new Kubernetes version is released for each supported OS distribution and then published to supported regions.
4+
5+
## AMI Publication Policy
6+
7+
- AMIs should only be used for non-production usage. For production environments we recommend that you build and maintain your own AMIs using the image-builder project.
8+
- AMIs will only be published for the latest release series and 2 previous release series. For example, if the current release series is v1.31 then AMIs will only be published for v1.31.x, v1.30.x, v1.29.x.
9+
- When there is a new k8s release series then any AMIs no longer covered by the previous point will be deleted. For example, when v1.32.0 is pubslished then any AMIs for the v1.29 release series will be deleted.
10+
- Existing AMIs are not updated for security fixes and it is recommended to always use the latest patch version for the Kubernetes version you want to run.
11+
12+
## Finding AMIs
413

514
`clusterawsadm ami list` command lists pre-built reference AMIs by Kubernetes version, OS, or AWS region. See [clusterawsadm ami list](https://cluster-api-aws.sigs.k8s.io/clusterawsadm/clusterawsadm_ami_list.html) for details.
615

716
If you are using a version of clusterawsadm prior to v2.6.2 then you will need to explicitly specify the owner-id for the community account: `clusterawsadm ami list --owner-id 819546954734`.
817

9-
> **Note:** These images are not updated for security fixes and it is recommended to always use the latest patch version for the Kubernetes version you want to run. For production environments, it is highly recommended to build and use your own custom images.
10-
1118
## Supported OS Distributions
1219
- Amazon Linux 2 (amazon-2)
13-
- Ubuntu (ubuntu-20.04, ubuntu-22.04, ubuntu-24.04)
20+
- Ubuntu (ubuntu-22.04, ubuntu-24.04)
1421
- Centos (centos-7)
1522
- Flatcar (flatcar-stable)
1623

0 commit comments

Comments
 (0)