Coder Social home page Coder Social logo

yesinteractive / kong-map Goto Github PK

View Code? Open in Web Editor NEW
80.0 5.0 6.0 9.49 MB

Kongmap is a free visualization tool which allows you to view and edit configurations of your Kong API Gateway Clusters, including Routes, Services, and Plugins/Policies. The tool is being offered for installation via Docker and Kubernetes at this time.

License: MIT License

Dockerfile 1.74% PHP 98.26%
kong api-gateway kubernetes kong-gateway kong-plugin konga api rest-api containers devops

kong-map's Introduction

KongMap

Kongmap is a free visualization tool which allows you to view and declaratively edit configurations of your Kong API Gateway Clusters, including Routes, Services, and Plugins/Policies. The tool is available for installation on Docker and Kubernetes only at this time.

View list of latest changes/updates here.

GitHub Docker Pulls Version

Features

Cluster View

Allows an admin to view a dynamic map of their Kong API Gateway clusters and visually see relationships between Workspaces (for Kong Enterprise), Services, Routes (Endpoints), and Plugins (Policies). Cluster view can also be used to see configuration of the proxy plane of your Kong for Kubernetes Ingress Controller. Clicking on any entity displays details of the entity and related links. Plugins can be toggled from view and map is searchable (search by entity name, Kong tag, workspace, url, or any other details related to a Kong entity.)

If editing is enabled, any Kong entity can be edited from the Cluster View map. Clicking on the edit button from any entity will send user directly to that entity in the declarative editor.

alt text

Endpoint Analyzer

View details of an API Endpoint (Route). The analyzer shows the Service attached to the endpoint/route as well as provides a breakdown of all plugins/policies in order of execution attached to the route/endpoint. For Kong Enterprise users, all entities can be viewed directly via a link to Kong Manager.

If editing is enabled, any Kong entity can be edited from the Endpoint Analyzer map. Clicking on the edit button from any entity will send user directly to that entity in the declarative editor.

alt text

Declarative Configuration Viewer Editor

KongMap is deployed with a browser based implementation of Kong's CLI tool, decK. Here you can view, edit, and export Kong declarative configurations for your open source and Enterprise clusters via YAML. Configurations can easily be copied and pasted from one Kong cluster to another or between workspaces. Declarative configuration editing can be disabled by KongMap configuration, or managed via RBAC permissions if using Kong Enterprise.

The Viewer/Editor can be invoked from the Cluster Map view by clicking on on any Kong entity, and from any element from the Endpoint Analyzer. Kong entity ID's can be toggled in and out of view with the viewer/editor.

alt text

Compatibility

