使用声明式配置在 KONG Kubernetes 中自定义插件配置

发布于 2025-01-11 00:38:15 字数 111 浏览 3 评论 0原文

我在 Kubernetes 中以 DB less 模式使用 KONG。我正在尝试以声明性方式添加插件。

在哪里可以找到 Kubernetes 的配置文件?

如何在该文件中添加插件?

I'm using KONG in Kubernetes in DB less mode. I'm trying to add plugins in a declarative way.

Where can I find the config file for Kuberenetes?

How to add the plugins in that file?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

森林很绿却致人迷途 2025-01-18 00:38:15

您可以使用 Console(UI) 将插件安装到 Kong,或者您可以通过使用 docker build 安装来添加 使用

lua 安装插件的示例 docker 文件

FROM kong:2.0.3-alpine
LABEL description=”Alpine + Kong 2.0.3 + kong-oidc plugin”ENV OIDC_PLUGIN_VERSION=1.1.0–0
ENV JWT_PLUGIN_VERSION=1.1.0–1
USER root
RUN apk update && apk add git unzip luarocks
RUN luarocks install kong-oidc
RUN git clone — branch 20200505-access-token-processing https://github.com/BGaunitz/kong-plugin-jwt-keycloak.git \
 && cd kong-plugin-jwt-keycloak \
 && luarocks make
RUN luarocks pack kong-plugin-jwt-keycloak ${JWT_PLUGIN_VERSION} \
 && luarocks install kong-plugin-jwt-keycloak-${JWT_PLUGIN_VERSION}.all.rock
USER kong

docker 构建完成后,您可以更新镜像。

如果您需要更多信息,可以进一步参考我的文章: https://faun.pub/building-kong-custom-docker-image-add-a-customized-kong-plugin-2157a381d7fd

You can install the plugin to Kong with Console(UI) or else you can add by installing with docker build

Example docker file installing Plugin with lua

FROM kong:2.0.3-alpine
LABEL description=”Alpine + Kong 2.0.3 + kong-oidc plugin”ENV OIDC_PLUGIN_VERSION=1.1.0–0
ENV JWT_PLUGIN_VERSION=1.1.0–1
USER root
RUN apk update && apk add git unzip luarocks
RUN luarocks install kong-oidc
RUN git clone — branch 20200505-access-token-processing https://github.com/BGaunitz/kong-plugin-jwt-keycloak.git \
 && cd kong-plugin-jwt-keycloak \
 && luarocks make
RUN luarocks pack kong-plugin-jwt-keycloak ${JWT_PLUGIN_VERSION} \
 && luarocks install kong-plugin-jwt-keycloak-${JWT_PLUGIN_VERSION}.all.rock
USER kong

Once docker is built you can update the image.

You can refer my article further if you need more information : https://faun.pub/building-kong-custom-docker-image-add-a-customized-kong-plugin-2157a381d7fd

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文