gpt4 book ai didi

kubernetes - Kong 入口 Controller 出现错误 "no Route matched with those values"

转载 作者:行者123 更新时间:2023-12-02 11:38:40 24 4
gpt4 key购买 nike

尝试连接到在使用 Kong 作为入口 Controller 的云托管 Kubernetes 服务上运行的 Jupyter Lab 容器(最终也包括其他应用程序)。收货"no Route matched with those values"在对 Kong 的公共(public) IP 的 http 响应和入口 Controller 日志中表明:

service kong/rjup2 does not have any active endpoints
no configuration change, skipping sync to Kong
部署配置:
apiVersion: apps/v1
kind: Deployment
metadata:
name: rjup2
namespace: kong
spec:
selector:
matchLabels:
run: rjup2
replicas: 1
template:
metadata:
labels:
run: rjup2
spec:
restartPolicy: Always
containers:
- name: rjup2
image: jupyter/minimal-notebook
imagePullPolicy: Always
ports:
- containerPort: 8888
protocol: TCP
服务配置:
apiVersion: v1
kind: Service
metadata:
name: rjup2
namespace: kong
spec:
selector:
app: rjup2
type: ClusterIP
ports:
- name: http
port: 80
targetPort: 8888
protocol: TCP
入口资源配置:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: rjup2
namespace: kong
spec:
tls:
- hosts:
- <AKS API server address>
rules:
- host: <AKS API server address>
http:
paths:
- path: /
backend:
serviceName: rjup2
servicePort: 80
API Server Address已在部署的 YAML 中正确填充。在将它们合并到 Kong 的默认命名空间之前,我尝试了不同的命名空间,并且除了容器目标端口之外,还尝试将服务端口设置为 8888。
感谢您在调试时提供的任何帮助。

最佳答案

您的 rjup2 Service没有有效的选择器。请注意 Pods您尝试公开的标记为 run: rjup2标签和您的Serviceapp: rjup2选择器。
顺便提一句。您会收到非常清晰的错误消息,指出问题可能出在哪里:

service kong/rjup2 does not have any active endpoints
如果您的 rjup2服务于 kong命名空间没有任何事件端点,这意味着它不会暴露您的 Pods正确,这可能表明您的配置可能不匹配。
您可以通过运行来检查它:
kubectl get ep -n kong
通常你应该看到匹配的 Endpoints目的。在您的情况下,您不会将其视为您的 Service除非有有效的选择器,否则不能公开任何 pod。
如果您修复了 Service定义,一切都应该正常工作:
apiVersion: v1
kind: Service
metadata:
name: rjup2
namespace: kong
spec:
selector:
run: rjup2
type: ClusterIP
ports:
- name: http
port: 80
targetPort: 8888
protocol: TCP

关于kubernetes - Kong 入口 Controller 出现错误 "no Route matched with those values",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63273727/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com