0

我想在 Kong 中使用一个片段。我需要在入口中添加一些特定的规则。

我发现最好的东西是 Nginx 中的一个片段,所以我在 Kong ingress 中使用 Nginx 片段,如下所示:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
    name: test
    namespace: test
    annotations:
    kubernetes.io/tls-acme: "true"
    cert-manager.io/cluster-issuer: letsencrypt-pro-dns
    konghq.com/protocols: https
    konghq.com/https-redirect-status-code: "301"
    kubernetes.io/ingress.class: kong
    konghq.com/configuration-snippet: |
        location /test {
        return 404;
        }
spec:
    tls:
    - secretName: test-com
    hosts:
    - '*.example.com'
    - example.com
    rules:
    - host: test.example.com
    http:
        paths:
        - backend:
            service:
            name: test
            port:
                number: 8080
        path: /
        pathType: Prefix

它不起作用,我如何在 Kong ingress 中使用片段或类似的东西?

4

0 回答 0