Skip to content

Commit

Permalink
docs: add instruction about json file for k8s versions (#3936)
Browse files Browse the repository at this point in the history
* docs: add instruction about json versions

* docs: capitalization

* docs: typo

---------

Co-authored-by: Lenny Chen <[email protected]>
  • Loading branch information
lennessyy and lennessyy authored Sep 17, 2024
1 parent d531907 commit 74434c5
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ artifacts at the same time.
git tag
```

4. Check out the newest available tag. This guide uses the tag **v4.3.0** as an example.
4. Check out the newest available tag. This guide uses the tag **v4.4.12** as an example.

```shell
git checkout v4.3.0
git checkout v4.4.12
```

5. Review the files relevant for this guide.
Expand Down Expand Up @@ -102,8 +102,12 @@ artifacts at the same time.
export OS_VERSION=22.04
```

9. Open the **Earthfile** in the CanvOS directory. Under `build-provider-images`, remove the lines containing Kubernetes
versions that you do not need.
9. Open the **k8s_versions.json** file in the CanvOS directory. Remove the Kubernetes versions that you don't need from
the JSON object corresponding to your Kubernetes distribution.

If you are using a tag that is earlier than v4.4.12, the **k8s_versions.json** file does not exist in those tags.
Instead, open the **Earthfile** in the CanvOS directory. Under `build-provider-images`, remove the lines containing
Kubernetes versions that you do not need.

10. Issue the command below to create an **.arg** file. The **.arg** file uses the default values for the remaining
arguments.
Expand Down Expand Up @@ -155,7 +159,7 @@ artifacts at the same time.
`[REGISTRY-HOSTNAME]` and version numbers in the command below.
```bash
docker push [REGISTRY-HOSTNAME]/ubuntu:k3s-1.28.2-v4.3.0-palette-learn
docker push [REGISTRY-HOSTNAME]/ubuntu:k3s-1.28.2-v4.4.12-palette-learn
```
## Validate
Expand All @@ -171,7 +175,7 @@ artifacts at the same time.
```hideClipboard
REPOSITORY TAG IMAGE ID CREATED SIZE
docker.io/[DOCKER-ID]/ubuntu k3s-1.28.2-v4.3.0-palette-learn 075134ad5d4b 10 minutes ago 4.11GB
docker.io/[DOCKER-ID]/ubuntu k3s-1.28.2-v4.4.12-palette-learn 075134ad5d4b 10 minutes ago 4.11GB
```
## Next Steps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ Palette is not FIPS compliant. If you need a FIPS-compliant solution, you need t
```

3. View the available tags and check out the latest tag or any specific version of your choosing. This guide uses
**v4.3.2** as an example.
**v4.4.12** as an example.

```bash
git tag
git checkout v4.3.2
git checkout v4.4.12
```

### Build FIPS-Compliant Base OS Image
Expand Down Expand Up @@ -266,7 +266,11 @@ workaround.
Provider images are Kairos-based container images for a supported OS and Kubernetes distribution combination.
FIPS-complaint provider images are built on top of the base OS image you have built previously.

17. Locate **Earthfile** in the CanvOS directory. In the file, find the block that starts with
17. Open the **k8s_versions.json** file in the CanvOS directory. Remove the Kubernetes versions that you don't need from
the JSON object corresponding to your Kubernetes distribution.
If you are using a tag that is earlier than v4.4.12, the **k8s_versions.json** file does not exist in those tags.
Instead, open the **Earthfile** in the CanvOS directory. In the file, find the block that starts with
`build-provider-images-fips:` and delete the Kubernetes versions that you do not want. This will speed up the build
process and save storage space.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ customization.
git tag
```

4. Check out the newest available tag. This guide uses the tag **v4.0.6** as an example.
4. Check out the newest available tag. This guide uses the tag **v4.4.12** as an example.

```shell
git checkout v4.0.6
git checkout v4.4.12
```

5. Review the files relevant for this guide.
Expand Down Expand Up @@ -152,7 +152,7 @@ customization.

Using the arguments defined in the **.arg** file, the final provider images you generate will have the following
naming convention, `[IMAGE_REGISTRY]/[IMAGE_REPO]:[CUSTOM_TAG]`. For example, one of the provider images will be
`ttl.sh/ubuntu:k3s-1.27.2-v4.0.6-palette-learn`.
`ttl.sh/ubuntu:k3s-1.27.2-v4.4.12-palette-learn`.

```bash
cat << EOF > .arg
Expand Down Expand Up @@ -279,7 +279,7 @@ customization.
system.repo: ubuntu
system.k8sDistribution: k3s
system.osName: ubuntu
system.peVersion: v4.0.6
system.peVersion: v4.4.12
system.customTag: palette-learn
system.osVersion: 22
```
Expand All @@ -294,9 +294,9 @@ customization.
```hideClipboard bash
REPOSITORY TAG IMAGE ID CREATED SIZE
ttl.sh/ubuntu k3s-1.27.2-v4.0.6-palette-learn 075134ad5d4b 10 minutes ago 4.11GB
ttl.sh/ubuntu k3s-1.25.2-v4.0.6-palette-learn 02424d29fcac 10 minutes ago 4.09GB
ttl.sh/ubuntu k3s-1.26.4-v4.0.6-palette-learn 4e373ddfb53f 10 minutes ago 4.11GB
ttl.sh/ubuntu k3s-1.27.2-v4.4.12-palette-learn 075134ad5d4b 10 minutes ago 4.11GB
ttl.sh/ubuntu k3s-1.25.2-v4.4.12-palette-learn 02424d29fcac 10 minutes ago 4.09GB
ttl.sh/ubuntu k3s-1.26.4-v4.4.12-palette-learn 4e373ddfb53f 10 minutes ago 4.11GB
```
13. To use the provider images in your cluster profile, push them to the image registry mentioned in the **.arg** file.
Expand All @@ -305,9 +305,9 @@ customization.
following commands to push the provider images to the _ttl.sh_ image registry.
```bash
docker push ttl.sh/ubuntu:k3s-1.25.2-v4.0.6-palette-learn
docker push ttl.sh/ubuntu:k3s-1.26.4-v4.0.6-palette-learn
docker push ttl.sh/ubuntu:k3s-1.27.2-v4.0.6-palette-learn
docker push ttl.sh/ubuntu:k3s-1.25.2-v4.4.12-palette-learn
docker push ttl.sh/ubuntu:k3s-1.26.4-v4.4.12-palette-learn
docker push ttl.sh/ubuntu:k3s-1.27.2-v4.4.12-palette-learn
```
:::warning
Expand Down Expand Up @@ -366,7 +366,7 @@ customization.
system.repo: ubuntu
system.k8sDistribution: k3s
system.osName: ubuntu
system.peVersion: v4.0.6
system.peVersion: v4.4.12
system.customTag: palette-learn
system.osVersion: 22
```
Expand Down Expand Up @@ -495,7 +495,7 @@ git tag
4. Check out the newest available tag. This guide uses **v3.4.3** tag as an example.
```shell
git checkout v4.0.6
git checkout v4.4.12
```
5. Review the files relevant for this guide.
Expand Down Expand Up @@ -740,7 +740,7 @@ git checkout v4.0.6
system.repo: opensuse-leap
system.k8sDistribution: k3s
system.osName: opensuse-leap
system.peVersion: v4.0.6
system.peVersion: v4.4.12
system.customTag: palette-learn
system.osVersion:
```
Expand All @@ -755,9 +755,9 @@ git checkout v4.0.6
```hideClipboard bash
REPOSITORY TAG IMAGE ID CREATED SIZE
spectrocloud/opensuse-leap k3s-1.27.2-v4.0.6-palette-learn 2427e3667b2f 24 minutes ago 2.22GB
spectrocloud/opensuse-leap k3s-1.26.6-v4.0.6-palette-learn 0f2efd533a33 24 minutes ago 2.22GB
spectrocloud/opensuse-leap k3s-1.25.2-v4.0.6-palette-learn 2427e3667b2f 24 minutes ago 2.22GB
spectrocloud/opensuse-leap k3s-1.27.2-v4.4.12-palette-learn 2427e3667b2f 24 minutes ago 2.22GB
spectrocloud/opensuse-leap k3s-1.26.6-v4.4.12-palette-learn 0f2efd533a33 24 minutes ago 2.22GB
spectrocloud/opensuse-leap k3s-1.25.2-v4.4.12-palette-learn 2427e3667b2f 24 minutes ago 2.22GB
```
16. To use the provider images in your cluster profile, push them to your image registry mentioned in the **.arg** file.
Expand All @@ -776,9 +776,9 @@ git checkout v4.0.6
the utility created.
```bash
docker push docker.io/[DOCKER-ID]/opensuse-leap:k3s-1.27.2-v4.0.6-palette-learn
docker push docker.io/[DOCKER-ID]/opensuse-leap:k3s-1.26.6-v4.0.6-palette-learn
docker push docker.io/[DOCKER-ID]/opensuse-leap:k3s-1.25.2-v4.0.6-palette-learn
docker push docker.io/[DOCKER-ID]/opensuse-leap:k3s-1.27.2-v4.4.12-palette-learn
docker push docker.io/[DOCKER-ID]/opensuse-leap:k3s-1.26.6-v4.4.12-palette-learn
docker push docker.io/[DOCKER-ID]/opensuse-leap:k3s-1.25.2-v4.4.12-palette-learn
```
18. After pushing the provider images to the image registry, open a web browser and log in to
Expand Down Expand Up @@ -828,7 +828,7 @@ git checkout v4.0.6
system.repo: opensuse-leap
system.k8sDistribution: k3s
system.osName: opensuse-leap
system.peVersion: v4.0.6
system.peVersion: v4.4.12
system.customTag: palette-learn
system.osVersion:
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ key that is in the Signature Database (DB). This is important both during instal
git tag
```

4. Check out the newest available tag. This guide uses the tag **v4.4.0** as an example.
4. Check out the newest available tag. This guide uses the tag **v4.4.12** as an example.

```shell
git checkout v4.4.0
git checkout v4.4.12
```

5. Review the files relevant for this guide.
Expand Down Expand Up @@ -135,7 +135,11 @@ key that is in the Signature Database (DB). This is important both during instal
| `OS_DISTRIBUTION` | OS distribution. | `ubuntu`, `opensuse-leap`, `rhel`. |
| `OS_VERSION` | OS version. This applies to Ubuntu only. | `23.10`, `24.04` |
10. Open the **Earthfile** in the CanvOS directory. Under `build-provider-images`, remove the lines containing
10. Open the **k8s_versions.json** file in the CanvOS directory. Remove the Kubernetes versions that you don't need from
the JSON object corresponding to your Kubernetes distribution.
If you are using a tag that is earlier than v4.4.12, the **k8s_versions.json** file does not exist in those tags.
Instead, open the **Earthfile** in the CanvOS directory. Under `build-provider-images`, remove the lines containing
Kubernetes versions that you do not need.
11. CanvOS utility uses [Earthly](https://earthly.dev/) to build the target artifacts. Issue the following command to
Expand All @@ -162,7 +166,7 @@ key that is in the Signature Database (DB). This is important both during instal
`[DOCKER-ID]` and version numbers in the command below with your Docker ID and respective Kubernetes versions.
```bash
docker push docker.io/[DOCKER-ID]/ubuntu:rke2-1.28.2-v4.4.0-trusted-boot
docker push docker.io/[DOCKER-ID]/ubuntu:rke2-1.28.2-v4.4.12-trusted-boot
```
## Validate
Expand All @@ -178,5 +182,5 @@ key that is in the Signature Database (DB). This is important both during instal
```hideClipboard
REPOSITORY TAG IMAGE ID CREATED SIZE
docker.io/[DOCKER-ID]/ubuntu rke2-1.28.2-v4.4.0-trusted-boot 075134ad5d4b 10 minutes ago 1.79GB
docker.io/[DOCKER-ID]/ubuntu rke2-1.28.2-v4.4.12-trusted-boot 075134ad5d4b 10 minutes ago 1.79GB
```

0 comments on commit 74434c5

Please sign in to comment.