'unable to connect to logstash pod deployed using helm charts from another pods

I am having trouble connecting to Logstash pod which is created using helm charts by passing custom values. Added ingress along with tls cert, and added service, configured external ports and https ports which logstash listens.

The following is part of the values file with ingress and service

      values: |
        httpPort: 9600
        image: "docker.elastic.co/logstash/logstash"
        rbac:
          create: true


        ingress:
          enabled: true
          annotations: 
            kubernetes.io/ingress.class: nginx-private
            cert-manager.io/cluster-issuer: letsencrypt-production
          hosts:
            - host: example.com
              paths:
                - path: /logstash
                  servicePort: 9600

          tls: 
            - secretName: cert-secretname
              hosts:
                - example.com
            
            
        extraPorts:
          - name: logstash
            containerPort: 9600

        service:
          type: ClusterIP
          ports:
            - name: logstash
              protocol: TCP
              port: 9600
              targetPort: 9600

output of service

NAME          TYPE        CLUSTER-IP         EXTERNAL-IP   PORT(S)
logstashpoc   ClusterIP   1.2.3.4(example)   <none>        9600/TCP

output of ingress

NAME          CLASS    HOSTS         ADDRESS   PORTS     AGE
logstashpoc   <none>   example.com             80, 443 

describe ingress output

Name:              logstashpoc
Namespace:         logstash-workflow
Labels:            app=logstashpoc
                   chart=logstash
                   heritage=Helm
                   release=logstashpoc-dev
Annotations:       <none>
Selector:          app=logstashpoc,chart=logstash,heritage=Helm,release=logstashpoc-dev
Type:              ClusterIP
IP Family Policy:  SingleStack
IP Families:       IPv4
IP:                1.2.3.4(example)
IPs:               1.2.3.4(example)
Port:              logstash  9600/TCP
TargetPort:        9600/TCP
Endpoints:         4.3.2.1:9600 (example)
Session Affinity:  None
Events:            <none>


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source