tjololo / ploggi

Access pod logs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ploggi

Simple golang application that exposes container logs as a grpc service.

The server has two rpc:

    rpc GetLog (Pod) returns (PodLog);
    rpc StreamLog (Pod) returns (stream PodLog);

Proto file

_hack/example/ contains example clients for both rpcs

Local development

  1. Start a kind cluster with local docker registry enabled

    ./_hack/setup_kind.sh
    
  2. Build ploggi docker image using ko

    make local-image
    
  3. Push image to local registry

    make push-local
    
  4. Apply manifests to kind cluster

    make apply-kind
    
  5. Forward port to service in kind cluster

    kubectl port-forward svc/ploggi 8080:8080
    
  6. Start stream client

    go run _hack/examples/ploggi_stream_client/stream.go <ploggi-pod-name> ploggi
    
  7. Execute get client

    go run _hack/examples/ploggi_get_client/get.go <ploggi-pod-name> ploggi
    

    Ploggi will log every time the get rpc is executed and logs should be streamed to the stream client.

About

Access pod logs

License:Apache License 2.0


Languages

Language:Go 77.3%Language:Shell 17.8%Language:Makefile 5.0%