Comments (9)
One more option is --since
. This makes me think we must consider all logging options.
from systemk.
Also, something I realized during my tests is that if a unit with the same name ran in the past, there's the chance logs are still around which doesn't seem a good thing.
A quick search led me to learn journalctl
allows for vacuum the logs but only archived ones, so something like this could work:
journalctl --rotate
journalctl --vacuum-time=1s
from systemk.
Also, something I realized during my tests is that if a unit with the same name ran in the past, there's the chance logs are still around which doesn't seem a good thing.
A quick search led me to learn
journalctl
allows for vacuum the logs but only archived ones, so something like this could work:
Recreation of pods where the name sticks is usually a thing only when dealing with naked Pods (not under the control of any envelope, such as Deployment) or StatefulSets, eg my-pod-0
. But this is enough to justify, I think, some sort of logic here that avoids fetching logs from previous instances of a homonym Pod.
An alternative to what I proposed earlier, is to have the provider enforce journald entries that have been created since after the current Pod instance started. Since the provider has access to informers cache (the current code doesn't have access to the Pod informer but we can change that), we can easily retrieve the starttime attribute and compute based on that.
WDYT @miekg?
from systemk.
Also, something I realized during my tests is that if a unit with the same name ran in the past, there's the chance logs are still around which doesn't seem a good thing.
I don't think this is bad, this could actually be helpful. And anyway if journald works like this we should not jump through hoops to make it work differently.
from systemk.
It's not much about systemd but about the fact that you'll get logs from Pod instances that no longer exist and/or never belonged to you. What if user A runs Pod xyz, prints some data, deletes Pod, and then user B runs a Pod with same name: is it ok for user B to get logs from a workload instance they didn't own? In the containerized Kubernetes world, even when journald is the log sink, it is guaranteed the logs pertain only to the instance of the Pod you're retrieving logs for.
from systemk.
Another alternative, and way more easy, is to append Pod UID to the the systemd unit name, hence guaranteeing uniqueness.
from systemk.
from systemk.
I think I'm too tied to how the kubelet does things and to keep UX parity when possible.
Anyway, I think it's fine to leave it for now and if it becomes a problem later it will be easy to address.
from systemk.
from systemk.
Related Issues (20)
- feature: environment variables HOT 1
- Tracking VK changes
- Ignore immutable Secrets and ConfigMaps
- ownership of host mountpath HOT 3
- Figure out how to do e2e tests HOT 2
- How to use a k8s master manage multiple systemk node HOT 2
- Replace pkg/errors with stdlib
- Stop chowning paths from systemk HOT 8
- [question] systemk <-> k3s server tunnel ? HOT 1
- flags.Lookup("nodename") does not work
- feature: support different versions of systemd HOT 12
- need libsystemd-dev to compile systemk HOT 1
- enhancement: systemd-nspawn to launch real Image= container HOT 2
- TLS certs for handlers we run HOT 8
- provide releases HOT 1
- When run in user mode use /var/run/$UID instead of /var/run for bindmounts HOT 1
- log support requires CGO HOT 4
- user mode is not feasible HOT 4
- remove klog flags that are not needed HOT 1
- unit file getter function
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 systemk.