Skip to content

Commit

Permalink
docs: add note to change Longhorn images to reference harbor (#2497)
Browse files Browse the repository at this point in the history
* docs: add requirement to change longhorn image base URL

* Update docs/docs-content/integrations/longhorn.md

* Update docs/docs-content/integrations/longhorn.md

* move procedure to usage

* fix syntax issue

---------

Co-authored-by: Lenny Chen <[email protected]>
  • Loading branch information
lennessyy and lennessyy authored Mar 29, 2024
1 parent 2ee6843 commit 3311d43
Showing 1 changed file with 136 additions and 0 deletions.
136 changes: 136 additions & 0 deletions docs/docs-content/integrations/longhorn.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ The following known issues exist in the Longhorn 1.5.X release.
[known issue](https://github.com/longhorn/longhorn/issues/6962) in the Longhorn GitHub repository and a fix is on the
roadmap.

- Using Longhorn together in airgap environments with an external registry requires you to update the Longhorn pack
image references to use the base URL of the Harbor registry. For more information, refer to
[Longhorn Deployer Stuck in Init State in Airgap Environments](#using-longhorn-with-harbor-registry-in-airgap-environments).

</TabItem>

<TabItem label="1.4.x" value="1.4.x">
Expand Down Expand Up @@ -136,6 +140,72 @@ when learning how to use Longhorn.
We also recommend you check out the [Examples](https://longhorn.io/docs/1.4.4/references/examples/) section of the
Longhorn documentation. The examples section contains several use cases of how to configure Longhorn.

### Using Longhorn with Harbor Registry in Airgap Environments

When you use the Longhorn pack in an airgapped environment, the Harbor Edge-Native Config pack is required for your
cluster to function. However, you must change the image references in the Longhorn pack to use the base URL of the local
Harbor registry. Otherwise, the cluster will fail to deploy, with the `longhorn-driver-deployer` pod stuck in the `Init`
state.

1. Log in to Palette.

2. From the left **Main Menu**, select **Profiles**.

3. Select the cluster profile you use to deploy the cluster with Longhorn.

4. In the pack YAML for the Longhorn pack, replace the base URL of each image referenced in the pack with the Harbor
registry.

For example, the following is a snippet of the Longhorn pack's YAML before and after you replace the base URL.

<Tabs>

<TabItem label="Before Replacement" value="before">

```yaml
pack:
namespace: "longhorn-system"
namespaceLabels:
"longhorn-system":
"pod-security.kubernetes.io/enforce=privileged,pod-security.kubernetes.io/enforce-version=v{{
.spectro.system.kubernetes.version | substr 0 4 }}"
content:
images:
- image: gcr.io/spectro-images-public/packs/csi-longhorn/1.5.3/longhorn-engine:v1.5.3
- image: gcr.io/spectro-images-public/packs/csi-longhorn/1.5.3/longhorn-manager:v1.5.3
- image: gcr.io/spectro-images-public/packs/csi-longhorn/1.5.3/longhorn-ui:v1.5.3
- image: gcr.io/spectro-images-public/packs/csi-longhorn/1.5.3/longhorn-instance-manager:v1.5.3
- image: gcr.io/spectro-images-public/packs/csi-longhorn/1.5.3/longhorn-share-manager:v1.5.3
```
</TabItem>
<TabItem label="After Replacement" value="after">
```yaml
pack:
namespace: "longhorn-system"
namespaceLabels:
"longhorn-system":
"pod-security.kubernetes.io/enforce=privileged,pod-security.kubernetes.io/enforce-version=v{{
.spectro.system.kubernetes.version | substr 0 4 }}"
content:
images:
- image: 10.10.137.220:30003/spectro-images-public/packs/csi-longhorn/1.5.3/longhorn-engine:v1.5.3
- image: 10.10.137.220:30003/spectro-images-public/packs/csi-longhorn/1.5.3/longhorn-manager:v1.5.3
- image: 10.10.137.220:30003/spectro-images-public/packs/csi-longhorn/1.5.3/longhorn-ui:v1.5.3
- image: 10.10.137.220:30003/spectro-images-public/packs/csi-longhorn/1.5.3/longhorn-instance-manager:v1.5.3
- image: 10.10.137.220:30003/spectro-images-public/packs/csi-longhorn/1.5.3/longhorn-share-manager:v1.5.3
```
</TabItem>
</Tabs>
Refer to [Harbor Edge-Native Config](./harbor-edge.md#log-in-to-harbor-web-ui) pack documentation to learn how to
find the node IP and port of the Harbor registry. If you have given the registry a domain name, you can use the
domain name instead of the node IP.
</TabItem>
<TabItem label="1.3.x" value="1.3.x">
Expand Down Expand Up @@ -188,6 +258,72 @@ when learning how to use Longhorn.
We also recommend you check out the [Examples](https://longhorn.io/docs/1.4.4/references/examples/) section of the
Longhorn documentation. The examples section contains several use cases of how to configure Longhorn.

### Using Longhorn with Harbor Registry in Airgap Environments

When you use the Longhorn pack in an airgapped environment, the Harbor Edge-Native Config pack is required for your
cluster to function. However, you must change the image references in the Longhorn pack to use the base URL of the local
Harbor registry. Otherwise, the cluster will fail to deploy, with the `longhorn-driver-deployer` pod stuck in the `Init`
state.

1. Log in to Palette.

2. From the left **Main Menu**, select **Profiles**.

3. Select the cluster profile you use to deploy the cluster with Longhorn.

4. In the pack YAML for the Longhorn pack, replace the base URL of each image referenced in the pack with the Harbor
registry.

For example, the following is a snipped of the Longhorn pack's YAML before and after you replace the base URL:

<Tabs>

<TabItem label="Before Replacement" value="before">

```yaml
pack:
namespace: "longhorn-system"
namespaceLabels:
"longhorn-system":
"pod-security.kubernetes.io/enforce=privileged,pod-security.kubernetes.io/enforce-version=v{{
.spectro.system.kubernetes.version | substr 0 4 }}"
content:
images:
- image: gcr.io/spectro-images-public/packs/csi-longhorn/1.5.3/longhorn-engine:v1.5.3
- image: gcr.io/spectro-images-public/packs/csi-longhorn/1.5.3/longhorn-manager:v1.5.3
- image: gcr.io/spectro-images-public/packs/csi-longhorn/1.5.3/longhorn-ui:v1.5.3
- image: gcr.io/spectro-images-public/packs/csi-longhorn/1.5.3/longhorn-instance-manager:v1.5.3
- image: gcr.io/spectro-images-public/packs/csi-longhorn/1.5.3/longhorn-share-manager:v1.5.3
```

</TabItem>

<TabItem label="After Replacement" value="after">

```yaml
pack:
namespace: "longhorn-system"
namespaceLabels:
"longhorn-system":
"pod-security.kubernetes.io/enforce=privileged,pod-security.kubernetes.io/enforce-version=v{{
.spectro.system.kubernetes.version | substr 0 4 }}"
content:
images:
- image: 10.10.137.220:30003/spectro-images-public/packs/csi-longhorn/1.5.3/longhorn-engine:v1.5.3
- image: 10.10.137.220:30003/spectro-images-public/packs/csi-longhorn/1.5.3/longhorn-manager:v1.5.3
- image: 10.10.137.220:30003/spectro-images-public/packs/csi-longhorn/1.5.3/longhorn-ui:v1.5.3
- image: 10.10.137.220:30003/spectro-images-public/packs/csi-longhorn/1.5.3/longhorn-instance-manager:v1.5.3
- image: 10.10.137.220:30003/spectro-images-public/packs/csi-longhorn/1.5.3/longhorn-share-manager:v1.5.3
```

</TabItem>

</Tabs>

Refer to [Harbor Edge-Native Config](./harbor-edge.md#log-in-to-harbor-web-ui) pack documentation to learn how to
find the node IP and port of the Harbor registry. If you have given the registry a domain name, you can use the
domain name instead of the node IP.

</TabItem>
</Tabs>

Expand Down

0 comments on commit 3311d43

Please sign in to comment.