Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions .github/workflows/post-release-agent-metadata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Post-Release Agent Metadata Update

on:
release:
types: [released]

jobs:
update-agent-metadata:
name: Update metadata for ${{ matrix.chart }}
runs-on: ubuntu-latest
strategy:
matrix:
include:
- chart: nr-ebpf-agent
agent-type: NReBPFAgent
config-directory: charts/nr-ebpf-agent/.fleetControl
- chart: nri-bundle
agent-type: NRInfra
config-directory: charts/nri-bundle/.fleetControl
- chart: nr-k8s-otel-collector
agent-type: NRDOT
config-directory: charts/nr-k8s-otel-collector/.fleetControl
- chart: newrelic-logging
agent-type: FluentBit
config-directory: charts/newrelic-logging/.fleetControl
- chart: pipeline-control-gateway
agent-type: PipelineControlGateway
config-directory: charts/pipeline-control-gateway/.fleetControl
fail-fast: false

steps:
- name: Check if release matches chart
id: should-run
run: |
TAG="${{ github.event.release.tag_name }}"
CHART="${{ matrix.chart }}"
if [[ "$TAG" == "$CHART-"* ]]; then
echo "match=true" >> $GITHUB_OUTPUT
echo "✓ Release tag $TAG matches chart $CHART"
else
echo "match=false" >> $GITHUB_OUTPUT
echo "⊘ Release tag $TAG does not match chart $CHART - skipping"
fi

- name: Checkout repository
if: steps.should-run.outputs.match == 'true'
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name }}

- name: Extract version from release tag
if: steps.should-run.outputs.match == 'true'
id: version
run: |
VERSION="${{ github.event.release.tag_name }}"
VERSION="${VERSION#${{ matrix.chart }}-}"
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Extracted version: $VERSION for chart ${{ matrix.chart }}"

- name: Check .fleetControl directory
if: steps.should-run.outputs.match == 'true'
id: check-config
run: |
if [ -d "${{ matrix.config-directory }}" ] && [ "$(ls -A ${{ matrix.config-directory }})" ]; then
echo "exists=true" >> $GITHUB_OUTPUT
echo "✓ Directory ${{ matrix.config-directory }} exists and contains files"
else
echo "exists=false" >> $GITHUB_OUTPUT
echo "::warning::Directory ${{ matrix.config-directory }} does not exist or is empty. Skipping agent metadata update for ${{ matrix.chart }}."
fi

- name: Upload to Agent Metadata
if: steps.should-run.outputs.match == 'true' && steps.check-config.outputs.exists == 'true'
uses: newrelic/agent-metadata-action@v1.0.6
with:
newrelic-client-id: ${{ secrets.NEWRELIC_CLIENT_ID }}
newrelic-private-key: ${{ secrets.NEWRELIC_PRIVATE_KEY }}
agent-type: ${{ matrix.agent-type }}
version: ${{ steps.version.outputs.version }}
git-ref: ${{ github.event.release.tag_name }}
config-directory: ${{ matrix.config-directory }}
apm-control-nr-license-key: ${{ secrets.APM_CONTROL_NR_LICENSE_KEY_STAGING }}
122 changes: 122 additions & 0 deletions charts/newrelic-logging/.fleetControl/agentControl/kubernetes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
namespace: newrelic
name: io.fluentbit
version: 0.1.0
variables:
k8s:
chart_values:
newrelic-logging:
description: "Newrelic newrelic-logging chart values"
type: yaml
required: false
default: { }
global:
description: "Global chart values"
type: yaml
required: false
default: { }
chart_version:
description: "newrelic-logging chart version"
type: string
required: true
chart_name:
description: "newrelic-logging chart name"
type: string
required: false
default: "newrelic-logging"
chart_repository:
url:
description: "chart repository url"
type: string
required: false
default: "https://helm-charts.newrelic.com"
variants:
ac_config_field: "chart_repository_urls"
values: ["https://helm-charts.newrelic.com"]
secret_reference:
description: "HelmRepository secret reference (secretRef)"
type: yaml
required: false
default: null
certificate_secret_reference:
description: "HelmRepository certificate secret reference (certSecretRef)"
type: yaml
required: false
default: null
deployment:
# See com.newrelic.infrastructure Agent type for description of fields.
k8s:
health:
interval: 30s
initial_delay: 30s
objects:
repository:
apiVersion: source.toolkit.fluxcd.io/v1
kind: HelmRepository
metadata:
name: ${nr-sub:agent_id}
namespace: ${nr-ac:namespace}
spec:
interval: 30m
provider: generic
url: ${nr-var:chart_repository.url}
secretRef: ${nr-var:chart_repository.secret_reference}
certSecretRef: ${nr-var:chart_repository.certificate_secret_reference}
values:
apiVersion: v1
kind: Secret
metadata:
name: values-${nr-sub:agent_id}
namespace: ${nr-ac:namespace}
stringData:
# ${nr-env:NR_VERBOSE_LOG} is not set, since it is not used in the chart.
default.yaml: |
global:
licenseKey: ${nr-env:NR_LICENSE_KEY}
cluster: ${nr-env:NR_CLUSTER_NAME}
nrStaging: ${nr-env:NR_STAGING}
lowDataMode: ${nr-env:NR_LOW_DATA_MODE}
values.yaml: |
${nr-var:chart_values.newrelic-logging}
global.yaml: |
global:
${nr-var:chart_values.global | indent 2}
release:
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: ${nr-sub:agent_id}
namespace: ${nr-ac:namespace}
spec:
targetNamespace: ${nr-ac:namespace_agents}
releaseName: ${nr-sub:agent_id}
interval: 30s
chart:
spec:
chart: ${nr-var:chart_name}
version: ${nr-var:chart_version}
reconcileStrategy: ChartVersion
sourceRef:
kind: HelmRepository
name: ${nr-sub:agent_id}
namespace: ${nr-ac:namespace}
interval: 3m
install:
disableWait: true
disableWaitForJobs: true
disableTakeOwnership: true
createNamespace: true
upgrade:
disableWait: true
disableWaitForJobs: true
disableTakeOwnership: true
cleanupOnFail: true
valuesFrom:
- kind: Secret
name: values-${nr-sub:agent_id}
valuesKey: default.yaml
- kind: Secret
name: values-${nr-sub:agent_id}
valuesKey: values.yaml
- kind: Secret
name: values-${nr-sub:agent_id}
valuesKey: global.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
agentControlDefinitions:
- platform: KUBERNETESCLUSTER
supportFromAgent: 1.0.0
supportFromAgentControl: 1.0.0
content: ./agentControl/kubernetes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
configurationDefinitions:
- platform: KUBERNETESCLUSTER
description: fluentbit agent config
type: agent-config
version: 1.0.0
format: yml
Loading
Loading