Skip to content

Commit

Permalink
Reworked README
Browse files Browse the repository at this point in the history
  • Loading branch information
iximiuz committed Sep 29, 2023
1 parent 4681e36 commit ceb763b
Show file tree
Hide file tree
Showing 9 changed files with 86 additions and 61 deletions.
28 changes: 0 additions & 28 deletions Dockerfile

This file was deleted.

20 changes: 2 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,30 +28,14 @@ front-lint-fix:
front-build:
cd ${CUR_DIR}/ui && npm run build

.PHONY: build
build:
.PHONY: build-dev
build-dev:
cd ${CUR_DIR}/ui && npm run build
go build -o ${CUR_DIR}/bin/kexp ${CUR_DIR}/main.go
CGO_ENABLED=0 go build \
-ldflags "-X main.version=${VERSION} -X main.commit=${GIT_COMMIT} -X main.date=${UTC_NOW}" \
-o ${CUR_DIR}/bin/kexp main.go

.PHONY: docker-build
docker-build:
cd ${CUR_DIR}/ui && npm run build
docker buildx build \
--progress plain \
--build-arg BUILD_VERSION=${VERSION} \
--build-arg BUILD_COMMIT=${GIT_COMMIT} \
--build-arg BUILD_DATE=${UTC_NOW} \
-t ghcr.io/iximiuz/kexp:latest \
-f ${CUR_DIR}/Dockerfile \
${CUR_DIR}

.PHONY: docker-push
docker-push: docker-build
docker push ghcr.io/iximiuz/kexp:latest

.PHONY: release
release:
goreleaser --clean
Expand Down
95 changes: 82 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,109 @@ Not yet another attempt to manage production clusters in the browser.
k'exp is for:

- Learning and exploring Kubernetes capabilities
- Application development (object graph "presets" for every app)
- Controller and operator development (dynamic object graph)
- [coming soon] Postman-like client for Kubernetes API
- Application development (object graph _presets_ for every app)
- Controller and operator development (dynamic object graphs)
- [coming soon] Postman-like client and request builder for Kubernetes API

k'exp can reflect the state of your cluster in real-time:

## How to run
![k'exp in action](./assets/images/kexp-cluster-changes.gif)

It's a single Go binary with embedded UI.
k'exp can also give you a quick overview of "related" objects:

![k'exp in action](./assets/images/kexp-preset-related-objects.gif)

...as well as show object-specific insights:

![k'exp in action](./assets/images/kexp-pod-insights-min.png)

## In the wild

You can try k'exp at every [Kubernetes Playground](https://labs.iximiuz.com/playgrounds?category=kubernetes) on iximiuz Labs.
Some tutorials also use k'exp to visualize Kubernetes objects and their relationships:

- [Making Sense Out of Native Sidecar Containers in Kubernetes](https://labs.iximiuz.com/tutorials/kubernetes-native-sidecars)

You can also find [a few short demos on YouTube](https://www.youtube.com/playlist?list=PL3ea3TG5uHXhzzk9gK4oNQk14lYyxdxPx).


## Installation

Grab the latest release from GitHub:

```sh
GOOS=linux
GOARCH=amd64

curl -Ls https://github.com/iximiuz/kexp/releases/latest/download/kexp_${GOOS}_${GOARCH}.tar.gz | tar xvz

sudo mv kexp /usr/local/bin
```

At the moment, the only system `kexp` is actively tested on is Linux amd64,
but builds for Darwin amd64/arm64 and Linux arm64 are also available.


## Usage

It's a statically linked Go binary with an embedded UI.
If you already have `kubectl` configured to access your cluster(s),
you can run `kexp` too - it uses the same `KUBECONFIG` discovery logic.

By default, `kexp` starts a server on `localhost:5173`:

```sh
kexp

open localhost:5173
```

Alternatively, you can specify a custom address:

```sh
kexp --host 0.0.0.0 --port 8090
```


## How it works

`kexp` is a daemon that uses the local `KUBECONFIG` to access Kubernetes API.
Thus, it's as powerful (and potentially **destructive!**) as your `kubectl` can get.
The daemon lists Kubernetes API resources and objects,
may start a bunch of watchers for the objects of interest,
and even delete objects if you ask it to (via the UI).
The UI is a single-page application written in TypeScript and Vue and embedded into the daemon binary.


## Development

Server:
Pre-requisites:

```sh
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
```

Client:

```sh
cd ui
npm install
npm run dev

# Optional
kind create cluster
# ...or
minikube start
```

Running the dev server and the UI is easy:

```sh
make front-run-dev
# In terminal 1
make back-run-dev

open localhost:5173
# In terminal 2
make front-run-dev
```

After that, you can access the UI at `http://localhost:5173`.


## Contributing

Contributions are welcome!
Binary file added assets/images/kexp-cluster-changes.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/kexp-pod-insights-min.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/kexp-preset-related-objects.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func main() {

flags.AddFlags(cmd.PersistentFlags())
cmd.PersistentFlags().StringVar(&flags.host, "host", "127.0.0.1", "Listening host")
cmd.PersistentFlags().StringVar(&flags.port, "port", "8090", "Listening port")
cmd.PersistentFlags().StringVar(&flags.port, "port", "5173", "Listening port")

if err := cmd.Execute(); err != nil {
logrus.WithError(err).Fatal("Command failed")
Expand Down
Empty file removed ui/dist/.keep
Empty file.
2 changes: 1 addition & 1 deletion ui/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default defineConfig({
server: {
proxy: {
'/api': {
target: 'http://localhost:8090',
target: 'http://localhost:5173',
changeOrigin: true,
ws: true,
},
Expand Down

0 comments on commit ceb763b

Please sign in to comment.