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
- Host: GitHub
- URL: https://github.com/alvaroaleman/static-kas
- Owner: alvaroaleman
- License: apache-2.0
- Created: 2022-02-28T03:12:43.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-01-06T18:41:28.000Z (over 2 years ago)
- Last Synced: 2025-03-18T10:38:03.988Z (over 1 year ago)
- Topics: go, golang, k8s, kubernetes
- Language: Go
- Homepage:
- Size: 207 KB
- Stars: 53
- Watchers: 5
- Forks: 14
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.