diff --git a/README.md b/README.md index 6235ac263d..1a70c265f3 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,7 @@ | [nats](./images/nats) | `cgr.dev/chainguard/nats` | experimental | [![](https://storage.googleapis.com/chainguard-images-build-outputs/badges/nats.build.status.latest-dev.svg)](https://registry-ui.chainguard.app/?image=cgr.dev/chainguard/nats:latest-dev)
[![](https://storage.googleapis.com/chainguard-images-build-outputs/badges/nats.build.status.latest.svg)](https://registry-ui.chainguard.app/?image=cgr.dev/chainguard/nats:latest) | | [netcat](./images/netcat) | `cgr.dev/chainguard/netcat` | experimental | [![](https://storage.googleapis.com/chainguard-images-build-outputs/badges/netcat.build.status.latest.svg)](https://registry-ui.chainguard.app/?image=cgr.dev/chainguard/netcat:latest) | | [newrelic-fluent-bit-output](./images/newrelic-fluent-bit-output) | `cgr.dev/chainguard/newrelic-fluent-bit-output` | stable | [![](https://storage.googleapis.com/chainguard-images-build-outputs/badges/newrelic-fluent-bit-output.build.status.latest-dev.svg)](https://registry-ui.chainguard.app/?image=cgr.dev/chainguard/newrelic-fluent-bit-output:latest-dev)
[![](https://storage.googleapis.com/chainguard-images-build-outputs/badges/newrelic-fluent-bit-output.build.status.latest.svg)](https://registry-ui.chainguard.app/?image=cgr.dev/chainguard/newrelic-fluent-bit-output:latest) | +| [newrelic-infrastructure-bundle](./images/newrelic-infrastructure-bundle) | `cgr.dev/chainguard/newrelic-infrastructure-bundle` | stable | [![](https://storage.googleapis.com/chainguard-images-build-outputs/badges/newrelic-infrastructure-bundle.build.status.latest-dev.svg)](https://registry-ui.chainguard.app/?image=cgr.dev/chainguard/newrelic-infrastructure-bundle:latest-dev)
[![](https://storage.googleapis.com/chainguard-images-build-outputs/badges/newrelic-infrastructure-bundle.build.status.latest.svg)](https://registry-ui.chainguard.app/?image=cgr.dev/chainguard/newrelic-infrastructure-bundle:latest) | | [newrelic-k8s-events-forwarder](./images/newrelic-k8s-events-forwarder) | `cgr.dev/chainguard/newrelic-k8s-events-forwarder` | stable | [![](https://storage.googleapis.com/chainguard-images-build-outputs/badges/newrelic-k8s-events-forwarder.build.status.latest-dev.svg)](https://registry-ui.chainguard.app/?image=cgr.dev/chainguard/newrelic-k8s-events-forwarder:latest-dev)
[![](https://storage.googleapis.com/chainguard-images-build-outputs/badges/newrelic-k8s-events-forwarder.build.status.latest.svg)](https://registry-ui.chainguard.app/?image=cgr.dev/chainguard/newrelic-k8s-events-forwarder:latest) | | [newrelic-prometheus-configurator](./images/newrelic-prometheus-configurator) | `cgr.dev/chainguard/newrelic-prometheus-configurator` | stable | [![](https://storage.googleapis.com/chainguard-images-build-outputs/badges/newrelic-prometheus-configurator.build.status.latest-dev.svg)](https://registry-ui.chainguard.app/?image=cgr.dev/chainguard/newrelic-prometheus-configurator:latest-dev)
[![](https://storage.googleapis.com/chainguard-images-build-outputs/badges/newrelic-prometheus-configurator.build.status.latest.svg)](https://registry-ui.chainguard.app/?image=cgr.dev/chainguard/newrelic-prometheus-configurator:latest) | | [nginx](./images/nginx) | `cgr.dev/chainguard/nginx` | stable | [![](https://storage.googleapis.com/chainguard-images-build-outputs/badges/nginx.build.status.latest-dev.svg)](https://registry-ui.chainguard.app/?image=cgr.dev/chainguard/nginx:latest-dev)
[![](https://storage.googleapis.com/chainguard-images-build-outputs/badges/nginx.build.status.latest.svg)](https://registry-ui.chainguard.app/?image=cgr.dev/chainguard/nginx:latest)
[![](https://storage.googleapis.com/chainguard-images-build-outputs/badges/nginx.build.status.next.svg)](https://registry-ui.chainguard.app/?image=cgr.dev/chainguard/nginx:next) | diff --git a/images/newrelic-infrastructure-bundle/README.md b/images/newrelic-infrastructure-bundle/README.md new file mode 100644 index 0000000000..e941dd0d98 --- /dev/null +++ b/images/newrelic-infrastructure-bundle/README.md @@ -0,0 +1,49 @@ + +# newrelic-infrastructure-bundle +| | | +| - | - | +| **Status** | stable | +| **OCI Reference** | `cgr.dev/chainguard/newrelic-infrastructure-bundle` | + + +* [View Image in Chainguard Academy](https://edu.chainguard.dev/chainguard/chainguard-images/reference/newrelic-infrastructure-bundle/overview/) +* [View Image Catalog](https://console.enforce.dev/images/catalog) for a full list of available tags. +*[Contact Chainguard](https://www.chainguard.dev/chainguard-images) for enterprise support, SLAs, and access to older tags.* + +--- + + +Minimal [newrelic-infrastructure-bundle](https://github.com/newrelic/infrastructure-bundle) container image. + +## Get It + +The image is available on `cgr.dev`: + +``` +docker pull cgr.dev/chainguard/newrelic-infrastructure-bundle +``` + +## Usage + +This image is a drop-in replacement for the `newrelic-infrastructure-bundle` project that image known as and available upstream at `newrelic/infrastructure-bundle`. + +You can run this in Helm with: + +```shell +helm repo add nri-kubernetes https://newrelic.github.io/nri-kubernetes + +helm upgrade --install newrelic-infrastructure-bundle nri-kubernetes/newrelic-infrastructure \ + --set images.agent.registry=cgr.dev \ + --set images.agent.repository=chainguard/newrelic-infrastructure-bundle \ + --set images.agent.tag=latest \ + --set images.integration.registry=cgr.dev \ + --set images.integration.repository=chainguard/nri-kube-events \ + --set images.integration.tag="latest" \ + --set cluster=$CLUSTER --set licenseKey=$LICENSE_KEY +``` + +NOTE: This image requires a license key to run properly, which you can obtain from New Relic. + +## Testing + +The tests for this image also require a license key, which is configured in a secret in Github Actions. diff --git a/images/newrelic-infrastructure-bundle/configs/latest.apko.yaml b/images/newrelic-infrastructure-bundle/configs/latest.apko.yaml new file mode 100644 index 0000000000..89a11f35ba --- /dev/null +++ b/images/newrelic-infrastructure-bundle/configs/latest.apko.yaml @@ -0,0 +1,30 @@ +contents: + keyring: + - https://packages.wolfi.dev/os/wolfi-signing.rsa.pub + repositories: + - https://packages.wolfi.dev/os + packages: + - ca-certificates-bundle + - wolfi-baselayout + - openjdk-8 + - newrelic-infrastructure-agent + - newrelic-infrastructure-bundle + +accounts: + groups: + - groupname: nonroot + gid: 65532 + users: + - username: nonroot + uid: 65532 + gid: 65532 + run-as: 65532 + +archs: +- x86_64 +- aarch64 + +annotations: + "org.opencontainers.image.authors": "Chainguard Team https://www.chainguard.dev/" + "org.opencontainers.image.url": https://edu.chainguard.dev/chainguard/chainguard-images/reference/newrelic-infrastructure-bundle/ + "org.opencontainers.image.source": https://github.com/chainguard-images/images/tree/main/images/newrelic-infrastructure-bundle diff --git a/images/newrelic-infrastructure-bundle/image.yaml b/images/newrelic-infrastructure-bundle/image.yaml new file mode 100644 index 0000000000..f6cc12f893 --- /dev/null +++ b/images/newrelic-infrastructure-bundle/image.yaml @@ -0,0 +1,12 @@ +# Opt-out of the new terraform-based release +terraform: false + +versions: + - apko: + config: configs/latest.apko.yaml + extractTagsFrom: + package: newrelic-infrastructure-bundle + subvariants: + - suffix: -dev + options: + - dev diff --git a/images/newrelic-infrastructure-bundle/tests/01-version.sh b/images/newrelic-infrastructure-bundle/tests/01-version.sh new file mode 100755 index 0000000000..b31e947d4b --- /dev/null +++ b/images/newrelic-infrastructure-bundle/tests/01-version.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +set -o errexit -o nounset -o errtrace -o pipefail -x + +if [[ "${IMAGE_NAME}" == "" ]]; then + echo "Must set IMAGE_NAME environment variable. Exiting." + exit 1 +fi + +docker run --rm "${IMAGE_NAME}" /usr/bin/newrelic-infra --version | grep "New Relic Infrastructure Agent" diff --git a/images/newrelic-infrastructure-bundle/tests/02-helm.sh b/images/newrelic-infrastructure-bundle/tests/02-helm.sh new file mode 100755 index 0000000000..185cff7403 --- /dev/null +++ b/images/newrelic-infrastructure-bundle/tests/02-helm.sh @@ -0,0 +1,51 @@ +#!/usr/bin/env bash + +# monopod:tag:k8s + +set -o errexit -o nounset -o errtrace -o pipefail -x + +function preflight() { + if [[ "${IMAGE_REGISTRY}" == "" ]]; then + echo "Must set IMAGE_REGISTRY environment variable. Exiting." + exit 1 + fi + + if [[ "${IMAGE_REPOSITORY}" == "" ]]; then + echo "Must set IMAGE_REPOSITORY environment variable. Exiting." + exit 1 + fi + + if [[ "${IMAGE_TAG}" == "" ]]; then + echo "Must set IMAGE_TAG environment variable. Exiting." + exit 1 + fi + helm repo add nri-kubernetes https://newrelic.github.io/nri-kubernetes +} + + +function TEST_basic_helm_install() { + helm upgrade \ + --install \ + newrelic-infrastructure-bundle nri-kubernetes/newrelic-infrastructure \ + --set images.agent.registry=${IMAGE_REGISTRY} \ + --set images.agent.repository=${IMAGE_REPOSITORY} \ + --set images.agent.tag=${IMAGE_TAG} \ + --set cluster=test \ + --set licenseKey=${NEW_RELIC_LICENSE_KEY} + + # Wait for helm to catch up + sleep 3 + + if kubectl wait --for=condition=ready pod --selector app.kubernetes.io/instance=newrelic-infrastructure-bundle; then + echo "Success" + else + echo "Failed" + kubectl describe pod --selector app.kubernetes.io/instance=newrelic-infrastructure-bundle + kubectl logs --selector app.kubernetes.io/instance=newrelic-infrastructure-bundle + exit 1 + fi + helm uninstall newrelic-infrastructure-bundle +} + +preflight +TEST_basic_helm_install