Skip to content
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

feat: add rancher integration for airgapped environment and prime case #694

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions docs/airgap.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,30 @@ When the nodes in the cluster do not use a proxy to communicate with each other,

## Guest Cluster Images

All necessary images to install and run Harvester are conveniently packaged into the ISO, eliminating the need to pre-load images on bare-metal nodes. A Harvester cluster manages them independently and effectively behind the scenes.
All necessary images to install and run Harvester are conveniently packaged into the ISO, eliminating the need to pre-load images on bare-metal nodes. A Harvester cluster manages them independently and effectively behind the scenes.

However, it's essential to understand a guest K8s cluster (e.g., RKE2 cluster) created by the [Harvester node driver](./rancher/node/node-driver.md) is a distinct entity from a Harvester cluster. A guest cluster operates within VMs and requires pulling images either from the internet or a [private registry](https://ranchermanager.docs.rancher.com/how-to-guides/new-user-guides/authentication-permissions-and-global-configuration/global-default-private-registry#configure-a-private-registry-with-credentials-when-creating-a-cluster).
However, it's essential to understand a guest K8s cluster (e.g., RKE2 cluster) created by the [Harvester node driver](./rancher/node/node-driver.md) is a distinct entity from a Harvester cluster. A guest cluster operates within VMs and requires pulling images either from the internet or a [private registry](https://ranchermanager.docs.rancher.com/how-to-guides/new-user-guides/authentication-permissions-and-global-configuration/global-default-private-registry#configure-a-private-registry-with-credentials-when-creating-a-cluster).

If the **Cloud Provider** option is configured to **Harvester** in a guest K8s cluster, it deploys the Harvester cloud provider and Container Storage Interface (CSI) driver.

![cluster-registry](/img/v1.2/cluster-registry.png)

