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

Feat/new plugins anns #124

Merged
merged 2 commits into from
Sep 12, 2018
Merged

Feat/new plugins anns #124

merged 2 commits into from
Sep 12, 2018

Conversation

hbagdi
Copy link
Member

@hbagdi hbagdi commented Sep 11, 2018

Allow configuring plugins in Kong using plugins.konghq.com annotation, making it user friendly.

@codecov-io
Copy link

codecov-io commented Sep 11, 2018

Codecov Report

Merging #124 into master will increase coverage by 0.22%.
The diff coverage is 24.24%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #124      +/-   ##
==========================================
+ Coverage   31.46%   31.68%   +0.22%     
==========================================
  Files          33       33              
  Lines        2937     2954      +17     
==========================================
+ Hits          924      936      +12     
- Misses       1900     1904       +4     
- Partials      113      114       +1
Impacted Files Coverage Δ
internal/ingress/controller/kong.go 1.15% <0%> (-0.02%) ⬇️
internal/ingress/annotations/annotations.go 91.66% <80%> (-8.34%) ⬇️
cli/ingress-controller/main.go 22.22% <0%> (+2.61%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2550758...30687be. Read the comment docs.

…ions

Currently, plugins in Kong are configured using the following
annotation: `key-auth.plugin.konghq.com: <name of KongPlugin CR>`.

This works fine but decouples the configuration of a plugin from the
name of the plugin to which that configuration should be applied to.
In practise, it rarely happens that plugin configs are reusable across
different types/kinds (key-auth, rate-limiting etc) of plugins.

This change introduces a method to parse an annotation of the form
`plugins.konghq.com`, which allow you to specify KongPlugin Custom
Resources(CR) as a CSV, which can be applied to an entity in Kong (route
or service or consumer).
This change allows an end-user to configure a plugin on a route or a
service in Kong using a new annotaion: `plugins.konghq.com`.
This annotations should contain a CSV list of KongPlugin CR names which
should be applied.

This should make it easier for the end user to configure plugins on
Ingress resources and k8s Services.

The old way of configuration plugins:
`<plugin-name>.plugin.konghq.com: <KongPlugin CR name>`
is deprecated but still supported, giving users time to migrate to new
annotations. There will be a documentation commit made in future to
reflect the same.
@hbagdi
Copy link
Member Author

hbagdi commented Sep 11, 2018

Thanks for the review @fffonion!
I've updated the code.

@hbagdi hbagdi merged commit 6ea7f3e into master Sep 12, 2018
@hbagdi hbagdi deleted the feat/new-plugins-anns branch September 12, 2018 21:56
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

Successfully merging this pull request may close these issues.

3 participants