My configuration is below. How do I set a different port for ingress load balancer?
Service:
kind: Service
apiVersion: v1
metadata:
name: docker-service
namespace: mp-prod
spec:
type: NodePort
selector:
app: dockerprod
ports:
- name: http
protocol: TCP
port: 0909
targetPort: 8909
Ingress:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: dockeringress
namespace: mp-prod
spec:
backend:
serviceName: docker-service
servicePort: 0909
There is no portable (between different type of ingresses/cloud providers) way of achieving this at the moment.
You can use something like proxy-to-server and create an L4 loadbalancer yourself.
Maybe you can try this out.
kind: ConfigMap
apiVersion: v1
metadata:
name: nginx-config
data:
public-ports: "80;443;<custom port>"
private-ports: "80;443;<custom port>"
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
ingress.bluemix.net/tcp-ports: "serviceName=docker-service ingressPort=<custom port> servicePort=0909"
name: dockeringress
namespace: mp-prod
spec:
backend:
serviceName: docker-service
servicePort: 0909
After that, you can access your service by specific port through the ingress.