As a result, we recommend monitoring each [RKE2 release](https://github.com/rancher/rke2/releases) in your air gapped environment and pulling the required images into your private registry. Please refer to the **Harvester CCM & CSI Driver** with RKE2 Releases section on the [Harvester support matrix page](https://www.suse.com/suse-harvester/support-matrix/all-supported-versions/harvester-v1-1-2/) for the best Harvester cloud provider and CSI driver capability support.
As a result, we recommend monitoring each [RKE2 release](https://github.com/rancher/rke2/releases) in your air gapped environment and pulling the required images into your private registry. Please refer to the **Harvester CCM & CSI Driver** with RKE2 Releases section on the [Harvester support matrix page](https://www.suse.com/suse-harvester/support-matrix/all-supported-versions/harvester-v1-1-2/) for the best Harvester cloud provider and CSI driver capability support.

## Integrate with External Rancher

When importing Harvester to an external Rancher, the rancher-agent image is decided by the external Rancher. The image may not be included in the Harvester ISO. In this case, you need to pull the rancher-agent image from the internet and load it on each node or push it to the Harvester cluster's registry.

```bash
# on a computer which can reach the internet and harvester cluster
docker pull rancher/rancher-agent:<version>
docker save rancher/rancher-agent:<version> -o rancher-agent-<version>.tar

# copy image tar file to the air-gapped environment
scp rancher-agent-<version>.tar rancher@<harvester-node-ip>:/tmp

# ssh to the harvester node and load the image
ssh rancher@<harvester-node-ip>
sudo -i
docker load -i /tmp/rancher-agent-<version>.tar
```
19 changes: 14 additions & 5 deletions docs/rancher/rancher-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ If you prefer, the following guide will take you through the same process in ind

## Virtualization management

With Rancher's virtualization management feature, you can import and manage your Harvester cluster. By clicking one of the imported clusters, you can easily access and manage a range of Harvester cluster resources, including hosts, VMs, images, volumes, and more.
With Rancher's virtualization management feature, you can import and manage your Harvester cluster. By clicking one of the imported clusters, you can easily access and manage a range of Harvester cluster resources, including hosts, VMs, images, volumes, and more.
Additionally, the virtualization management feature leverages Rancher's existing capabilities, such as authentication with various auth providers and multi-tenancy support.

For in-depth insights, please refer to the [virtualization management](./virtualization-management.md) page.
Expand Down Expand Up @@ -129,7 +129,7 @@ The Rancher feature `harvester-baremetal-container-workload` must be enabled.

![](/img/v1.3/rancher/continuous-delivery-overview.png)

1. (Optional) On the **Clusters** tab, edit the Fleet cluster config to add labels that can be used to group Harvester clusters.
1. (Optional) On the **Clusters** tab, edit the Fleet cluster config to add labels that can be used to group Harvester clusters.

In this example, the label `location=private-dc` was added.

Expand All @@ -152,12 +152,21 @@ The Rancher feature `harvester-baremetal-container-workload` must be enabled.

![](/img/v1.3/rancher/gitrepo-definition.png)

1. Click **Next**, and then define the Git repo targets. You can select all clusters, an individual cluster, or a group of clusters.
1. Click **Next**, and then define the Git repo targets. You can select all clusters, an individual cluster, or a group of clusters.

In this example, the cluster group named `private-dc-clusters` is used.

![](/img/v1.3/rancher/gitrepo-targets.png)
![](/img/v1.3/rancher/gitrepo-targets.png)

1. Click **Save**. It may take a few seconds for the resources to be rolled out to the target clusters.

![](/img/v1.3/rancher/gitrepo-synced.png)
![](/img/v1.3/rancher/gitrepo-synced.png)

## Work with prime Rancher

The prime Rancher uses different registry. If there is no `CATTLE_AGENT_IMAGE` environment variable, the default value uses `docker.io` as default registry whick makes the Harvester can't get correct rancher-agent image. You need to set the `CATTLE_AGENT_IMAGE` environment variable to the correct registry.

Example:
```bash
docker run --privileged -d --name=rancher --restart=unless-stopped -p 8080:80 -p 6443:443 -e CATTLE_AGENT_IMAGE=<registry>/rancher/rancher-agent:v2.8.10 <registry>/rancher/rancher:v2.8.10
```
24 changes: 21 additions & 3 deletions versioned_docs/version-v1.3/airgap.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,30 @@ When the nodes in the cluster do not use a proxy to communicate with each other,

## Guest Cluster Images

All necessary images to install and run Harvester are conveniently packaged into the ISO, eliminating the need to pre-load images on bare-metal nodes. A Harvester cluster manages them independently and effectively behind the scenes.
All necessary images to install and run Harvester are conveniently packaged into the ISO, eliminating the need to pre-load images on bare-metal nodes. A Harvester cluster manages them independently and effectively behind the scenes.

However, it's essential to understand a guest K8s cluster (e.g., RKE2 cluster) created by the [Harvester node driver](./rancher/node/node-driver.md) is a distinct entity from a Harvester cluster. A guest cluster operates within VMs and requires pulling images either from the internet or a [private registry](https://ranchermanager.docs.rancher.com/how-to-guides/new-user-guides/authentication-permissions-and-global-configuration/global-default-private-registry#configure-a-private-registry-with-credentials-when-creating-a-cluster).
However, it's essential to understand a guest K8s cluster (e.g., RKE2 cluster) created by the [Harvester node driver](./rancher/node/node-driver.md) is a distinct entity from a Harvester cluster. A guest cluster operates within VMs and requires pulling images either from the internet or a [private registry](https://ranchermanager.docs.rancher.com/how-to-guides/new-user-guides/authentication-permissions-and-global-configuration/global-default-private-registry#configure-a-private-registry-with-credentials-when-creating-a-cluster).

If the **Cloud Provider** option is configured to **Harvester** in a guest K8s cluster, it deploys the Harvester cloud provider and Container Storage Interface (CSI) driver.

![cluster-registry](/img/v1.2/cluster-registry.png)

As a result, we recommend monitoring each [RKE2 release](https://github.com/rancher/rke2/releases) in your air gapped environment and pulling the required images into your private registry. Please refer to the **Harvester CCM & CSI Driver** with RKE2 Releases section on the [Harvester support matrix page](https://www.suse.com/suse-harvester/support-matrix/all-supported-versions/harvester-v1-1-2/) for the best Harvester cloud provider and CSI driver capability support.
As a result, we recommend monitoring each [RKE2 release](https://github.com/rancher/rke2/releases) in your air gapped environment and pulling the required images into your private registry. Please refer to the **Harvester CCM & CSI Driver** with RKE2 Releases section on the [Harvester support matrix page](https://www.suse.com/suse-harvester/support-matrix/all-supported-versions/harvester-v1-1-2/) for the best Harvester cloud provider and CSI driver capability support.

## Integrate with External Rancher

When importing Harvester to an external Rancher, the rancher-agent image is decided by the external Rancher. The image may not be included in the Harvester ISO. In this case, you need to pull the rancher-agent image from the internet and load it on each node or push it to the Harvester cluster's registry.

```bash
# on a computer which can reach the internet and harvester cluster
docker pull rancher/rancher-agent:<version>
docker save rancher/rancher-agent:<version> -o rancher-agent-<version>.tar

# copy image tar file to the air-gapped environment
scp rancher-agent-<version>.tar rancher@<harvester-node-ip>:/tmp

# ssh to the harvester node and load the image
ssh rancher@<harvester-node-ip>
sudo -i
docker load -i /tmp/rancher-agent-<version>.tar
```
19 changes: 14 additions & 5 deletions versioned_docs/version-v1.3/rancher/rancher-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ If you prefer, the following guide will take you through the same process in ind

## Virtualization management

With Rancher's virtualization management feature, you can import and manage your Harvester cluster. By clicking one of the imported clusters, you can easily access and manage a range of Harvester cluster resources, including hosts, VMs, images, volumes, and more.
With Rancher's virtualization management feature, you can import and manage your Harvester cluster. By clicking one of the imported clusters, you can easily access and manage a range of Harvester cluster resources, including hosts, VMs, images, volumes, and more.
Additionally, the virtualization management feature leverages Rancher's existing capabilities, such as authentication with various auth providers and multi-tenancy support.

For in-depth insights, please refer to the [virtualization management](./virtualization-management.md) page.
Expand Down Expand Up @@ -129,7 +129,7 @@ The Rancher feature `harvester-baremetal-container-workload` must be enabled.

![](/img/v1.3/rancher/continuous-delivery-overview.png)

1. (Optional) On the **Clusters** tab, edit the Fleet cluster config to add labels that can be used to group Harvester clusters.
1. (Optional) On the **Clusters** tab, edit the Fleet cluster config to add labels that can be used to group Harvester clusters.

In this example, the label `location=private-dc` was added.

Expand All @@ -152,12 +152,21 @@ The Rancher feature `harvester-baremetal-container-workload` must be enabled.

![](/img/v1.3/rancher/gitrepo-definition.png)

1. Click **Next**, and then define the Git repo targets. You can select all clusters, an individual cluster, or a group of clusters.
1. Click **Next**, and then define the Git repo targets. You can select all clusters, an individual cluster, or a group of clusters.

In this example, the cluster group named `private-dc-clusters` is used.

![](/img/v1.3/rancher/gitrepo-targets.png)
![](/img/v1.3/rancher/gitrepo-targets.png)

1. Click **Save**. It may take a few seconds for the resources to be rolled out to the target clusters.

![](/img/v1.3/rancher/gitrepo-synced.png)
![](/img/v1.3/rancher/gitrepo-synced.png)

## Work with prime Rancher

The prime Rancher uses different registry. If there is no `CATTLE_AGENT_IMAGE` environment variable, the default value uses `docker.io` as default registry whick makes the Harvester can't get correct rancher-agent image. You need to set the `CATTLE_AGENT_IMAGE` environment variable to the correct registry.

Example:
```bash
docker run --privileged -d --name=rancher --restart=unless-stopped -p 8080:80 -p 6443:443 -e CATTLE_AGENT_IMAGE=<registry>/rancher/rancher-agent:v2.8.10 <registry>/rancher/rancher:v2.8.10
```
18 changes: 18 additions & 0 deletions versioned_docs/version-v1.4/airgap.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,24 @@ If the **Cloud Provider** option is configured to **Harvester** in a guest K8s c

As a result, we recommend monitoring each [RKE2 release](https://github.com/rancher/rke2/releases) in your air gapped environment and pulling the required images into your private registry. Please refer to the **Harvester CCM & CSI Driver** with RKE2 Releases section on the [Harvester support matrix page](https://www.suse.com/suse-harvester/support-matrix/all-supported-versions/harvester-v1-1-2/) for the best Harvester cloud provider and CSI driver capability support.

## Integrate with External Rancher

When importing Harvester to an external Rancher, the rancher-agent image is decided by the external Rancher. The image may not be included in the Harvester ISO. In this case, you need to pull the rancher-agent image from the internet and load it on each node or push it to the Harvester cluster's registry.

```bash
# on a computer which can reach the internet and harvester cluster
docker pull rancher/rancher-agent:<version>
docker save rancher/rancher-agent:<version> -o rancher-agent-<version>.tar

# copy image tar file to the air-gapped environment
scp rancher-agent-<version>.tar rancher@<harvester-node-ip>:/tmp

# ssh to the harvester node and load the image
ssh rancher@<harvester-node-ip>
sudo -i
docker load -i /tmp/rancher-agent-<version>.tar
```

## Known issues

---
Expand Down
19 changes: 14 additions & 5 deletions versioned_docs/version-v1.4/rancher/rancher-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ If you prefer, the following guide will take you through the same process in ind

## Virtualization management

With Rancher's virtualization management feature, you can import and manage your Harvester cluster. By clicking one of the imported clusters, you can easily access and manage a range of Harvester cluster resources, including hosts, VMs, images, volumes, and more.
With Rancher's virtualization management feature, you can import and manage your Harvester cluster. By clicking one of the imported clusters, you can easily access and manage a range of Harvester cluster resources, including hosts, VMs, images, volumes, and more.
Additionally, the virtualization management feature leverages Rancher's existing capabilities, such as authentication with various auth providers and multi-tenancy support.

For in-depth insights, please refer to the [virtualization management](./virtualization-management.md) page.
Expand Down Expand Up @@ -129,7 +129,7 @@ The Rancher feature `harvester-baremetal-container-workload` must be enabled.

![](/img/v1.3/rancher/continuous-delivery-overview.png)

1. (Optional) On the **Clusters** tab, edit the Fleet cluster config to add labels that can be used to group Harvester clusters.
1. (Optional) On the **Clusters** tab, edit the Fleet cluster config to add labels that can be used to group Harvester clusters.

In this example, the label `location=private-dc` was added.

Expand All @@ -152,12 +152,21 @@ The Rancher feature `harvester-baremetal-container-workload` must be enabled.

![](/img/v1.3/rancher/gitrepo-definition.png)

1. Click **Next**, and then define the Git repo targets. You can select all clusters, an individual cluster, or a group of clusters.
1. Click **Next**, and then define the Git repo targets. You can select all clusters, an individual cluster, or a group of clusters.

In this example, the cluster group named `private-dc-clusters` is used.

![](/img/v1.3/rancher/gitrepo-targets.png)
![](/img/v1.3/rancher/gitrepo-targets.png)

1. Click **Save**. It may take a few seconds for the resources to be rolled out to the target clusters.

![](/img/v1.3/rancher/gitrepo-synced.png)
![](/img/v1.3/rancher/gitrepo-synced.png)

## Work with prime Rancher

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

our doc doesn't suggest using the docker way to deploy Rancher, does Helm deployment need this?

The prime Rancher uses different registry. If there is no `CATTLE_AGENT_IMAGE` environment variable, the default value uses `docker.io` as default registry whick makes the Harvester can't get correct rancher-agent image. You need to set the `CATTLE_AGENT_IMAGE` environment variable to the correct registry.

Example:
```bash
docker run --privileged -d --name=rancher --restart=unless-stopped -p 8080:80 -p 6443:443 -e CATTLE_AGENT_IMAGE=<registry>/rancher/rancher-agent:v2.8.10 <registry>/rancher/rancher:v2.8.10
```
Loading