【问题标题】:How to access Kong admin API when Kong is deployed using Kong-Ingress-Controller使用 Kong-Ingress-Controller 部署 Kong 时如何访问 Kong 管理 API
【发布时间】:2020-06-26 09:23:54
【问题描述】:

我已经使用 Minikube Kong-Ingress-Controller 安装了 Kong

服务如下所示。现在我正在尝试查找 kong admin API,以便可以在其上安装 Konga 仪表板,但不知道在哪里可以找到它

我不确定我是否遵循了正确的流程。 谁能帮我访问 Kong 管理 API?

【问题讨论】:

    标签: kubernetes-ingress minikube kong kong-ingress


    【解决方案1】:

    使用kubectl port-forward deployment/ingress-kong -n kong 8444:8444

    【讨论】:

      【解决方案2】:

      您可以在 GitHub 问题中关注此响应。 https://github.com/Kong/kubernetes-ingress-controller/issues/59#issuecomment-534380451

      在链接失效的情况下扩展。您需要创建一个服务来公开管理 API 端点,并在 kong 入口控制器部署中设置 env var 和端口。

      apiVersion: v1
      kind: Service
      metadata:
        name: kong-admin
        namespace: kong
      spec:
        type: NodePort
        ports:
        - name: admin
          port: 8001
          protocol: TCP
          targetPort: 8001
        - name: admin-ssl
          port: 8444
          targetPort: 8444
          protocol: TCP
        selector:
          app: ingress-kong
      
      apiVersion: extensions/v1beta1
      kind: Deployment
      metadata:
        labels:
          app: ingress-kong
        name: ingress-kong
        namespace: kong
      spec:
        ...
        template:
          ...
          spec:
            containers:
              - env:
                  ...
                  - name: KONG_ADMIN_LISTEN
                    value: 0.0.0.0:8001,0.0.0.0:8444 ssl
                  - name: KONG_PROXY_LISTEN
                    value: 0.0.0.0:8000,0.0.0.0:8443 ssl
                image: kong:1.3
                name: proxy
                ports:
                  - containerPort: 8001
                    name: admin
                    protocol: TCP
                  - containerPort: 8444
                    name: admin-ssl
                    protocol: TCP
                  - containerPort: 8000
                    name: proxy
                    protocol: TCP
                  - containerPort: 8443
                    name: proxy-ssl
                    protocol: TCP
                  - containerPort: 9542
                    name: metrics
                    protocol: TCP
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2020-01-16
        • 2020-08-23
        • 2021-11-08
        • 2018-12-25
        • 2019-07-20
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多