Skip to content

Commit

Permalink
Fixes performance issues in browser and implements proper tailing (#32)
Browse files Browse the repository at this point in the history
* Implements virtualization so only visible records are rendered in DOM
* Implements proper "tail" behavior so tailing shows last lines, not just new ones
* Switches filtering strategy from CSS to JavaScript so that dark/light even/odd rows are obeyed
* Changes time filter behavior so instead of picking date range you only pick start date
* Adds missing config vars to README and hack/config.yaml
* Updates thumbnail in README
* Removes unecessary charts/ directory

---------

Signed-off-by: Andres Morey <[email protected]>
  • Loading branch information
amorey authored Mar 20, 2024
1 parent 71f3fec commit 6ddd05b
Show file tree
Hide file tree
Showing 28 changed files with 3,859 additions and 2,032 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ WORKDIR /frontend

# enable pnpm
RUN corepack enable
RUN corepack prepare [email protected].3 --activate
RUN corepack prepare [email protected].5 --activate

# set up git+ssh for private package download from github
RUN apk add git openssh-client
Expand Down
59 changes: 31 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Kubetail is a web-based, real-time log viewer for Kubernetes clusters

<img src="https://github.com/kubetail-org/kubetail/assets/75881/38d2b2d1-e6e7-4f2c-9829-78ac51dd3e05" width="300px" title="screenshot">
<img src="https://github.com/kubetail-org/kubetail/assets/75881/7647bd90-0859-4b0b-9400-c7cdeb6a93e6" width="300px" title="screenshot">

Demo: [https://www.kubetail.com/demo](https://www.kubetail.com/demo)

Expand Down Expand Up @@ -118,33 +118,36 @@ The kubetail server executable (`server`) supports the following command line co

Kubetail can be configured using a configuration file written in YAML, JSON, TOML, HCL or envfile format. The application will automatically replace ENV variables written in the format `${NAME}` with their corresponding values. The config file supports the following options (also see [hack/config.yaml](hack/config.yaml)):

| Name | Datatype | Description | Default |
| -------------------------- | -------- | ---------------------------------------------------- | ---------------------- |
| addr | string | Host address to bind to | ":4000" |
| auth-mode | string | Auth mode (token, cluster, local) | "token" |
| gin-mode | string | Gin mode (release, debug) | "release" |
| kube-config | string | Kubectl config file path | "${HOME}/.kube/config" |
| csrf.enabled | bool | Enable CSRF protection | true |
| csrf.field-name | string | CSRF token name in forms | "csrf_token" |
| csrf.secret | string | CSRF hash key | "" |
| csrf.cookie.name | string | CSRF cookie name | "csrf" |
| csrf.cookie.path | string | CSRF cookie path | "/" |
| csrf.cookie.domain | string | CSRF cookie domain | "" |
| csrf.cookie.max-age | int | CSRF cookie max age (in seconds) | 43200 |
| csrf.cookie.secure | bool | CSRF cookie secure property | false |
| csrf.cookie.http-only | bool | CSRF cookie HttpOnly property | true |
| csrf.cookie.same-site | string | CSRF cookie SameSite property (strict, lax, none) | "strict" |
| logging.enabled | bool | Enable logging | true |
| logging.level | string | Log level | "info" |
| logging.format | string | Log format (json, pretty) | "json" |
| logging.access-log-enabled | bool | Enable access log | true |
| session.secret | string | Session hash key | "" |
| session.cookie.path | string | Session cookie path | "/" |
| session.cookie.domain | string | Session cookie domain | "" |
| session.cookie.max-age | int | Session cookie max age (in seconds) | 43200 |
| session.cookie.secure | bool | Session cookie secure property | false |
| session.cookie.http-only | bool | Session cookie HttpOnly property | true |
| session.cookie.same-site | string | Session cookie SameSite property (strict, lax, none) | "strict" |
| Name | Datatype | Description | Default |
| ------------------------------------- | -------- | ---------------------------------------------------- | ---------------------- |
| addr | string | Host address to bind to | ":4000" |
| auth-mode | string | Auth mode (token, cluster, local) | "token" |
| gin-mode | string | Gin mode (release, debug) | "release" |
| kube-config | string | Kubectl config file path | "${HOME}/.kube/config" |
| base-path | string | URL path prefix | "/" |
| csrf.enabled | bool | Enable CSRF protection | true |
| csrf.field-name | string | CSRF token name in forms | "csrf_token" |
| csrf.secret | string | CSRF hash key | "" |
| csrf.cookie.name | string | CSRF cookie name | "csrf" |
| csrf.cookie.path | string | CSRF cookie path | "/" |
| csrf.cookie.domain | string | CSRF cookie domain | "" |
| csrf.cookie.max-age | int | CSRF cookie max age (in seconds) | 43200 |
| csrf.cookie.secure | bool | CSRF cookie secure property | false |
| csrf.cookie.http-only | bool | CSRF cookie HttpOnly property | true |
| csrf.cookie.same-site | string | CSRF cookie SameSite property (strict, lax, none) | "strict" |
| logging.enabled | bool | Enable logging | true |
| logging.level | string | Log level | "info" |
| logging.format | string | Log format (json, pretty) | "json" |
| logging.access-log.enabled | bool | Enable access log | true |
| logging.access-log.hide-health-checks | bool | Hide requests to /healthz from access log | false |
| session.secret | string | Session hash key | "" |
| session.cookie.name | string | Session cookie name | "session" |
| session.cookie.path | string | Session cookie path | "/" |
| session.cookie.domain | string | Session cookie domain | "" |
| session.cookie.max-age | int | Session cookie max age (in seconds) | 43200 |
| session.cookie.secure | bool | Session cookie secure property | false |
| session.cookie.http-only | bool | Session cookie HttpOnly property | true |
| session.cookie.same-site | string | Session cookie SameSite property (strict, lax, none) | "strict" |

## Develop

Expand Down
24 changes: 12 additions & 12 deletions backend/go.mod
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module github.com/kubetail-org/kubetail

go 1.20
go 1.21

require (
github.com/99designs/gqlgen v0.17.43
github.com/99designs/gqlgen v0.17.44
github.com/gin-contrib/gzip v0.0.6
github.com/gin-contrib/requestid v0.0.6
github.com/gin-contrib/secure v0.0.1
Expand All @@ -16,7 +16,6 @@ require (
github.com/hasura/go-graphql-client v0.10.0
github.com/mitchellh/mapstructure v1.5.0
github.com/rs/zerolog v1.30.0
github.com/sosodev/duration v1.2.0
github.com/spf13/cobra v1.7.0
github.com/spf13/viper v1.17.0
github.com/stretchr/testify v1.8.4
Expand Down Expand Up @@ -54,7 +53,7 @@ require (
github.com/gorilla/context v1.1.1 // indirect
github.com/gorilla/securecookie v1.1.2 // indirect
github.com/gorilla/sessions v1.2.1 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.3 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/imdario/mergo v0.3.6 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
Expand All @@ -66,7 +65,7 @@ require (
github.com/magiconair/properties v1.8.7 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
Expand All @@ -76,6 +75,7 @@ require (
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sagikazarmark/locafero v0.3.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sosodev/duration v1.2.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.10.0 // indirect
github.com/spf13/cast v1.5.1 // indirect
Expand All @@ -89,18 +89,18 @@ require (
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
golang.org/x/arch v0.3.0 // indirect
golang.org/x/crypto v0.18.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/mod v0.15.0 // indirect
golang.org/x/net v0.20.0 // indirect
golang.org/x/mod v0.16.0 // indirect
golang.org/x/net v0.22.0 // indirect
golang.org/x/oauth2 v0.12.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/term v0.16.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.17.0 // indirect
golang.org/x/tools v0.19.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.31.0 // indirect
google.golang.org/protobuf v1.32.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
Expand Down
Loading

0 comments on commit 6ddd05b

Please sign in to comment.