An open API service indexing awesome lists of open source software.

https://github.com/alvaroaleman/static-kas

A fake kube-apiserver that serves static data from files
https://github.com/alvaroaleman/static-kas

go golang k8s kubernetes

Last synced: over 1 year ago
JSON representation

A fake kube-apiserver that serves static data from files

Awesome Lists containing this project

README

          

# Static KAS

A fake kube-apiserver that serves static data from an Openshift must-gather. Dynamically discovers resources and supports logs. Requires golang >= 1.17.
While there is no explicit documentation for the directory layout, a sample is included for testing in [./pkg/handler/testdata](./pkg/handler/testdata).

Usage:

1. Start the static-kas in a distinct terminal: `go run ./cmd/ --base-dir ../must-gather/quay-io-openshift-release-dev-ocp-v4-0-art-dev-sha256-ec058cf120ee79c97fa385205ae5b4ab7745e4064716cadd1e319652f5999ffd/`
2. Create a Kubeconfig:
```bash
cat </tmp/kk
apiVersion: v1
clusters:
- cluster:
server: http://localhost:8080
name: static-kas
contexts:
- context:
cluster: static-kas
user: ""
namespace: default
name: static-kas
current-context: static-kas
kind: Config
EOF
```
3. Use `kubectl` or any other standard client to interact with the static kas: `kubectl --kubeconfig=/tmp/kk get pod`

# Multiple dumps

If you have a folder with multiple dumps, you can add the `--kubeconfig=/tmp/kk` arg which will makke `static-kas` discover
all dumps in there, create a kubeconfig with a context for each of them and write it to the passed location.