Distributing eG Container Agent Image via Private Container Registry
When deploying an eG container agent on a Kubernetes node/Docker host, the eG deployment YAML directly pulls the container image from the Docker hub by default. This works well where the target Kubernetes nodes/Docker hosts have outbound internet access.
In high-security environments however, strict firewall policies may restrict internet access to the target nodes. In such environments naturally, the Docker hub may be inaccessible to the deployment YAML. In such a case, to install the eG container agent, you can maintain the container image in a locally available, easily accessible private container registry, and allow the YAML access to that registry. Some of the most popular registries are, namely - Harbor, Nexus, Artifactory, AWS ECR, Azure ACR, Google Artifact Registry, OpenShift Image Registry, Private Docker Registry, etc. Also, when using private registries, container agents are deployed faster, and with minimal bandwidth usage.
However, before you attempt to distribute the container agent image via a private registry, you need to make sure that the following requirements are fulfilled:
-
Identify a Docker host / Kubernetes node in the environment with internet access
To check if Docker is installed on the said host, login to that host, and then issue the following command:
docker --version
If this command returns a valid docker version, it is a clear sign that Docker is installed on the target.
-
The private container registry should be accessible from the target Docker host / Kubernetes node
Once the aforesaid pre-requisites are in place, proceed to distribute the container agent image using the procedure outlined below:
-
Login to the Docker host / Kubernetes node that has been identified specifically for this process.
-
Go to the Shell prompt and issue the following command to pull the container agent image from the Docker hub:
docker pull eginnovations/agent:7.5.4
-
Next, login to the private container registry by issuing a command of the following format:
docker login <private_registry_URL>
For instance, say you want to login to the registry with the URL registry.customer.local. In this case, the command will be as follows:
docker login registry.customer.local
-
To push an image to a private container registry, you must tag the image with the registry's full login URL or domain name. Because private registries lack the default shorthand shortcuts of Docker Hub, the registry path must be explicitly prepended to the image name so Docker knows exactly where to route the traffic. For this, issue the following command at the prompt:
docker tag eginnovations/agent:7.5.4 <private_registry_URL>/eginnovations/agent:7.5.4
For example:
docker tag eginnovations/agent:7.5.4 registry.customer.local/eginnovations/agent:7.5.4
-
Now, push the image to the private registry using the following command:
docker push <private_registry_URL>/eginnovations/agent:7.5.4
For example:
docker push registry.customer.local/eginnovations/agent:7.5.4
-
Next, check if the 'push' was successful. For that, you need to verify whether/not the image you pushed is available in the private registry. You can achieve this by attempting to pull the image from the private registry by issuing the following command:
docker pull registry.customer.local/eginnovations/agent:7.5.4
-
If the above command confirms that the image is available in the private registry, then proceed to update the registry URL in the deployment YAML. For that, do the following:
-
Login to the eG administrative interface.
-
When Figure 1 appears, click the Discover/Monitor
icon in the left panel (as indicated by Figure 1).
-
Figure 2 will then appear. Click on Kubernetes and Containers in Figure 2.
-
Figure 3 will then appear. Pick the option highlighted by Figure 3 to proceed.
-
This will invoke Figure 4. Select the Kubernetes Cluster, Nodes, Applications option from Figure 4.
-
Figure 5 will then appear. Pick the Modify Existing Kubernetes Cluster option, and then proceed to select the cluster you want to modify from the Select a Cluster name drop-down. Then, click the Next button to continue.
-
This will invoke Figure 6. Scroll down the page to view the Container Image Details section. Click on the < Show advanced setting button in that section, so that the container image settings become visible.
Figure 6 : Unhiding the advanced settings of the Container Image Details section
-
By default, docker.io will be displayed as the Registry URL. This is the URL of the Docker hub. Change it to the URL of the private container registry, as shown by Figure 6.
-
Click Next in Figure 6 to invoke Figure 7. Click on the Download YAML button in Figure 7 to download the YAML updated with the new registry URL.
-
Finally, deploy the YAML on each of the target Kubernetes nodes / Docker hosts, so that the container agent gets installed.
-
Note:
Follow the same procedure discussed above, if you want to use a private registry for distributing images of the eG universal agent, Java Profiler, NodeJS Profiler, and APM Profiler.