Comments (4)
Hi @collimarco ,
I think it's possible, with a few modifications to the instructions.
- When creating a secret with credentials, add your tokens. It should be something like:
kubectl create secret generic logzio-logs-secret \
--from-literal=logzio-log-shipping-token-1='<<SHIPPING-TOKEN-1>>' \
--from-literal=logzio-log-shipping-token-2='<<SHIPPING-TOKEN-2>>' \
... ADD MORE TOKENS IF NEEDED ...
--from-literal=logzio-log-listener='https://<<LISTENER-HOST>>:8071' \
-n monitoring
- Edit your daemonset, and add more env vars with the tokens from the previous steps. Should look something like this:
env:
- name: LOGZIO_LOG_SHIPPING_TOKEN_1
valueFrom:
secretKeyRef:
name: logzio-logs-secret
key: logzio-log-shipping-token-1
- name: LOGZIO_LOG_SHIPPING_TOKEN_2
valueFrom:
secretKeyRef:
name: logzio-logs-secret
key: logzio-log-shipping-token-2
... REST OF ENV VARS ...
- Edit your configmap. Create a logzio output for each namespace, and configure the logzio url. For example, let's say we want to send NAMESPACE_1 to account with the token LOGZIO_LOG_SHIPPING_TOKEN_1, and NAMESPACE_2 to LOGZIO_LOG_SHIPPING_TOKEN_2 (where LOGZIO_LOG_SHIPPING_TOKEN_1, LOGZIO_LOG_SHIPPING_TOKEN_2 are the env vars that we added in the previous step).
Your outputs should look like this:
<match "kubernetes.var.log.containers.**_NAMESPACE_1_**">
@type logzio_buffered
@id out_logzio
endpoint_url "#{ENV['LOGZIO_LOG_LISTENER']}?token=#{ENV['LOGZIO_LOG_SHIPPING_TOKEN'_1]}"
... REST OF REQUIRED CONFIG FOR THE LOGZIO OUTPUT ...
</match>
<match "kubernetes.var.log.containers.**_NAMESPACE_2_**">
@type logzio_buffered
@id out_logzio
endpoint_url "#{ENV['LOGZIO_LOG_LISTENER']}?token=#{ENV['LOGZIO_LOG_SHIPPING_TOKEN'_2]}"
... REST OF REQUIRED CONFIG FOR THE LOGZIO OUTPUT ...
</match>
Note that in this snippet it's not the entire config for the Logzio output, I just copied the part you'd need to edit. Full config can be found here.
Once all of these changes are applied, I think you should accomplish what you wanted.
Let me know if it worked for you :)
from logzio-k8s.
@mirii1994 Thank you! Very appreciated. It would be possible to keep the Logz.io configs inside their own namespace? In your example everything would be stored in a global "monitoring" namespace. I am wondering if each team, which owns only the namespace for their app, can configure logging using only their app namespace (and not the global "monitoring" namespace).
from logzio-k8s.
That's an interesting idea.
We haven't tried doing that, and don't have an ETA for testing it at the moment.
If you do manage to accomplish that, it will be great if you'll share how you did it.
from logzio-k8s.
@collimarco Closing this issue as your original question was answered :)
from logzio-k8s.
Related Issues (20)
- AKS issue on namespace watch HOT 5
- Fluentbit support HOT 2
- Provide a convenient way to install (and use Kubernetes secrets) HOT 3
- Container crash (CrashLoopBackOff) HOT 3
- Logzio Daemonset on GKE is deleted on kube-system namespace after a few seconds HOT 1
- daemon.extensions wont create
- daemon.extensions wont create HOT 1
- Issue running on EKS HOT 3
- Dockerhub environment description seems to be outdated HOT 4
- deprecated apis in k8s config HOT 3
- json logs are not parsed HOT 8
- FR: exclude/only include logs from certain k8s namespaces HOT 12
- The DaemonSet "fluentd-logzio" is invalid HOT 1
- ARM support HOT 3
- token is still visible in the output HOT 3
- rewrite_tag_filter sets message key to null with this installation HOT 5
- include dedot plugin HOT 1
- [EKS 1.21/1.22][BoundServiceAccountTokenVolume] Refresh AWS service account tokens automatically HOT 9
- fluentd DaemonSet degrades and stops sending logs HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from logzio-k8s.