https://docs.docker.com/docker-for-mac/install/
…and setup kubernetes https://docs.docker.com/docker-for-mac/#kubernets
Verify docker installation
docker -v
setup a Kubernetes context
kubectl config get-contexts #from ~/.kube/config kubectl config use-context docker-for-desktop
after kubernetes cluster running, install helm, the Kubernetes Package Manager
brew install kubernetes-helm helm init --upgrade helm version
http://marketplace.eclipse.org/content/eclipse-docker-tooling
To activate: Window > Show View > Other… (Docker Explorer)
-
Run application:
mvn spring-boot:run -Dspring.cloud.config.uri=http://localhost:8888
-
Test application
curl -s localhost:8080/files/444 | pjson
-
To create the image, Jib can use the local Docker daemon
mvn clean package jib:dockerBuild -Dimage=examples/customer
docker run --env spring.profiles.active=dev --env spring.cloud.config.uri=http://host.docker.internal:8888 -p 8080:8080 examples/customer
Tip
|
⇒ jib:build builds to a container image registry ⇒ to run in the foreground, remove -d (--detach) option |
-
Test application
curl -s localhost:8080/1234 | pjson
brew tap kong/kong brew install kong
brew install postgres pg_ctl -D /usr/local/var/postgres start psql -c "CREATE USER kong;" psql -c "CREATE DATABASE kong OWNER kong;" kong migrations bootstrap
…
wget https://raw.githubusercontent.com/Kong/kong/master/kong.conf.default cp kong.conf.default kong.conf kong start -c kong.conf kong roar
Kong 5 min quickstart
Konga is a non-official GUI for kong administration (official Kong Admin GUI is available only for Kong enterprise)
git clone https://github.com/pantsel/konga.git cd konga npm i npm start http://localhost:1337
Service is the name Kong uses to refer to the upstream APIs and microservices it manages.
curl -i -X POST --url http://localhost:8001/services/ --data 'name=customer' --data 'url=http://localhost:8080'
Routes specify how (and if) requests are sent to their services after they reach Kong.
curl -i -X POST --url http://localhost:8001/services/customer/routes --data 'paths[]=/v2/customers'
and action…
curl -s http://localhost:8000/v2/customers/123 | pjson
Configure the key-auth plugin to add authentication to your customer service
curl -i -X POST --url http://localhost:8001/services/customer/plugins/ --data 'name=key-auth'
Creating an API consumer (the consumer object represents an user of a service)
curl -X POST http://localhost:8001/consumers/ --data 'username=chuck.norris@gmail.com' --data 'custom_id=777' --data 'tags[]=karate'
curl -s http://localhost:8001/consumers?custom_id=777 | pjson
Provision random key credential for your consumer
curl -i -X POST --url http://localhost:8001/consumers/chuck.norris@gmail.com/key-auth/ --data 'key=c82356ec-fc40-4eb3-b2f8-5c4102e50ed8'
Verify that your consumer credentials are valid
curl -s http://localhost:8000/v2/customers/123?apikey=c82356ec-fc40-4eb3-b2f8-5c4102e50ed8 | pjson
or
curl -s http://localhost:8000/v2/customers/123 --header 'apikey: c82356ec-fc40-4eb3-b2f8-5c4102e50ed8' | pjson