Last active
February 1, 2021 10:28
-
-
Save developer-guy/f10d3edee8a13640fb0164b6568b0eb4 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