How to expose tcp service port over tls in istio 1.5

Hi,
I am very new to the istio.I have not got full understanding of istio-architecture yet.
my question:
I have service which is running in port 900. I have a gateway configured with port http and a wildcards certificates. When i use this gateway with a virtual service pointing to this service running in port 9000, then its working fine with https://url.com.
Now i want this service to be available in https://url.com:9000. So to do the same i have created a gateway just like below.

apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: test-gateway
spec:
  selector:
    istio: ingressgateway
  servers:
  - port:
      number: 9000
      name: tcp-port
      protocol: TLS
    tls:
      mode: SIMPLE
      credentialName: istiotls-credential
    hosts:
    - "test.url.com"

and virtual service like

  tcp:
  - match:
    - port: 9000
    route:
    - destination:
        host: host_servicename
        port:
          number: 9000

but its not working.
so how can i actually expose tcp service over tls.

is your k8 service allowing port 9000?

it is like client --> LB service (port 9000) --> istio ingress gw (port 9000) --> upstream service

1 Like