[NOT FOR MERGING]: prototype: Send logs to team account based on namespace #1292
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We're trying to sort out a way that CF can allow teams to put their logs in their own team's account instead of account 1.
This PR prototypes providing a way for teams to tell the chart which key (and therefore to which account) they want their logs sent with based on a pod's namespace. Any pod that doesn't have an explicit mapping from its namespace to an account key will default to be sent with the account 1 key.
This idea is:
[OUTPUT]
blocks by running a NodeJS app to do that[OUTPUT]
blocks in the "main" fluent-bit.confFor CF, we'd do something a little different (but basically the same), since CF uses their own Helm chart. I think it would still be mostly the same. I didn't do the prototype there because, uh, I don't know. 😄
I tested this by:
REDACTED_KEY_FOR_PRODUCTION_756053
with the actual key for production 756053helm uninstall newrelic-logging && helm install newrelic-logging ./charts/newrelic-logging --set licenseKey=<REDACTED_ACCOUNT_1_KEY> --set cluster=brian-kind && kubectl logs $(kubectl get pod | grep newrelic-logging | grep -v creator | awk '{print $1}')
logging
namespacelogging
namespace pod's logs go to account 756053 (and not account 1)logging
namespaces go to account 1Account 1 logs
(note that it doesn't include logs from the
logging
namespaces)Account 756053 logs
(note that it doesn't include logs from other namespaces besides
logging
)