KongMap supports both Kong Open Source and Kong Enterprise Clusters greater than version 1.3 and supports both DB and Non-DB (dbless) Kong configurations. KongMap also supports Kong for Kubernetes Ingress Controller versions greater than 0.5 (In Kong for Kubernetes, the Ingress Controller's proxy container must have its Admin API exposed in some fashion.)

KongMap uses various public CDN's for various UI elements such as Bootstrap, jQuery, etc. so KongMap will not display correctly in a browser on a closed network without Internet access.

Docker Installation

Docker image is Alpine 3.11 based running PHP 7.3 on Apache. The container exposes both ports 8100 an 8143 with a self signed certificated.

Below are instructions using the docker run command. For an example using docker-compose, see the example in the examples directory folder.

1. Export Cluster Configurations to KONG_CLUSTERS Environment Variable

The connections to your Kong clusters are defined via JSON. The below example illustrates adding two Kong clusters to KongMap:

{
  "my enterprise cluster": {
    "kong_admin_api_url": "http://kongapi_url:8001",
    "kong_edit_config": "true",
    "kong_ent": "true",
    "kong_ent_token": "admin",
    "kong_ent_token_name": "kong-admin-token",
    "kong_ent_manager_url": "http://kongmanager_url:8002"
  },
  "my kong open source cluster": {
    "kong_admin_api_url": "http://kongapi_url:8001",
    "kong_edit_config": "true",
    "kong_ent": "false",
    "kong_ent_token": "null",
    "kong_ent_token_name": "null",
    "kong_ent_manager_url": "null"
  }
}

Below is a definition of all variables in the KONG_CLUSTERS json config. All variables are required.

Parameter Description Required
kong_admin_api_url Full URL to Kong Admin API URL. Make sure there are no trailing slashes in the URL or KongMap will not work properly. Example: http://kongadminapi:8001 yes
kong_edit_config Boolean. Set to true to allow editing of Kong configs via KongMap. false will only allow readonly access to configs. yes
kong_ent Boolean. Set true if you are connecting to a Kong Enterprise Cluster and to enable workspace support in KongMap. Only the default workspace will show if set to false and connected to a Kong Entperprise cluster. Otherwise set to false yes
kong_ent_token The admin token for connecting to your Kong Enterprise Cluster Admin API. Set by RBAC configuration in Kong. Can be set to null if not needed. yes
kong_ent_token_name The admin token header name for connecting to your Kong Enterprise Cluster Admin API. Typically is kong-admin-token. Can be set to null if not needed. yes
kong_ent_manager_url Full URL to a Kong Manager if you wish to open entities in Kong Manager from KongMap. Can be set to null if not needed or if you do not want any Kong Manager buttons shown for the cluster. yes

Export the config to a variable:

 export KONG_CLUSTERS='{  "my enterprise cluster": {    "kong_admin_api_url": "http://kongapi_url:8001",    "kong_edit_config": "true",   "kong_ent": "true",    "kong_ent_token": "admin",    "kong_ent_token_name": "kong-admin-token",    "kong_ent_manager_url": "http://kongmanager_url:8002"  }}'

2. Start Container

Run the container with the following command. Set the ports to your preferred exposed ports. The example below exposes KongMap on ports 8100 and 8143. Notice the KONGMAP_URL variable. Set this variable to the KongMap URL that you will connect to KongMap in your browser. For example, if running locally and exposing KongMap on port 8100, set to http://localhost:8100.

$ docker run -d \
  -e "KONGMAP_CLUSTERS_JSON=$KONG_CLUSTERS" \
  -e "KONGMAP_URL=http://url_to_kongmap:8100" \
  -p 8100:8100 \
  -p 8143:8143 \
  yesinteractive/kongmap

Full documentation available online here: https://github.com/yesinteractive/kong-map/

3. Authentication

If you want to enable authentication to KongMap's UI, it is recommended to run Kongmap behind your Kong Gateway and implement any authentication policies you feel is appropriate (OIDC, OAUTH2, Basic Auth, etc.) at the gateway.

Feedback and Issues

If you have questions, feedback or want to submit issues, please do so here: https://github.com/yesinteractive/kong-map/issues.

kong-map's People

Contributors

nikirago avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

kong-map's Issues

Add Upstreams support

KongMap beautifully displays services and routes. To best envision the deployment adding Upstreams and their Targets to the map would also help visualize the cluster.

View UI KongMap

image
image

Please info for my issue
and step by step for problem solved

Thanks

Kongmap Configuration with Kong Error

I have tried deploying kong-map as a pod in one namespace of kubernetes.

I intend to configure kongmap behind kong with basic auth enabled to it.
Before i enable the basic auth plugin i have added kongmap svc and a route to the kong-admin , below are the configurations -

_format_version: "1.1"
consumers:
- basicauth_credentials:
  - password: <pwdforkongmap>
    username: kongmap
  custom_id: kongmap
  username: kongmap
services:
- connect_timeout: 60000
  host: kongmap-svc.kong.svc.cluster.local
  name: kongmapsvc
  path: /             // I have tried different path as well like /0 , /$ etc...
  port: 80         // changed the access port to 80 in k8s svc object. Able to access kongmap via ELB
  protocol: http
  read_timeout: 60000
  retries: 5
  routes:
  - https_redirect_status_code: 426
    name: kongmaproute
    path_handling: v1
    paths:
    - /0,/$                // I have tried different paths as well like  /0 , /$ , /kongmap , /  etc...
    preserve_host: true              // also tried disabling and enabling in combination with strip_path
    protocols:
    - http
    - https
    regex_priority: 1
    request_buffering: true
    response_buffering: true
    strip_path: false       // also tried disabling and enabling in combination with preserve_host
  write_timeout: 60000

When i try to access my kongmap via kong-proxy endpoint …
i am getting
{"message":"no Route matched with those values"}

And since the url of kongmap changes dynamically on Ui access to different internal routes -
like /0 or /deck/edit/0/0 on edit configs… How do we configure this dynamically in kong end for routes and svc.

Could you please help me on what i am actually missing here…

Custom plugin throws error when analyzing endpoint

Notice: Undefined index: signalsciences in /app/controllers/fsl_controllers.php on line 418

Not sure if the audit log error is related, but see these in the Kong Logs:

2020/10/22 04:09:23 [error] 24#0: *22944 [kong] audit_log.lua:229 could not deserialize/serialize JSON payload to table: bad argument #1 to '?' (string expected, got nil) while logging request, client: 172.20.0.5, server: kong_admin, request: "GET /default/plugins HTTP/1.1", host: "kong-ent1:8001"```

Source code?

Hi,

interesting project, but where is the source code?

[feature] Make map searchable

When there are as many routes as will be in a well-populated environment, it sure would be handy to have a search or filter capability available. You make the name visible in the map, but it's not searchable as far as I can tell.

deploy kongmap on kubernetes

Sorry i'm a bit confused, hoping to get enlightenment, I want to deploy kongmap over kubernetes, but because in the latest version of kong there is no Admin API, I don't understand how to communicate and how to deploy kongmap over Kube / openshift, thank you

Mixed Content on View/Edit Cluster Config

When opening the View/Edit Cluster Config page if kongmap is hosted in k8s on port 80 and made available via kong with an ssl certificate, the page will not load since ace.js is loaded via http:

Mixed Content: The page at 'https://kongmap.domain.de/deck/edit/1/0' was loaded over HTTPS, but requested an insecure script 'http://ajaxorg.github.io/ace-builds/src-noconflict/ace.js'. This request has been blocked; the content must be served over HTTPS.

Redirect on View/Edit Cluster Config when there is a redirect in kong

So I added a plugin to one of my routes to do ra request termination with these settings:

config:
  status_code: 301
  content_type: "text/html"
  body: "<meta http-equiv=\"refresh\" content=\"0; URL='https://domain.de/target/'\" />"

When clicking on "View/Edit Cluster Config" in KongMap, I get the loading screen and at one point during load, I get redirected to "https://domain.de/target" just like it is defined in the plugin..

Do not see entity in kongmap that is visible in Kong Manager

Kongmap config
{"my enterprise cluster":{"kong_admin_api_url":"http://api.kong.lan:8001/","kong_edit_config":"false","kong_ent":"true","kong_ent_token":"***","kong_ent_token_name":"kong-admin-token","kong_ent_manager_url":"http://manager.kong.lan:8002/"}}

Docker-compose

kongmap:
    image: docker.io/yesinteractive/kongmap
    container_name: kongmap
    networks:
      - demo-net
    environment:
      - KONGMAP_CLUSTERS_JSON=$KONG_CLUSTERS
      - KONGMAP_URL=http://api.kong.lan:8100
    restart: always
    ports:
      - "8100:8100"
      - "8143:8143"

image

image

Viewing nothing when using Kong Ingress

I was trying to visualize my cluster. we are using KongIngress and the cluster was added propperly..
Even when klicking on edit (view mode only) the konfig gets loaded and all services are listed..
But I can only see the Kong Logo in the "view" part... No errors anywhere..

caching option for very large clusters

Add ability to a caching option to cluster config so that the map does not need to be regenerated for very large clusters every time the map is viewed. Give option to refresh/regenerate map on demand for clusters that are configured to be cached.

Pop-ups don't show content correctly in map view

Underlying library vis-network was updated on 1/10/21 to version 9 and as a result some elements of the Kongmap map view is broken, including the popup formatting. Will update kongmap to use version older 8.5.6 version of vis-network and work to support version 9 in the future.

AH00558: httpd: Could not reliably determine the server's fully qualified domain name

Hi,

Running the default docker command on Mac M1 Pro (Monterey 12.3), im getting this error:

AH00015: Unable to open logs AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 172.25.0.2. Set the 'ServerName' directive globally to suppress this message [Sun Mar 20 19:06:15.851957 2022] [core:emerg] [pid 1] (38)Function not implemented: AH00023: Couldn't create the mpm-accept mutex (38)Function not implemented: could not create accept mutex AH00015: Unable to open logs

Docker command
docker run -d \ -e "KONGMAP_CLUSTERS_JSON=$KONG_CLUSTERS" \ -e "KONGMAP_URL=http://url_to_kongmap:8100" \ -p 8100:8100 \ -p 8143:8143 \ yesinteractive/kongmap

The same command on windows machine works perfectly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.