This step-by-step procedure will guide you on how to use the noah agent image. In the picture above, the noah agent are the small NearEDGE logo inside containers that are represented by the Kubernetes icon.
The noah solution enables devOps team member to have access to TCP servers in remote assets. It acts as a classic TCP port forwarder and was developed to easily integrate into any environment. Its zero-touch deployment is CI/CD friendly.
The port forwarding is always using 127.0.0.1 as the target IP address. As such, noah is restricted in accessing local servers at the remote asset.
The NearEDGE noah agent image is flexible and allows various deployment configuration. In this guide we will cover the following use cases:
The noah agent connects to the Access Gateway. Installing and running a gateway is covered by 2 step-by-step guides. One of the guide covers using it in a virtual machine environment, while the other covers the container variant.
NearEDGE provides a noah agent image that was built using a basic alpine image. This base image provides a basic toolset and the MUSL C library. With this image, you can run busybox to inspect files, list processes and do other such small tasks. See the official alpine repository.
The final image is augmented with some fully static binaries. Theses binaries may be extracted and use elsewhere since they do not have any dependency on external libraries of any sort. Here is a list of what was added
The ENTRYPOINT is only configured to start the noah agent. You could, if required, override it with your own command.
The noah image is specific to your organization. In this guide, we will simply refer to it with <image>. You can get a summary of first steps from the container image by running:
docker run <image> --firststepsThis guide wont't cover the use of SSH nor how to enable it. For a discussion about SSH and noah see this guide
Remote access to server(s) listening on the host loopback interface is made easy with noah. Running the noah agent can be as simple as downloading your organization's version of the noah agent from the NearEDGE dashboard, or extracting it from the image and starting it anyway you like.
Alternatively, you can simply use the noah container without modification by attaching it to the host network. Simply use the following command:
docker run --volume <uniquename>:/noah --restart always --detach --net host --name noah <image><uniquename> is a named volume, or a file system path, providing persistence. The noah agent uses it to store information across restart and that are unique to a container instance.
Another use case for the noah image is to run it as a side-car in a pod (in a kubernetes environment) or associated to a main docker container instance. We are not covering the pod case here but will cover the docker use case. Associating a container with another one is analogous to the runtime scenario of a pod where
The following command will start the noah image as an associated container:
docker run --volume <uniquename>:/noah --volumes-from <container name> --restart always --detach --net container:<container name> --name noah <image><container name> is the main container instance name.
--volumes-from <container name> may be omitted if access to mounted volume is unnecessary.
Use --pid container:<container name> (not on the command line above) to attach to the main container process space.
As is the case when connecting to the host network, the <uniquename> is a named volume, or a file system path, providing persistence. The noah agent uses it to store information across restart and that are unique to a container instance.
This mode of operation is useful for accessing server(s) attached by the main container on the loopback interface. You could also enable an SSH server on the noah container (see this guide) and use the tools provided by the alpine base image.
Another method of using noah is to run it directly inside your container. You do this simply by adding the noah agent software and starting it. The main benefits of using this method are:
The process is simple, all you need to do is to reference your noah image and pull the noah agent. Here is a complete example (taken from the debugging python howto).
#
# Get the noah agent
#
# Use the repository specific to YOUR organization - Below is
# just an example
FROM <image> as noah
#
# Test project (final container image)
#
# Use whatever base image suitable for your application.
FROM python:latest
RUN pip3 install flask debugpy
# Remote access is provided by noah
RUN mkdir /noah
COPY --from=noah /opt/ne/chainstart /opt/chainstart
COPY --from=noah /opt/ne/noah /opt/noah
# Actual application
COPY app.py /opt/demo/
#
# Start noah and the demo python code - Using chainstart
#
ENTRYPOINT ["/opt/chainstart", \
"--", "/opt/noah", "--dataloc", "/noah", \
"--", "/usr/local/bin/python3", "-m", "debugpy", \
"--listen", "127.0.0.1:12345", "--wait-for-client", \
"/opt/demo/app.py"]We use chainstart to start both the noah agent as well as the application. You can use other means, such as a bash script, as you see fit. Make sure to start noah with the correct argument(s).
As with the 2 other cases above, you should start the container by providing a volume for the /noah internal path. It could be a named volume, or a file system path. The noah agent uses it to store information across restart and that are unique to a container instance.
To complement this step-by-step procedure, you may find the following guides useful.