Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 03:19
    lovejj1994 commented #6746
  • 03:18
    lovejj1994 commented #6746
  • Jan 20 21:57
    jmdacruz commented #1195
  • Jan 20 19:47

    locao on next

    tests(stress) test upstreams up… (compare)

  • Jan 20 19:47

    locao on update_upstreams_stress_testing

    (compare)

  • Jan 20 19:47
    locao closed #6750
  • Jan 20 19:33
    murillopaula commented #6750
  • Jan 20 19:31

    bungle on bump-healthchecks-2.0.0

    (compare)

  • Jan 20 19:31
    bungle closed #6731
  • Jan 20 19:00
    murillopaula commented #6035
  • Jan 20 18:50
    fffonion commented #6740
  • Jan 20 18:42
    murillopaula commented #6740
  • Jan 20 18:42
    murillopaula commented #6740
  • Jan 20 18:42
    murillopaula commented #6740
  • Jan 20 18:41
    murillopaula commented #6740
  • Jan 20 18:41
    murillopaula commented #6740
  • Jan 20 18:40
    bungle closed #6734
  • Jan 20 18:40
    bungle commented #6734
  • Jan 20 18:38
    murillopaula commented #6740
  • Jan 20 18:35
    bungle closed #6708
hadhemiGH
@hadhemiGH
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: demo
spec:
rules:
  • http:
    paths:
    • path: /foo
      backend:
      serviceName: gateway-external
      servicePort: 31112
how can I fix this
NB: the 31112 port is the openfaas gateway port
Priyansh Jain
@Presto412

Hi everyone, I'm adding unit tests to kong via luaunit, in a dockerized kong environment. This is the dockerfile

FROM kong:2.0.3-alpine
USER root
WORKDIR /usr/local
COPY . .
RUN luarocks make *.rockspec
RUN ./run-tests.sh
USER kong

and here's the run-tests script

#!/bin/sh

find . -name "*-test.lua" |
    while read -r filename; do
        echo "Executing test for: $filename"
        /usr/local/openresty/luajit/bin/luajit "$filename"
    done

This is how I'm running the individual unit tests. I have added stubs for some dependencies, but the actual code makes use of kong's logging feature kong.log("...")

When I run the tests, it shows that the global kong is a nil value

Can anyone please help?

sumantfordev
@sumantfordev
How to build kong in FIPS mode? Is that supported, which modules can be used in FIPS mode?
Ygor Medvedev
@YegorMedvedev

Hey guys! I'm facing an issue with go-lang pointers in configuration type. Here is my config

type Config struct {
  NestedKey struct {
    ListOfValues     []*string `json: "list_of_values,omitempty"`
  }
}

func (conf Config) Access(kong *pdk.PDK) {...}

And when I send an HTTP request in order to create a plugin it returns an error like

