In our GKE we have one service called php-services. It is defined like so:
apiVersion: v1
kind: Service
metadata:
name: php-services
labels:
name: php-services
spec:
type: NodePort
ports:
- port: 80
selector:
name: php-services
I can access this service from inside the cluster. If I run these commands on one of our pods (in Default namespace), I get expected results:
bash-4.4$ nslookup 'php-services'
Name: php-services
Address 1: 10.15.250.136 php-services.default.svc.cluster.local
and
bash-4.4$ wget -q -O- 'php-services/health'
{"status":"ok"}
So the service is ready and responding correctly. I need to expose this service to foreign traffic. I'm trying to do it with Ingress with following config:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ingress-tls
annotations:
kubernetes.io/ingress.class: "gce"
kubernetes.io/tls-acme: "true"
kubernetes.io/ingress.global-static-ip-name: "kubernetes-ingress"
kubernetes.io/ingress.allow-http: "false"
external-dns.alpha.kubernetes.io/hostname: "gke-ingress.goout.net"
namespace: default
spec:
tls:
- hosts:
- php.service.goout.net
secretName: router-tls
rules:
- host: php.service.goout.net
http:
paths:
- backend:
serviceName: php-services
servicePort: 80
path: /*
But then accessing http://php.service.goout.net/health gives an 502 error:
Error: Server Error The server encountered a temporary error and could
not complete your request.
Please try again in 30 seconds.
We also have other services with the same config which run ok and are accessible form outside.
I've found a similar question but that doesn't bring any sufficient answer either.
I've been also following the Debug Service article but that also didn't help as the service itself is OK.
Any help with this issue highly appreciated.