-
Notifications
You must be signed in to change notification settings - Fork 39
docs: DOC-1461: CAPI Image Builder Rocky Linux Existing VM Workflow #8720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 8 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
4eef2cd
Rough drafting with notes
achuribooks f59c2fe
Prereqs complete; cleaning scripts, simplifying vmware instructions
achuribooks 08bf17f
Airgapped addressed; rough draft complete
achuribooks f84e6ca
Merge branch 'master' into DOC-1461
achuribooks 2199332
Incorporating suggestions from review
achuribooks 4f56a62
Merge branch 'DOC-1461' of github.com:spectrocloud/librarium into DOC…
achuribooks f9d538a
Prettier formatting
achuribooks be07f47
Formatting
achuribooks 216b467
Applying suggestions from code review
achuribooks 47a7323
Merge branch 'master' into DOC-1461
achuribooks 4c208ec
ci: auto-formatting prettier issues
achuribooks File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
74 changes: 74 additions & 0 deletions
74
_partials/capi-image-builder/_build-custom-image-intro.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| --- | ||
| partial_category: capi-image-builder | ||
| partial_name: build-custom-image-intro | ||
| --- | ||
|
|
||
| 1. Open a terminal session on your Linux machine and set your CAPI Image Builder version tag as a variable. This guide | ||
| uses version 4.6.24 as an example. Refer to the CAPI Image Builder | ||
| [Downloads](/downloads/capi-image-builder) page for the latest version. | ||
|
|
||
| ```shell | ||
| CAPI_IMAGE_BUILDER_VERSION=<capi-image-builder-version-tag> | ||
| echo CAPI Image Builder version: $CAPI_IMAGE_BUILDER_VERSION | ||
| ``` | ||
|
|
||
| ```shell title="Example output" | ||
| CAPI Image Builder version: v4.6.24 | ||
| ``` | ||
|
|
||
| 2. Download the CAPI Image Builder image. | ||
|
|
||
| <Tabs groupId="container-tech"> | ||
|
|
||
| <TabItem value="Docker" label="Docker"> | ||
|
|
||
| ```shell | ||
| docker pull us-docker.pkg.dev/palette-images/palette/imagebuilder/capi-builder:$CAPI_IMAGE_BUILDER_VERSION | ||
| ``` | ||
|
|
||
| Confirm that the image was downloaded correctly. | ||
|
|
||
| ```shell | ||
| docker images | ||
| ``` | ||
|
|
||
| ```text hideClipboard title="Example output" | ||
| REPOSITORY TAG IMAGE ID CREATED SIZE | ||
| us-docker.pkg.dev/palette-images/palette/imagebuilder/capi-builder v4.6.24 2adff15eee2d 7 days ago 2.09GB | ||
| ``` | ||
|
|
||
| </TabItem> | ||
|
|
||
| <TabItem value="Podman" label="Podman"> | ||
|
|
||
| ```shell | ||
| podman pull us-docker.pkg.dev/palette-images/palette/imagebuilder/capi-builder:$CAPI_IMAGE_BUILDER_VERSION | ||
| ``` | ||
|
|
||
| Confirm that the image was downloaded correctly. | ||
|
|
||
| ```shell | ||
| podman images | ||
| ``` | ||
|
|
||
| ```text hideClipboard title="Example output" | ||
| REPOSITORY TAG IMAGE ID CREATED SIZE | ||
| us-docker.pkg.dev/palette-images/palette/imagebuilder/capi-builder v4.6.24 2adff15eee2d 7 days ago 2.09GB | ||
| ``` | ||
achuribooks marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| </TabItem> | ||
|
|
||
| </Tabs> | ||
|
|
||
| 3. Create an `output` directory to store the image files and set the required permissions. | ||
|
|
||
| ```shell | ||
| mkdir /home/$USER/output | ||
| chmod a+rwx /home/$USER/output | ||
| ``` | ||
|
|
||
| 4. Navigate to the `output` directory. | ||
achuribooks marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ```shell | ||
| cd /home/$USER/output | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| --- | ||
| partial_category: capi-image-builder | ||
| partial_name: ssh-vm | ||
| --- | ||
|
|
||
| Locate the new Rocky image VM in your VMware vSphere environment. Right-click the VM and select **Clone > Clone to | ||
| Template**. | ||
|
|
||
| :::tip | ||
|
|
||
| Once the image is built, you can connect to the image via SSH. The following steps are based on guidance from the | ||
| [Image Builder Book](https://image-builder.sigs.k8s.io/capi/providers/vsphere#accessing-remote-vms). | ||
|
|
||
| <details> | ||
|
|
||
| <summary> Connect to image VM with SSH </summary> | ||
|
|
||
| 1. On a machine with [govc](https://github.com/vmware/govmomi/tree/main/govc) installed and configured with your | ||
| VMware vSphere credentials, clone the | ||
achuribooks marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| [Kubernetes Image Builder repository](https://github.com/kubernetes-sigs/image-builder). | ||
|
|
||
| 2. Navigate to the `capi` directory of the Kubernetes Image Builder repository. | ||
|
|
||
| ```shell | ||
| cd ./image-builder/images/capi/ | ||
| ``` | ||
|
|
||
| 3. Run the Kubernetes Image Builder `image-govc-cloudinit.sh` script and pass in the `image_name` of your Rocky | ||
| image VM as specified in the `imageconfig` file. This creates a snapshot of the image and updates it with the | ||
| data located in the `cloudinit` directory. Ensure the VM is off before running the command. | ||
|
|
||
| ```shell | ||
| ./hack/image-govc-cloudinit.sh <image_name> | ||
achuribooks marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ``` | ||
|
|
||
| ```shell title="Example output" | ||
| image-govc-cloudinit: creating snapshot 'new' | ||
| image-govc-cloudinit: initializing cloud-init data | ||
| image-govc-cloudinit: creating snapshot 'cloudinit' | ||
| ``` | ||
|
|
||
| 4. Set read-write permissions for the owner of the `id_rsa.capi` file. | ||
achuribooks marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ```shell | ||
| chmod 600 cloudinit/id_rsa.capi | ||
| ``` | ||
|
|
||
| 5. Power on the Rocky image VM. | ||
|
|
||
| 6. Connect to the VM via SSH using your `id_rsa.capi` key. Replace `<vm-ip>` with the IP of your Rocky image VM. | ||
|
|
||
| ```shell | ||
| ssh -i cloudinit/id_rsa.capi capv@<vm-ip> | ||
achuribooks marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ``` | ||
|
|
||
| </details> | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.