Improve Your Synthetics Workflows with Containerized Private Minions



  • A key benefit in New Relic Synthetics is the ability to test your applications globally from any location, including from behind your firewall, using private minions. Until now, our private minions—which receive and manage jobs from Synthetics for each test location you’ve established—have run on virtual machine appliances in VMware’s VSphere or Oracle’s VirtualBox, which limited user configurability, control, speed, and cloud readiness.

    Today, we’re pleased to announce containerized private minions (CPM), private minions that run in Docker containers. By taking advantage of the benefits of container software—and a few enhancements—you can configure, deploy, upgrade, and auto-remediate Synthetics minions with ease, including running CPMs as a non-root user. The Docker sandbox ensures complete isolation of CPMs, improving security, reliability, and repeatability. You also have the ability to containerize your Synthetics checks and run them from your private data center or even on a local machine (such as your laptop). Containerized private minions raise the bar on security, cloud readiness, ease of use, and flexibility.

    Our containerized private minions are now generally available for use.

    Getting started with containerized private minions

    You don’t have to immediately switch your workloads to CPM. If you’re interested in gradually converting from legacy VM-based private minions to CPM, you can run both concurrently. Start deploying CPMs, and run them alongside your legacy private minions, and then retire the older ones as you get more comfortable with the containerized versions.

    To run containerized private minions, you need a Synthetics Pro and a Private locations subscription. Before getting started, review the system requirements and Docker dependencies. You’ll also need a Private Location Key.

    To create a CPM:

    1. Go to synthetics.newrelic.com  > Private locations. Select the appropriate option:
      • To add a new private location, select Add new, and note the Private Location Key.
      • To add minions to an existing location, select the edit icon for that location, and note the Private Location Key.
    2. From the terminal of the Windows, Linux, or Mac OS machine hosting the container, run:docker pull quay.io/newrelic/synthetics-minion:latest 
    3. Start your CPM.On Linux and Mac OS, run:docker run \
      --name [YOUR CONTAINER NAME] \
      -e "MINION_PRIVATE_LOCATION_KEY=[YOUR PRIVATE LOCATION KEY]" \
      -v /tmp:/tmp:rw \
      -v /var/run/docker.sock:/var/run/docker.sock:rw \
      -p 8080:8080 -p 8180:8180 \
      quay.io/newrelic/synthetics-minion:latest

      On Windows, run:
      docker run ^
      --name [YOUR CONTAINER NAME] ^
      -e "MINION_PRIVATE_LOCATION_KEY=[YOUR PRIVATE LOCATION KEY]" ^
      -v /tmp:/tmp:rw ^
      -v /var/run/docker.sock:/var/run/docker.sock:rw ^
      -p 8080:8080 -p 8180:8180 ^
      quay.io/newrelic/synthetics-minion:latest

    You should see a message that your CPM is up and ready to run monitors assigned to that location.

    Note: In these installation examples, we used common defaults for /tmp and /var/run/docker.sock: you should tailor these options to your system, and provide more environment variables to unlock the full potential of CPM.

    (For more about monitoring, securing, and maintaining CPMs, see our CPM documentation.)

    Once your CPMs are deployed and ready to work, it’s fairly easy to start generating useful insights—for example, the page load time comparisons shown below—and to dig deeper when the data indicates a possible issue.

    The benefits of running containerized private minions

    With containerized private minions, we’re bringing a much-needed update to how you manage your private Synthetics locations. More specifically:

    CPMs give you better ease of use, flexibility, and control. Setup, configuration, and upgrades of your CPMs are significantly easier than with legacy minions. As illustrated in the “Getting started with containerized private minions” section above, you can deploy CPMs with a few simple commands.

    With CPMs, you’re in control of the host’s settings and configuration. This means, for example, that you could install a container on a compliant server in your data center and be running CPM in minutes. When you’re ready to upgrade, simply log into the host machine and pull the latest image with dockerpull quay.io/newrelic/synthetics-minion:latest and restart the container.

    CPMs are cloud ready. To run legacy private minions in the cloud, you had to convert the virtual appliance into a format supported by your cloud provider. CPMs, on the other hand, can be deployed wherever you’re hosting containers in the cloud, without any additional configuration. This makes it easier to enable synthetic monitoring from any location your cloud provider supports.

    CPMs are orchestration ready. If you use a container orchestration tool, like Kubernetes, you can use it to manage the containers in which CPM runs. For example, in Kubernetes, describe the end state for your CPM containers (for example, you want two sets of CPM running in your North American East database and two sets running in the West database) and then allow Kubernetes to do the heavy lifting of deploying those containers.

    Containers mean increased security for your minions. Legacy private minions contained an entire operating system that had to be maintained and patched. CPMs expose a narrower attack surface. CPMs contain only a micro-image of our application, so you don’t need to worry about patching dependencies.

    CPMs can be run in multiple locations. You can deploy multiple CPMs on one physical host and have them point to different private locations. For example, you can deploy a container with minions for both staging and production environments, and service different geographic locations with those environments.

    CPMs give you customizable timeouts. With CPMs you can use custom timeouts to extend the lifetime of your scripts. You can now run your scripts for up to 15 minutes for more in-depth synthetic transactions. If you have pre-existing synthetic monitors that you run in UI tests, you can easily transfer those monitors to New Relic without constraint. Longer customizable timeouts let you test apps where users may sit idle on a page for longer than 3 minutes (for example, when watching a video), or test “wait, don’t go” messages your app that might show when idle users haven’t “checked out” their carts.

    Containerized private minions—designed with ease of use in mind

    Since you no longer need to run your minions in a VM—which another team may have to supply and provision for you—you’ll find that CPMs are significantly easier to deploy, run, and upgrade. Security is tighter, as containers require fewer dependencies than a VM, and you can configure and control CPMs directly from your laptop. Finally, CPMs are compatible with any cloud provider offering a Docker-based infrastructure, including Kubernetes orchestration. All of these improvements combine to make CPMs a capability that we’re sure many developers will find extremely useful.

    Go to synthetics.newrelic.com to get started now!





© Lightnetics 2024