Discover Packages
github.com/OsmanTunahan/pod-watcher
command
module
Version:
v0.0.0-...-b307869
Opens a new window with list of versions in this module.
Published: Nov 10, 2024
License: MIT
Opens a new window with license information.
Imports: 15
Opens a new window with list of imports.
Imported by: 0 modules, 0 packages
The first number is the count of modules that contain a package that imports this one.
The module count is a better indicator of popularity than the package count.
A module with 100 importing packages is counted only once instead of 100 times,
reflecting the fact that the choice to use the package was likely made only once,
not 100 times.
A '?' means that the value hasn't been computed yet.
Opens a new window with list of known importers.
README
README
¶
Pod Watcher
Pod Watcher is a simple program to monitor Kubernetes pods and log their events such as creation, deletion, and updates.
Features
Logs pod creation, deletion, and updates.
Option to print detailed pod object information.
Filters pods based on namespace and label selector.
Requirements
Go 1.22 or later
Kubernetes cluster
kubeconfig file for authentication (if running outside a cluster)
Installation
Clone the repository:
git clone https://github.com/OsmanTunahan/pod-watcher.git
cd pod-watcher
Build the project:
go build -o pod-watcher
Usage
Command-line Options
--kubeconfig (string): Absolute path to the kubeconfig file (optional if running inside a cluster).
--namespace (string): Namespace to watch (default: all namespaces).
--details (bool): Print detailed pod object information (default: false).
--selector (string): Label selector to filter pods (default: "foo=bar,baz=quux").
Running the Program
Ensure you have access to your Kubernetes cluster either by running inside the cluster or by providing a valid kubeconfig file.
Run the program:
./pod-watcher --kubeconfig=~/.kube/config --namespace=default --details=true --selector="app=testk8sapp"
Example
To watch all pods in the default namespace with detailed logging enabled:
./pod-watcher --namespace=default --details=true
Expand ▾
Collapse ▴
Documentation
¶
There is no documentation for this package.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.