-
-
Save TheYkk/a757e959d9fce5d34e174e6792fffc30 to your computer and use it in GitHub Desktop.
Display Kubernetes OpenAPI Spec
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
# Proxy minikube to localhost on arbitrary port: | |
kubectl proxy --port=8080 & | |
sleep 3 | |
# Now swagger.json is available at localhost:12345/openapi/v2 | |
# Save to /tmp/temp/json and serve with e.g. docker swagger-ui container | |
curl http://localhost:8080/openapi/v2 > /tmp/temp.json | |
docker container run -d -p 9999:8080 -e SWAGGER_JSON=/var/specs/temp.json -v /tmp/temp.json:/var/specs/temp.json swaggerapi/swagger-ui | |
sleep 3 | |
# Open browser to localhost:9999 | |
open http://localhost:9999 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment