Categorygithub.com/tibcosoftware/apiscout
repository
0.2.0
Repository: https://github.com/tibcosoftware/apiscout.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# README

API Scout :: Finding Your APIs In Kubernetes

What is API Scout

API Scout, helps you get up-to-date API docs to your developers by simply annotating your services in K8s.

What are the components of API Scout

The docker image that is deployed to Kubernetes has several components:

  • The container itself is based on nginx:1.15-alpine
  • The webapp is a staticly generated site by Hugo using the Learn theme and Swagger UI
  • A server app that connects to the Kubernetes cluster using a default role to watch for services that need to be indexed

Hugo is downloaded and embedded during the build of the container

Build and run

API Scout has a Makefile that can be used for most of the operations. Make sure you have installed Go Programming Language, set GOPATH variable and added $GOPATH/bin in your PATH

usage: make [target]
Makefile targetsDescription
build-allPerforms clean-all and executes all build targets
build-dockerBuilds a docker image from the dist directory
build-serverBuilds the server app in dist
build-siteBuilds the Hugo distribution in dist
clean-allRemoves the dist directory
clean-dockerStops and removes all containers and images for apiscout
clean-kubeRemoves the apiscout service and deployment from Kubernetes
depsGet dependencies to build the server
minikube-deleteDelete the Minikube installation
minikube-installInstall Minikube on this machine
minikube-showShow the API Scout UI that is deployed to Minikube
minikube-startStart Minikube with default configuration
minikube-stopStop Minikube
run-dockerRuns a docker container with default settings
run-docsRuns the embedded Hugo server on port 1313 for the documentation
run-hugoRuns the embedded Hugo server on port 1313
run-kubeDeploys apiscout to Kubernetes
run-serverBuilds the in the server directory and runs it with default settings
stop-dockerStop and remove the running apiscout container

Requirements for Kubernetes

To be able to view the services, apiscout needs access to the Kubernetes cluster using the default service account. By default (pun intended) this account doesn't have access to view services so during deployment a new rolebinding is created. After starting, it will poll the Kubernetes API server every 10 seconds, or at the timeinterval specified by the environment variable INTERVAL.

apiscout looks for two annotations to be able to index a service:

  • apiscout/index: 'true' This annotation ensures that apiscout indexes the service
  • apiscout/swaggerUrl: '/swaggerspec' This is the URL from where apiscout will read the OpenAPI document

Environment variables for the docker container

apiscout has a few environment variables that the docker container (and thus the deployment to Kubernetes) can use:

  • SWAGGERSTORE: The location where to store the swaggerdocs
  • HUGOSTORE: The location where to store content for Hugo
  • MODE: The mode in which apiscout is running (can be either KUBE or LOCAL)
  • EXTERNALIP: The external IP address of the Kubernetes cluster in case of LOCAL mode
  • HUGODIR: The base directory for Hugo

License

See the LICENSE file

The logo made by Freepik from www.flaticon.com is licensed by CC 3.0 BY