I installed kong using helm chart. In values.yaml I specified two TCP ports in Stream section:
stream:
- containerPort: 39019 #MongoDB
servicePort: 39019
protocol: TCP
parameters:
- ssl
- containerPort: 43576 #MySQL
servicePort: 43576
protocol: TCP
parameters:
- ssl
My intention is to expose one port for MongoDB and another for MySQL.
After that, I created a TCPIngress file for both databases:
apiVersion: configuration.konghq.com/v1beta1
kind: TCPIngress
metadata:
name: tcp-mysql
annotations:
kubernetes.io/tls-acme: "true"
cert-manager.io/cluster-issuer: letsencrypt
kubernetes.io/ingress.class: kong
konghq.com/plugins: global-file-log
spec:
tls:
- hosts:
- s.mytest.domain
secretName: s.mytest.domain-certificate
rules:
- host: s.mytest.domain
port: 43576
backend:
serviceName: mysql
servicePort: 3306
the MongoDB TCPIngress is nearly equal, the difference is the port and servicePort that are 39019:27017 respectively.
with this configuration, MongoDB works perfect, but MySQL doesnt. I’m new to Kong and Kubernetes in general. How can I trace whats going wrong and how to solve this?