This commit is contained in:
martyav
2024-04-05 13:50:54 -04:00
parent 35702127cb
commit ebdaa578d2
@@ -117,84 +117,74 @@ Rancher provides some extensions, such as Kubewarden and Elemental, through the
docker pull rancher/ui-plugin-catalog:1.0.0 docker pull rancher/ui-plugin-catalog:1.0.0
docker tag rancher/ui-plugin-catalog:1.0.0 $REGISTRY_ENDPOINT/rancher/ui-plugin-catalog:1.0.0 docker tag rancher/ui-plugin-catalog:1.0.0 $REGISTRY_ENDPOINT/rancher/ui-plugin-catalog:1.0.0
docker push $REGISTRY_ENDPOINT/rancher/ui-plugin-catalog:1.0.0 docker push $REGISTRY_ENDPOINT/rancher/ui-plugin-catalog:1.0.0
1. Use the mirrored image to create a Kubernetes [deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/): 2. Use the mirrored image to create a Kubernetes [deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/):
```yaml ```yaml
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: ui-plugin-catalog name: ui-plugin-catalog
namespace: cattle-ui-plugin-system namespace: cattle-ui-plugin-system
labels: labels:
catalog.cattle.io/ui-extensions-catalog-image: ui-plugin-catalog
spec:
replicas: 1
selector:
matchLabels:
catalog.cattle.io/ui-extensions-catalog-image: ui-plugin-catalog catalog.cattle.io/ui-extensions-catalog-image: ui-plugin-catalog
template: spec:
metadata: replicas: 1
namespace: cattle-ui-plugin-system selector:
labels: matchLabels:
catalog.cattle.io/ui-extensions-catalog-image: ui-plugin-catalog catalog.cattle.io/ui-extensions-catalog-image: ui-plugin-catalog
spec: template:
containers: metadata:
- name: server namespace: cattle-ui-plugin-system
image: my-private-registry.com/rancher/ui-plugin-catalog:1.0.0 labels:
imagePullPolicy: Always catalog.cattle.io/ui-extensions-catalog-image: ui-plugin-catalog
imagePullSecrets: spec:
- name: my-registry-credentials containers:
``` - name: server
1. Expose the deployment by creating a [ClusterIP service](https://kubernetes.io/docs/concepts/services-networking/service/#type-clusterip): image: my-private-registry.com/rancher/ui-plugin-catalog:1.0.0
```yaml imagePullPolicy: Always
apiVersion: v1 imagePullSecrets:
kind: Service - name: my-registry-credentials
metadata: ```
name: ui-plugin-catalog-svc 3. Expose the deployment by creating a [ClusterIP service](https://kubernetes.io/docs/concepts/services-networking/service/#type-clusterip):
namespace: cattle-ui-plugin-system ```yaml
spec: apiVersion: v1
ports: kind: Service
- name: catalog-svc-port metadata:
port: 8080 name: ui-plugin-catalog-svc
protocol: TCP namespace: cattle-ui-plugin-system
targetPort: 8080 spec:
selector: ports:
catalog.cattle.io/ui-extensions-catalog-image: ui-plugin-catalog - name: catalog-svc-port
type: ClusterIP port: 8080
``` protocol: TCP
1. Create a [ClusterRepo](../how-to-guides/new-user-guides/helm-charts-in-rancher/helm-charts-in-rancher.md) that targets the ClusterIP service: targetPort: 8080
```yaml selector:
apiVersion: catalog.cattle.io/v1 catalog.cattle.io/ui-extensions-catalog-image: ui-plugin-catalog
kind: ClusterRepo type: ClusterIP
metadata: ```
name: ui-plugin-catalog-repo 4. Create a [ClusterRepo](../how-to-guides/new-user-guides/helm-charts-in-rancher/helm-charts-in-rancher.md) that targets the ClusterIP service:
spec: ```yaml
url: http://ui-plugin-catalog-svc.cattle-ui-plugin-system:8080 apiVersion: catalog.cattle.io/v1
``` kind: ClusterRepo
metadata:
name: ui-plugin-catalog-repo
spec:
url: http://ui-plugin-catalog-svc.cattle-ui-plugin-system:8080
```
After you successfully set up these resources, you can install the extensions from the `ui-plugin-charts` manifest into your air-gapped environment. After you successfully set up these resources, you can install the extensions from the `ui-plugin-charts` manifest into your air-gapped environment.
### Importing and Installing Extensions in an Air-gapped Environment ### Importing and Installing Extensions in an Air-gapped Environment
1. Find the address of the container image repository that you want to import as an extension. You should import and use the latest tagged version of the image to ensure you receive the latest features and security updates. 1. Find the address of the container image repository that you want to import as an extension. You should import and use the latest tagged version of the image to ensure you receive the latest features and security updates.
* **(Optional)** If the container image is private: [Create](../how-to-guides/new-user-guides/kubernetes-resources-setup/secrets.md) a registry secret within the `cattle-ui-plugin-system` namespace. Enter the domain of the image address in the **Registry Domain Name** field. * **(Optional)** If the container image is private: [Create](../how-to-guides/new-user-guides/kubernetes-resources-setup/secrets.md) a registry secret within the `cattle-ui-plugin-system` namespace. Enter the domain of the image address in the **Registry Domain Name** field.
1. Click **☰**, then select **Extensions**, under **Configuration**. 1. Click **☰**, then select **Extensions**, under **Configuration**.
1. On the top right, click **⋮ > Manage Extension Catalogs**. 1. On the top right, click **⋮ > Manage Extension Catalogs**.
1. Select the **Import Extension Catalog** button. 1. Select the **Import Extension Catalog** button.
1. Enter the image address in the **Catalog Image Reference** field. 1. Enter the image address in the **Catalog Image Reference** field.
* **(Optional)** If the container image is private, select the secret you just created from the **Pull Secrets** drop-down menu. * **(Optional)** If the container image is private, select the secret you just created from the **Pull Secrets** drop-down menu.
1. Click **Load**. The extension will now be **Pending**. 1. Click **Load**. The extension will now be **Pending**.
1. Return to the **Extensions** page. 1. Return to the **Extensions** page.
1. Select the **Available** tab, and click the **Reload** button to make sure that the list of extensions is up to date. 1. Select the **Available** tab, and click the **Reload** button to make sure that the list of extensions is up to date.
1. Find the extension you just added, and click the **Install** button. 1. Find the extension you just added, and click the **Install** button.
### Updating and Upgrading an Extensions Repository in an Air-gapped Environment ### Updating and Upgrading an Extensions Repository in an Air-gapped Environment