Setting up a temporary image registry
When creating a cluster, Neutree requires an image registry to distribute container images to cluster nodes. If no image registry (such as Harbor or Docker Hub) is available in the customer environment, the cluster cannot be created or deployed normally. This section describes how to quickly set up a temporary image registry on a control plane node by using Docker’s official registry:2 image, and use it as the image distribution source for cluster deployment.
Prerequisites
Section titled “Prerequisites”Confirm that the control plane node meets the following requirements:
- Docker is installed.
- Network connectivity with cluster nodes is established.
Step 1: Start the Registry service
Section titled “Step 1: Start the Registry service”-
If the control plane node can pull the
registry:2image from Docker Hub, proceed to the next step to start the local Registry service. If the control plane node cannot pull theregistry:2image from Docker Hub, perform the following:-
Export the image in an environment with internet access:
Terminal window docker pull registry:2docker save registry:2 -o registry-image.tar -
Transfer
registry-image.tarto the control plane node and load it:Terminal window docker load -i registry-image.tar
-
-
Run the following command on the control plane node to start a local Registry service:
Terminal window mkdir -p /data/registrydocker run -d \--name registry \--restart always \-p 5000:5000 \-v /data/registry:/var/lib/registry \registry:2 -
Verify that the Registry service is running:
Terminal window curl http://localhost:5000/v2/The expected response is
{}, indicating that the Registry service has started successfully.
Step 2: Configure the control plane node and cluster nodes to trust the registry
Section titled “Step 2: Configure the control plane node and cluster nodes to trust the registry”Because the temporary registry uses HTTP (not HTTPS), refer to Using an insecure image registry to configure an insecure registry on all control plane nodes and cluster nodes.
Step 3: Upload cluster offline images
Section titled “Step 3: Upload cluster offline images”Use the Neutree CLI tool to upload the cluster offline images to the temporary Registry:
./neutree-cli-<arch> import cluster \ --package <cluster_package> \ --mirror-registry <control_plane_ip>:5000 \ --registry-username test \ --registry-password test| Parameter | Description |
|---|---|
<arch> | CPU architecture of the server. Valid values: amd64 or arm64. |
<cluster_package> | Name of the cluster offline image. |
<control_plane_ip> | IP address of the control plane node. |
Step 4: Configure the image registry in Neutree
Section titled “Step 4: Configure the image registry in Neutree”-
Log in to the Neutree management interface, click Image Registries in the left navigation pane, and click Create.
-
Set URL to
http://<control_plane_ip>:5000. For other parameters, see Creating an image registry. -
Click Save.
After the configuration is complete, you can select this image registry when creating a cluster.