schema violation (config.nestedkey: {\n  list_of_values = \"unknown field\"\n})

Please help me to solve this issue...

Cosimo Damiano Prete
@CDPrete

Hey guys! I'm facing an issue with go-lang pointers in configuration type. Here is my config

type Config struct {
  NestedKey struct {
    ListOfValues     []*string `json: "list_of_values,omitempty"`
  }
}

func (conf Config) Access(kong *pdk.PDK) {...}

And when I send an HTTP request in order to create a plugin it returns an error like

schema violation (config.nestedkey: {\n  list_of_values = \"unknown field\"\n})

Please help me to solve this issue...

I've also the same issue: Kong/kong#6363

cmarocco
@cmarocco
Hey gus! Is the workspace feature available only in Kong EE?
jeremyjpj0916
@jeremyjpj0916
well its in the CE database as well with less fields, I just don't think the admin api calls are exposed for it. Enterprise docs list it here: https://docs.konghq.com/enterprise/2.1.x/admin-api/workspaces/reference/ , ofc you can always fork and add a wrapper to edit your own workspace in open source but I can't think of any value for it in the CE with how its defined right now.
Grant Magdanz
@grant34_gitlab
Hi all, I'm writing a go plugin and am wondering how I can expose multiple environment variables to the plugin? I found this issue: Kong/kong#6149 that suggests setting KONG_NGINX_MAIN_ENV. This works for a single variable, but I need to expose multiple. Any idea how I can do that? Thanks in advance.
Saran
@Sarankrishna
Hi all, I have installed kong on Kubernetes pod. While configuring the service in kong I used kubernetes service name as "host". When accessing the API through Kong , I am getting error "name resolution failed".
So is it possible to use the kubernetes service name as host in kong service configuration?
1 reply
hadhemiGH
@hadhemiGH
hello everyone I want to create a Kong CORS Plugin to enable all origins and all headers using a kubernetes Ingress rule ... how can I do so ?
Shailesh Goel
@shailesh91
Hi All, I recently started working with kong and am looking into some insight into the workings of the bundled plugin "response-ratelimiting". I have tried creating a rate limit at a consumer level and the other at a service level. I am currently observing only the consumer limit is being applied. Is this expected behavior? If so why?
mvanmeerbeck
@mvanmeerbeck
Hello Kongers,
I'm currently considering using Kong for my gateway since i need rate limit on my APIs. I need to limit the API per pricing plan. Is there a way to do that ?
I've seen that we can limit an API per consumer. But that's not enough for my case, i would need to define a rate limit per "type of user" (maybe with a tag?) but be counted by "credential".
Vladimir Murray
@vl4d

Good day all I may log an issue but I'd like to check here first, I have a simple go plugin setup and I would like to run db_import command but I always get the following error message whenever the custom plugin is enabled in the plugins env var:

2020/10/06 17:04:24 [verbose] Kong: 2.1.4
Error: 
/usr/local/share/lua/5.1/kong/db/dao/plugins/go.lua:42: attempt to index upvalue 'kong' (a nil value)
stack traceback:
        /usr/local/share/lua/5.1/kong/db/dao/plugins/go.lua:42: in function 'is_on'
        /usr/local/share/lua/5.1/kong/db/schema/plugin_loader.lua:184: in function 'load_subschema'
        ...are/lua/5.1/kong/db/schema/others/declarative_config.lua:222: in function 'load_plugin_subschemas'
        ...are/lua/5.1/kong/db/schema/others/declarative_config.lua:234: in function 'load_plugin_subschemas'
        ...are/lua/5.1/kong/db/schema/others/declarative_config.lua:730: in function 'load'
        /usr/local/share/lua/5.1/kong/db/declarative/init.lua:37: in function 'new_config'
        /usr/local/share/lua/5.1/kong/cmd/config.lua:82: in function 'cmd_exec'
        /usr/local/share/lua/5.1/kong/cmd/init.lua:88: in function </usr/local/share/lua/5.1/kong/cmd/init.lua:88>
        [C]: in function 'xpcall'
        /usr/local/share/lua/5.1/kong/cmd/init.lua:88: in function </usr/local/share/lua/5.1/kong/cmd/init.lua:45>
        /usr/local/bin/kong:9: in function 'file_gen'
        init_worker_by_lua:49: in function <init_worker_by_lua:47>
        [C]: in function 'xpcall'
        init_worker_by_lua:56: in function <init_worker_by_lua:54>
2020/10/06 17:04:24 [verbose] prefix in use: /usr/local/kong

Has any 1 seen this before?

Ygor Medvedev
@YegorMedvedev
Hello guys,
How can I set a priority for Golang plugin in Kong?
Dinesh
@samdinesh86
Good Day, has any one tried setting up openid-connect plugin with Identity server?
Christos
@christos312_gitlab
Hello, i used the kong AWS cloudformation template, and when I login to the EC2 instance and type env I dont see any variables.
If I want to change something, how can i do it?
Haseeb ur Rehman
@professorhaseeb
Can i connect to a api server which is protected by oauth2 using kong and deliver the response via kong service? Ia this something that can be done with kong gayeway?
rahulwinzo
@rahulwinzo
Is it possible to write a custom plugin for routing requests in Kong? I need to route a request based upon some database lookup.
Harish
@vasuharish
@rahulwinzo I think this plugin will give you an idea https://docs.konghq.com/hub/kong-inc/route-by-header/ . It is used to route based on headers.
Abraão Silva
@abraaojs
Hello guys, I would like to know from which version the kong entreprise is compatible with K8S
?
Ajit Pratap Singh
@ajitpratap0
hey everyone, We are using kong 2.0, the requirement that we have is to have a different public uri and redirect the incoming request to a different uri of the upstream server which has a path variable, checked a lot of resources but still facing issues, can someone help?
mkcloner
@mkcloner
hi there , suppose a situation in which a consumer has rate-limit plugin (200 request per month ), and this consumer uses 100 requests of his rate-limit , and then if we backup the kong by deck and restore the kong entities in another server , we see that mentioned consumer again has the rate-limit of 200 requests remaining ( otherwise this consumer should have the 100 request reamining ) and it show that the metrics of rate-limit plugin reset after backup-restore of kong . what should i do to solve this issue ?
Abraão Silva
@abraaojs
nginx: [error] init_by_lua error: /usr/local/share/lua/5.1/kong/init.lua:180: attempt to call local 'handler' (a table value)
help?
prafultamrakar
@prafultamrakar
failed (111: Connection refused), context: ngx.timer, client:xxx.xxx.xxx.xxx, server: 0.0.0.0:8443
1 reply
Yasir Karam
@yasir2000
Hi, am fairly new to Kong, I have Kong on Kubernetes/Kubesphere cluster-node and I cant add rules nor access Admin GUI over web even I added ingress, can anyone help pls?
mvillafuertem
@mvillafuertem

Hi there,

I am new to kong, I'm trying enable go_plugins, but I get this error. Any hint?

This is my kong.conf

plugins = bundled,go-hello
go_pluginserver_exe = /usr/local/bin/go-pluginserver
go_plugins_dir = /usr/local/kong/go_plugins/

I'm using this docker-compose https://github.com/baxiang/docker_compose/blob/master/kong/docker-compose.yml

Thanks in advance.

kong              | sh: /usr/local/bin/go-pluginserver: not found
kong              | 2020/11/23 11:08:22 [error] 1#0: init_by_lua error: /usr/local/share/lua/5.1/MessagePack.lua:813: missing bytes
kong              | stack traceback:
kong              |     [C]: in function 'error'
kong              |     /usr/local/share/lua/5.1/MessagePack.lua:813: in function 'underflow'
kong              |     /usr/local/share/lua/5.1/MessagePack.lua:529: in function 'unpack_cursor'
kong              |     /usr/local/share/lua/5.1/MessagePack.lua:843: in function 'unpack'
kong              |     /usr/local/share/lua/5.1/kong/db/dao/plugins/go.lua:463: in function 'get_plugin_info'
kong              |     /usr/local/share/lua/5.1/kong/db/dao/plugins/go.lua:472: in function 'get_plugin'
kong              |     /usr/local/share/lua/5.1/kong/db/dao/plugins/go.lua:519: in function 'load_plugin'
kong              |     /usr/local/share/lua/5.1/kong/db/dao/plugins.lua:159: in function 'load_plugin_handler'
kong              |     /usr/local/share/lua/5.1/kong/db/dao/plugins.lua:243: in function 'load_plugin'
kong              |     /usr/local/share/lua/5.1/kong/db/dao/plugins.lua:295: in function 'load_plugin_schemas'
kong              |     /usr/local/share/lua/5.1/kong/init.lua:467: in function 'init'
kong              |     init_by_lua:3: in main chunk
kong              | nginx: [error] init_by_lua error: /usr/local/share/lua/5.1/MessagePack.lua:813: missing bytes
kong              | stack traceback:
kong              |     [C]: in function 'error'
kong              |     /usr/local/share/lua/5.1/MessagePack.lua:813: in function 'underflow'
kong              |     /usr/local/share/lua/5.1/MessagePack.lua:529: in function 'unpack_cursor'
kong              |     /usr/local/share/lua/5.1/MessagePack.lua:843: in function 'unpack'
kong              |     /usr/local/share/lua/5.1/kong/db/dao/plugins/go.lua:463: in function 'get_plugin_info'
kong              |     /usr/local/share/lua/5.1/kong/db/dao/plugins/go.lua:472: in function 'get_plugin'
kong              |     /usr/local/share/lua/5.1/kong/db/dao/plugins/go.lua:519: in function 'load_plugin'
kong              |     /usr/local/share/lua/5.1/kong/db/dao/plugins.lua:159: in function 'load_plugin_handler'
kong              |     /usr/local/share/lua/5.1/kong/db/dao/plugins.lua:243: in function 'load_plugin'
kong              |     /usr/local/share/lua/5.1/kong/db/dao/plugins.lua:295: in function 'load_plugin_schemas'
kong              |     /usr/local/share/lua/5.1/kong/init.lua:467: in function 'init'
kong              |     init_by_lua:3: in main chunk
1 reply
mvillafuertem
@mvillafuertem
bash-5.0# ls -la /usr/local/bin/
total 8012
drwxr-xr-x    1 1000     1000          4096 Nov 23 14:51 .
drwxr-xr-x    1 root     root          4096 Sep 22 18:32 ..
drwxr-xr-x    1 root     root          4096 Nov 23 14:51 go-plugins
-rwxr-xr-x    1 root     root       8151112 Nov 23 14:51 go-pluginserver
-rwxr-xr-x    1 1000     1000           451 Sep 18 18:51 json2lua
-rwxr-xr-x    1 kong     root           238 Sep 18 18:51 kong
-rwxr-xr-x    1 1000     1000           450 Sep 18 18:51 lapis
-rwxr-xr-x    1 1000     1000           451 Sep 18 18:51 lua2json
-rwxr-xr-x    1 1000     1000          1482 Sep 18 18:51 luarocks
-rwxr-xr-x    1 1000     1000           964 Sep 18 18:51 luarocks-admin
tanvir-appveen
@tanvir-appveen

Hi, my microservices receive https traffic on a non-443 port.

While accessing my website api - I get the following error in the network tab in Chrome
(failed)net::ERR_HTTP2_PROTOCOL_ERROR

and the logs of the kong proxy pod show that its using http to access the pods of the application

I have the following questions

  1. How do I make sure it uses https to communicate with my microservices? In the official K8s ingress, I just an annotation : nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"

  2. How do I enforce HTTP 1.1 instead of HTTP2?

mvillafuertem
@mvillafuertem
everything works after installing glibc. https://github.com/sgerrand/alpine-pkg-glibc
haoweiguang
@haoweiguang
how to debug kong custom plugins?
mvillafuertem
@mvillafuertem
@haoweiguang +1 how to debug kong custom plugins? How to log from custom plugin?
1 reply
Daniele Favara
@nomed
hi all
Lukáš Kováč
@bossqone
Hello, I'm trying to create yaml config for deck but I cannot use yaml references. Any idea how to fix it/workaround it?
_format_version: "2.1"

.rbac_config: &rbac_config
  roles: [ ]
  roles_claim_name: roles
  token_in_header: X-Identity

services:
  - name: dummy-service
    url: http://localhost:8080
    routes:
      - name: getData
        paths:
          - /data
        methods:
          - GET
        plugins:
          - name: jwt-auth-rbac
            config:
              <<: *rbac_config
              roles:
                - admin
                - designer
                - operator
      - name: postData
        paths:
          - /data
        methods:
          - POST
        plugins:
          - name: jwt-auth-rbac
            config:
              <<: *rbac_config
              roles:
                - admin
deck validate --verbose 2
Error: reading file: validating file content: 1 errors occurred:
        (root): Additional property .rbac_config is not allowed
Shashi Ravula
@SMR39
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
  namespace: app1-stage-namespace
  name: app1-ip-whitelisting
config: 
  whitelist: ip1, ip2
plugin: ip-restriction
apiVersion: extensions/v1beta1         
kind: Ingress
metadata:     
  name: analytics-app1
  namespace: app1-stage-namespace
  annotations:                                                      
    konghq.com/strip-path: "true"
    konghq.com/plugins: analytics-app1-key-auth, analytics-ip-whitelisting
    configuration.konghq.com: force-https

spec:
  rules:
  - host: api.example.me
    http:
      paths:
      - path: /app1
        backend:
          serviceName: app1-stage-service
          servicePort: 3000
hello I followed the documentation for ip whitelisting plugin and came up with this but i can still reach this endpoint from everywhere
instead of just ip1 or ip2
Shashi Ravula
@SMR39
curl -k http://localhost:8001/plugins | jq when I type this i dont even see the plugin registered in admin api
does anybody have experience setting it up on kubernetes ?
everfavio
@everfavio

Hi guys! I hope you are having a good day, today I have a problem when Im trying to install kong ingress with helm and postgresql (for practice purposes)
Im using helm chart to install that, using this values.yaml file:

env:
  database: 'postgres'
  pg_host: '172.21.3.90'
  pg_port: 5432
  pg_user: 'kongtest'
  pg_password: 'kongtest'
  pg_database: 'kongtest'

ingressController:
  installCRDs: false
  ingressClass: kong-test

admin:
  enabled: true
  http:
    enabled: true
  tls:
    enabled: false
  ingress:
    enabled: true
    annotations:
      kubernetes.io/ingress.class: kong-test
      konghq.com/strip-path: "true"
    path: /kong
helm install kong-test kong/kong  values.yaml

but the deployment stucks with this states:

kong-test-kong-58c6d94bd9-t7vds                           0/2     Init:0/1    0          133m
kong-test-kong-init-migrations-kndjn                      0/1     Completed   0          133m

and the pod logs show me this:

F1203 14:31:13.859375   25215 helpers.go:115] error: a container name must be specified for pod kong-test-kong-58c6d94bd9-t7vds, choose one of: [ingress-controller proxy] or one of the init containers: [wait-for-db]

anyone have any idea how i could solve this? thanks!

everfavio
@everfavio
Another interesting thing is that the seeds have been executed correctly, checking the database it has been populated correctly with the tables that kong creates
everfavio
@everfavio

Finally I found the solution adding this env var in my values.yaml

KONG_LUA_PACKAGE_PATH: './?.lua;./?/init.lua;'

according to this post:
Kong/kong#6022

Im not implementing any new plugin, only a new fresh kong ingress instance inside k8s, but its works for me.

Mohammadhadi Dodangeh
@hadi2d
Hi guys I want to set basic auth for a query string in the router
eg.:
/forum/questions/ # no auth
/forum/questions/?my_questions=true # with auth
Do you have a solution?
Jesse Quinn
@jessequinn
hi im a little confused on how to create a custom nginx template. For instance, i want to add a location directive in the kong_nginx.lua. The documentation says "contents of the nginx_kong.lua template follow”. Do we literally copy the entire file? I believe not, but what can we actually use from this lua file (https://github.com/Kong/kong/blob/master/kong/templates/nginx_kong.lua)? Everything minus the Return?
225559
@225559
Hi Kong developers,
I'm curious if there's any interest in having a Kong section on Lua forum?