helm/kubernets sending mail from connection times out

5/2/2021

I have some backend code that allows sending mails, however when I deploy this in my k8s environment, this gets a connection timeout.

I'm thinking that this is because the port (465) is closed. But I can't seem to find on how to open them.

These are the port configurations I've done so far to try and make it work, but result is still the same

deployment.yaml:

containers:
- name: {{ .Chart.Name }}
  image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}"
  imagePullPolicy: {{ .Values.image.pullPolicy }}
  ports:
    - containerPort: {{ .Values.service.internalPort }}
      protocol: TCP
      name: http  
    - containerPort: 465
      protocol: TCP
      name: smtpssl
    - containerPort: 587
      protocol: TCP            
      name: smtp

service.yaml

spec:
  ports:
  - port: {{ .Values.service.externalPort }}
    protocol: TCP
    name: internal
    targetPort: {{ .Values.service.internalPort }}
  - port: 465
    targetPort: smtpssl
    name: smtpssl-svc
    protocol: TCP
  - port: 587
    targetPort: smtpauth
    name: smtpauth-svc
    protocol: TCP
  - port: 25 
    targetPort: smtp
    name: smtp-svc
    protocol: TCP  

anybody got any suggestions on what might be wrong?

-- Kiwi
kubernetes
smtp

1 Answer

5/3/2021

As it turns out, my host blocks the 465,587,25 ports by default. Requested to open them and 4 min later everything was working, great job linode.com!

-- Kiwi
Source: StackOverflow