Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logDNA supertenant agent volume mounts #590

Open
somnathpathak opened this issue Dec 9, 2023 · 9 comments
Open

logDNA supertenant agent volume mounts #590

somnathpathak opened this issue Dec 9, 2023 · 9 comments

Comments

@somnathpathak
Copy link

To accommodate multiple individual services in a single OpenShift cluster, I need to deploy multiple logDNA supertenant agents for each service in its own namespace.

These individual agents would then scrape logs from sub-directories under /var/log for example: agent-1 scrapes logs from /var/log/my-service-1, similarly agent-2 scrapes logs from /var/log/my-service-2.

However, while configuring these agents I also need to maintain isolation between each of them due to compliance requirements. This means I do not want these agents to unnecessarily share volumes, which I came across here while defining the agent yaml.

Please advise on why we need the below mentioned volumes and which I could drop from my configuration.

        - name: varlog
          hostPath:
            path: /var/log
        - name: vardata
          hostPath:
            path: /var/data
        - name: varliblogdna
          hostPath:
            path: /var/lib/logdna
        - name: varlibdockercontainers
          hostPath:
            path: /var/lib/docker/containers
        - name: mnt
          hostPath:
            path: /mnt
        - name: osrelease
          hostPath:
            path: /etc/os-release
        - name: logdnahostname
          hostPath:
            path: /etc/hostname

I understand for configuring lookback in the agent I need the /var/lib/logdna volume but not particularly sure on the other volumes. I specifically feel like I could drop the /var/data and /var/lib/docker/containers as these shared directories between the deployed cluster services and need not be mounted for compliance sake.

@somnathpathak
Copy link
Author

@dkhokhlov Could you please guide me here.

@somnathpathak
Copy link
Author

somnathpathak commented Dec 9, 2023

UPDATE:

The agent configuration works fine with just the two below-mentioned mounts as well. Should I still consider using other volumes as well?

      volumes:
        - name: varlog
          hostPath:
            path: /var/log/myservice
            type: ''
        - name: varliblogdna
          hostPath:
            path: /var/lib/logdna
            type: ''

@somnathpathak
Copy link
Author

CC @c-nixon ^

@somnathpathak
Copy link
Author

Can someone from the team please look into it and provide the requested guidance?

@dkhokhlov
Copy link
Contributor

dkhokhlov commented Dec 31, 2023

UPDATE:

The agent configuration works fine with just the two below-mentioned mounts as well. Should I still consider using other volumes as well?

      volumes:
        - name: varlog
          hostPath:
            path: /var/log/myservice
            type: ''
        - name: varliblogdna
          hostPath:
            path: /var/lib/logdna
            type: ''

keep varliblogdna different and the rest volumes the same.
the varliblogdna is used to store DB with information about processed offsets of log files (inodes), not shareable.

@somnathpathak
Copy link
Author

@dkhokhlov

        - name: varlog
          hostPath:
            path: /var/log
        - name: vardata
          hostPath:
            path: /var/data
        - name: varliblogdna
          hostPath:
            path: /var/lib/logdna
        - name: varlibdockercontainers
          hostPath:
            path: /var/lib/docker/containers
        - name: mnt
          hostPath:
            path: /mnt
        - name: osrelease
          hostPath:
            path: /etc/os-release
        - name: logdnahostname
          hostPath:
            path: /etc/hostname

Do you want me to keep all the volumes from the above list, and only differentiate for:

  1. /var/lib/logdna (LOGDNA_DB_PATH) with something like /var/lib/logdna/myservice, and
  2. /var/log/myservice (individual service logs directory in the shared cluster)

@dkhokhlov
Copy link
Contributor

dkhokhlov commented Jan 4, 2024

correct.
note: you may need to adjust exclusion rules to eliminate duplicates from default logdir /var/log (cannot override it in env var, only in file config). also disable journald in one of two.

@somnathpathak
Copy link
Author

@dkhokhlov Thank you. My configuration would now look something like below:

        - name: varlogmyservice
          hostPath:
            path: /var/log/myservice
        - name: vardata
          hostPath:
            path: /var/data
        - name: varliblogdna
          hostPath:
            path: /var/lib/logdna/myservice
        - name: varlibdockercontainers
          hostPath:
            path: /var/lib/docker/containers
        - name: mnt
          hostPath:
            path: /mnt
        - name: osrelease
          hostPath:
            path: /etc/os-release
        - name: logdnahostname
          hostPath:
            path: /etc/hostname

I would allow the services to mount only their respective sub-directories under /var/log parent directory e.g. /var/log/myservice and write logs into it. This means no service onboarded onto the shared cluster would be writing logs directly into the parent directory /var/log, thus eliminating the chances of duplicate log entries.

Also, with respect to the Journald logs, currently I do not wish to capture it. So the configuration of the same should be irrelevant in my use-case.

Please correct/confirm if my above shared understanding is correct.

@dkhokhlov
Copy link
Contributor

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants