Skip to content

crossplane-contrib/provider-newrelic

Repository files navigation

provider-newrelic

provider-newrelic is a Crossplane Provider that is meant to be used for infrastructure-as-code for New Relic.

See the examples directory for advanced usage.

This provider supports the following:

apiVersion: provider-newrelic.crossplane.io/v1alpha1
kind: ProviderConfig
metadata:
  name: newrelic-provider
spec:
  account_id: "your_nr_account_id"
  region: "US | EU" # Optional
  credentials:
    source: Secret
    secretRef:
      namespace: crossplane-system
      name: newrelic-creds
      key: key
  • Secret which contains a new relic user token
---
apiVersion: v1
data:
  key: NRAK-YOUR_NEW_RELIC_TOKEN_BASE64
kind: Secret
metadata:
  name: newrelic-creds
  namespace: crossplane-system
type: Opaque

Additional Note

Sometimes an AlertsPolicy may be deleted, or regenerated, giving it a new ID.
This can cause issues for any NrqlAlertCondition with a reference to that object resulting in errors such as "error": "Policy with ID 1234567 not found" To fix you can simply remove the policyId on the NrqlAlertCondition to to cause the reference to re-resolve. (There is no harm in doing this, it will just cause the provider to lookup the new ID.)

kubectl -n crossplane-system patch NrqlAlertCondition my-condition-name --type json  --patch='[ { "op": "remove", "path": "/spec/forProvider/policyId" } ]'

Developing

Run against a Kubernetes cluster:

make run

Build, push, and install:

make all

Build image:

make image

Push image:

make push

Build binary:

make build