Try using Kong + Konga with Docker Compose.

What is Kong

This method is exposed in the form of Gateway Aggregation in Microsoft's design pattern.

Use the gateway to aggregate multiple individual requests into a single request. This pattern is useful when the client needs to make multiple calls to different back-end systems in order to perform the operation.

image.png

In general, creating a service with a microservices architecture creates multiple connections between the application and the server. This makes connection information management and error handling complicated. Therefore, it is conceivable to put something like a reverse proxy in between so that it looks like one to the application. This is gateway aggregation.

image.png

This time, I used something called Kong, but Sentinel and Gloo are also famous.

Image to use

kong https://hub.docker.com/_/kong

konga https://hub.docker.com/r/pantsel/konga/

What is konga? It's a Web UI for kong. The commercial version of kong has a WebUI, but it is not the OSS version. Therefore, we use OSS called konga to serve WebUI.

DockerCompose

docker-compose.yml


version: '2.1'
services:
  kong:
    image: kong
    ports:
      - 0.0.0.0:8000:8000
      - 8443:8443
      - 8001:8001
      - 8444:8444 
    environment:
      - "KONG_PROXY_ACCESS_LOG=/dev/stdout"
      - "KONG_ADMIN_ACCESS_LOG=/dev/stdout"
      - "KONG_PROXY_ERROR_LOG=/dev/stderr"
      - "KONG_ADMIN_ERROR_LOG=/dev/stderr"
      - "KONG_ADMIN_LISTEN=0.0.0.0:8001, 0.0.0.0:8444 ssl"
      - "KONG_DATABASE=postgres"
      - "KONG_PG_HOST=kong-db"
      - "KONG_PG_USER=kong"
      - "KONG_PG_PASSWORD=kong"
      - "KONG_CASSANDRA_CONTACT_POINTS=kong-db"
    depends_on:
      - "kong-migrate"
    restart: "on-failure:3"

  kong-migrate:
    image: kong
    depends_on:
      - "kong-db"
    environment:
      KONG_DATABASE: "postgres"
      KONG_PG_HOST: "kong-db"
      KONG_PG_USER: "kong"
      KONG_PG_PASSWORD: "kong"
      KONG_CASSANDRA_CONTACT_POINTS: "kong-db"
    command: "kong migrations bootstrap"
    restart: "on-failure:3"

  kong-db:
    image: "postgres:9.6"
    environment:
      POSTGRES_USER: "kong"
      POSTGRES_PASSWORD: "kong"
      POSTGRES_DB: "kong"
    volumes:
      - ./kong_data:/var/lib/postgresql/data

  konga:
    image: pantsel/konga
    ports:
      - 1337:1337
    environment:
      - "DB_ADAPTER=postgres"
      - "DB_HOST=konga-db"
      - "DB_USER=konga"
      - "DB_PASSWORD=konga"
    restart: "on-failure:3"
    depends_on:
      - konga-db

  konga-db:
    image: "postgres:9.6"
    environment:
      POSTGRES_USER: "konga"
      POSTGRES_PASSWORD: "konga"
      POSTGRES_DB: "konga"
    volumes:
      - ./konga_data:/var/lib/postgresql/data

Settings and points

image.png

Select from the CONNECTIONS pane on the left to create a CONNECTION. At that time, enter http: // kong: 8001 / in Kong Admin Url. No SSL, as it is for easy local verification. The domain is kong, not localhost.

Recommended Posts

Try using Kong + Konga with Docker Compose.
Try WildFly with Docker
Try using another Servlet container Jetty with Docker
Try using GloVe with Deeplearning4j
Try using view_component with rails
People using docker Try using docker-compose
Using PlantUml with Honkit [Docker]
Node.js environment construction with Docker Compose
Try using Redmine on Mac docker
Try running cloudera manager with docker
Try using Redis with Java (jar)
Build Rails environment with Docker Compose
WordPress with Docker Compose on CentOS 8
Use cuda11.0 with pytorch using Docker
Create Rails 6 + MySQL environment with Docker compose
I tried using Scalar DL with Docker
[Now] Let's Redmine with Docker Compose with Let's Encrypt
Try using Spring Boot with VS Code
Proxy server with squid using docker image
GPU recognition with docker using WSL2 (August 2020)
Try using the Wii remote with Java
Try building Express + PostgreSQL + Sequelize with Docker [Part 2]
Try running MPLS-VPN with FR Routing on Docker
Try using libGDX
Try using powermock-mockito2-2.0.2
Try using GraalVM
Try using jmockit 1.48
Try using sql-migrate
Try using GPS receiver kit with RaspberryPi3 (Ruby)
Notes on building Rails6 / PostgreSQL with Docker Compose
Try using SwiftLint
Try using Log4j 2.0
Try building Express + PostgreSQL + Sequelize with Docker [Part 1]
Make Volume faster when using Docker with vscode.
How to use docker compose with NVIDIA Jetson
Try using S3Proxy with Microsoft Azure Blob Storage
Try using DI container with Laravel and Spring Boot
[Introduction to Docker x ECS] ECS deployment with docker compose up
Try using OpenID Connect with Keycloak (Spring Boot application)
Feel free to try Elasticsearch cluster with WSL2 + Docker
Docker Compose does not start with docker.credentials.errors.InitializationError error message
Try connecting to AzureCosmosDB Emulator for Docker with Java
Run Mosquitto with Docker and try WebSocket communication with MQTT
Try to build a Java development environment using Docker
Command to try using Docker for the time being
Try to work with Keycloak using Spring Security SAML (Spring 5)
Try DI with Micronaut
Try using Axon Framework
Try using JobScheduler's REST-API
Try using java.lang.Math methods
Try using PowerMock's WhiteBox
Launch MariaDB with Docker
Rails deploy with Docker
Run Pico with docker
Explode Docker with WSL2
Try using Talend Part 2
Use Puphpeteer with Docker
Operate Emby with Docker
Use ngrok with Docker
Run Payara with Docker
[Docker] Connection with MySQL