如何解决Ingress Nginx中的TCP公开服务可用于SSL?
如果我有TLS的后端实现,Ingress NGINX是否可以正确公开它?
我正在通过具有以下配置的Ingress NGNIX公开MQTT服务:
ConfigMap:
---
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-ingress-tcp-microk8s-conf
namespace: ingress
#Add the service we want to expose
data:
1883: "default/mosquitto-broker:1883"
DaemonSet:
---
apiVersion: apps/v1
kind: DaemonSet
...
spec:
selector:
matchLabels:
name: nginx-ingress-microk8s
template:
metadata:
...
spec:
...
ports:
- containerPort: 80
- containerPort: 443
#Add the service we want to expose
- name: prx-tcp-1883
containerPort: 1883
hostPort: 1883
protocol: TCP
args:
- /nginx-ingress-controller
- --configmap=$(POD_NAMESPACE)/nginx-load-balancer-microk8s-conf
- --tcp-services-configmap=$(POD_NAMESPACE)/nginx-ingress-tcp-microk8s-conf
- --udp-services-configmap=$(POD_NAMESPACE)/nginx-ingress-udp-microk8s-conf
$DEFAULT_CERT
$EXTRA_ARGS
我已将MQTT代理配置为在后端使用TLS。当我在kubernetes集群之外的机器上运行代理时,Wireshark将消息检测为TLS,并且未显示任何有关MQTT的信息:
但是,如果我在集群中运行代理,它表明即时消息使用MQTT,而与TLS无关。但是消息无法正确读取:
最后,如果我在没有TLS的集群内运行MQTT代理,Wireshark会正确检测到MQTT pakcets:
我的问题是:在群集中使用TLS时,连接是否已加密?的确,Wireshark不会显示数据包的内容,但知道我正在使用MQTT。也许是因为标头没有加密,但是有效载荷是?有人知道吗?
解决方法
问题是我按照文档建议在端口8883上运行TLS MQTT(标准MQTT不在1883端口),但是Wireshark不能将此端口识别为MQTT端口,因此Wireshark给出的格式为有点坏。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。