Minikube: Enable swagger-ui

Created on 19 May 2017  路  4Comments  路  Source: kubernetes/minikube

BUG REPORT

Minikube version (use minikube version): v0.19.0

Environment:

  • OS (e.g. from /etc/os-release): OSX
  • VM Driver (e.g. cat ~/.minikube/machines/minikube/config.json | grep DriverName): xhyve
  • ISO version (e.g. cat ~/.minikube/machines/minikube/config.json | grep -i ISO or minikube ssh cat /etc/VERSION): minikube-v0.18.0.iso
  • Install tools:
  • Others:

What happened:

Trying to enable the swagger-ui by passing flag to apiserver:

$ minikube start --memory=6144 --cpus=4 --vm-driver=xhyve --extra-config=apiserver.enable-swagger-ui=true 

What you expected to happen:

After proxying to kubeapi I should be able to open a browser and see swagger webpage at: http://localhost:8001/swagger-ui but the webpage only shows the api spec.

How to reproduce it (as minimally and precisely as possible):

Anything else do we need to know:

I tested this on a default cluster running in AWS and it worked. So not sure if just some small thing that's missing from localkube. I'm happy to send PR back to resolve!

Most helpful comment

The above didn't worked for me on minikube, http://localhost:8001/swagger-ui gives only some json, not the UI, installed the swagger on minkube as fowllow and it works:

kubectl run swagger-ui --image=swaggerapi/swagger-ui:latest
kubectl expose deployment swagger-ui --port=8080 --external-ip=$(minikube ip) --type=NodePort
http://192.168.99.100:8080/
192.168.99.100 is $(minikube ip)

All 4 comments

I got it to work on minikube v0.19.0 using the config key "Features.EnableSwaggerUI" like so.

minikube start --extra-config=apiserver.Features.EnableSwaggerUI=true

Thanks @kmjohny!

The above didn't worked for me on minikube, http://localhost:8001/swagger-ui gives only some json, not the UI, installed the swagger on minkube as fowllow and it works:

kubectl run swagger-ui --image=swaggerapi/swagger-ui:latest
kubectl expose deployment swagger-ui --port=8080 --external-ip=$(minikube ip) --type=NodePort
http://192.168.99.100:8080/
192.168.99.100 is $(minikube ip)

Hello all,

Does someone know how to enable swagger ui in Kubernetes cluster (not in minikube)?
Thanks.

Hong

Was this page helpful?
0 / 5 - 0 ratings