Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consumer groups with tags and distributed configuration #840

Open
gregoirechauvet opened this issue Feb 7, 2023 · 2 comments
Open

Consumer groups with tags and distributed configuration #840

gregoirechauvet opened this issue Feb 7, 2023 · 2 comments

Comments

@gregoirechauvet
Copy link

gregoirechauvet commented Feb 7, 2023

Tags have been added to consumer groups in #823
But despite this addition, it seems a distributed configuration doesn't work with consumer groups.
I've tested it on deck v1.17.2 which is the version that includes the consumer group tags addition.

Reproduction

Create consumer groups from a configuration with select_tags: global.

# In config/consumer-groups.yml
_format_version: "3.0"
_konnect:
  runtime_group_name: default

_info:
  select_tags:
  - global

consumer_groups:
- name: gold
  plugins:
  - name: rate-limiting-advanced
    config:
      limit:
      - 200
      window_size:
      - 60
      window_type: sliding
deck sync -s config/

And then try to create a service from another location with another select tag:

# In my-service/services.yml
_format_version: "3.0"
_konnect:
  runtime_group_name: default

_info:
  select_tags:
  - client-api

services:
- name: client-api
  host: example.domain
  port: 80
  path: /api
  protocol: http
deck diff -s my-service/

It results in the following output. The consumer groups should be deleted from decK's perspective. Whereas other entities such as services and plugins are ignored properly.

creating service client-api
deleting consumer-group gold
Summary:
  Created: 1
  Updated: 0
  Deleted: 1

Investigation

I've investigated decK hoping I could contribute to it by fixing this behavior. But my conclusion is that the error comes from the /v1/consumer-groups endpoint that doesn't filter on tags:

data, next, err := list(ctx, client, "/v1/consumer-groups", opt)

The full endpoint decK is using in my case is:

https://eu.api.konghq.com/konnect-api/api/runtime_groups/[RUNTIME_GROUP_ID]/v1/consumer-groups

I've tried it on the CLI, and it ignores the tags when sent as parameters (?tags=client-api). As opposed to endpoints such as /services which filter correctly on tags.
I could not find any documentation about /v1/consumer-groups, only about /consumer_groups.
Any reason not to use the second one instead? Should the first one be documented?

@aboudreault
Copy link
Contributor

@gregoirechauvet Thank you very much for this ticket, and your investigation! I have been able to reproduce the issue with your steps. There are indeed 2 different issues:

  1. the tags filtering doesn't work as expected with the konnect endpoint
  2. the tags filter is not added properly by deck (like the other endpoints).

we are going to provide fixes as soon as possible and keep you on touch.

About the different endpoints for consumer groups, this is expected. There are some differences in the implementation between Konnect (saas) vs Kong. Usually, konnect users don't deal with the endpoint directly so that's why it is not documented.

@GGabriele
Copy link
Collaborator

Hi @gregoirechauvet , would you mind testing it again with decK v1.25.0? This version should have fixed this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants