967 B
967 B
本文作者:丁辉
Ingress公开TCP和UDP服务
-
添加 Ingress 启动参数
- --tcp-services-configmap=$(POD_NAMESPACE)/ingress-nginx-tcp - --udp-services-configmap=$(POD_NAMESPACE)/ingress-nginx-udp
-
创建 Configmap
格式为::<namespace/service name>:[PROXY]:[PROXY]
-
TCP
cat <<EOF | kubectl apply -f - apiVersion: v1 kind: ConfigMap metadata: name: ingress-nginx-tcp namespace: default data: 9000: "default/example-go:8080" EOF
-
UDP
cat <<EOF | kubectl apply -f - apiVersion: v1 kind: ConfigMap metadata: name: ingress-nginx-udp namespace: default data: 53: "kube-system/kube-dns:53" EOF
-
-
创建完 Configmap 后即可测试访问对应端口