static-kas

module
v0.0.0-...-765cd94 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 6, 2024 License: Apache-2.0

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.

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:
cat <<EOF >/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
  1. 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.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL