kubetailrb
🎯 Objectives
Learn ruby and ruby on rails by creating an application.
The application goal is to read the logs from multiple pods, like stern or kubetail but using ruby, and also support ECS log format to display in human-readable format.
🗺️ Plan
GitHub - l-lin/kubetailrb: Tail your k8s pod logs at the same time.
- create CLI application
- display file
- follow file content
- connect to kubernetes (e.g. use kubeclient)
- display log of a single pod in the terminal
- display log of pods in the terminal
- follow logs of pods in the terminal
- colorize logs
- format ECS logs into human-readable format in the terminal
- use
ArgumentError
instead of custom exception - flush stdout in the
clock
app - display all container logs from a pod
stern
is first getting the pod information, they return a list of pod information, which contain the container name.- logs not displayed if new pod
- update tests
- use decorator for log formatter?
- one for raw or not
- one for pretty
- change flags
- regexp on container names
- [-] truncate pod names
- Not a good idea, we can’t see anything…
- flag to hide the pod and container names:
--display-names
to show them - exclude access logs:
-e access-logs
- exclude dd logs:
-e dd-logs
- display +/- for each new/deleted pod
- with color
- colorize pod and container names
- log level colorization detect light / black terminal
- Already supported
- mdc as input?
- [-] display log “container “preventive-continuous-care” in pod “preventive-continuous-care-rake-pre-rollout-899086553fb9-bw797” is waiting to start: ContainerCreating” in grey
- Unless doing something a bit dirty (like hardcoding the sentence), it’s not easy.