I have a K8S service (app-filestash-testing) running like following:
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
app-filestash-testing ClusterIP 10.111.128.18 <none> 10000/TCP 18h
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 20h
I used the following yaml file to create an Ingress trying reach this service:
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: app-filestash-testing
spec:
rules:
- host: www.masternode.com
http:
paths:
- backend:
serviceName: app-filestash-testing
servicePort: 10000
In the /etc/hosts file, I made this change (I used the worker node public IP):
127.0.0.1 localhost
xx.xxx.xxx.xxx www.masternode.com
However, when I checked the Ingress, I saw that the Ingress port is 80.
NAME CLASS HOSTS ADDRESS PORTS AGE
app-filestash-testing nginx www.masternode.com 80 14h
Currently the service is running and listening on port 10000, but the Ingress port is 80.
I am just wondering is there any method/ setting to change the port number of Ingress to 10000? How to reach this service through Ingress? Is is possible to set the port number in /etc/hosts file?
Thanks.