Right now these services are only reachable from inside the cluster, so let’s see how we can expose them with an Ingress. Remember that an Ingress sits in front of the services, defining rules to when a request should go to one service or another. Let’s start with a very simple Ingress that will send any request it receives to nginx-svc:
xxxxxxxxxx
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: hello-ingress
annotations:
# We are defining this annotation to prevent nginx
# from redirecting requests to `https` for now
nginx.ingress.kubernetes.io/ssl-redirect: "false"
spec:
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: nginx-svc
port:
number: 1234