How Expose Application To Interntet-Ingress
How Expose Application To Interntet-Ingress
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: my-app-ingress
spec:
rules:
- host: my-app.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: my-app-service
port:
name: http
If your Ingress resource is not showing an external IP address, it means that your Kubernetes
cluster does not have an external load balancer provisioned or you are running Kubernetes
locally on Minikube where you don't have an external load balancer available. In such cases,
you can use a tool like ngrok or localtunnel to expose your Ingress resource to the internet.
Here's how you can use ngrok to expose your Ingress resource to the internet:
https://ngrok.com/download
ngrok will generate a temporary public URL that you can use to access your Ingress resource
from the internet. The URL will look something like https://<random-string>.ngrok.io.
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: my-app-ingress
spec:
rules:
- host: <ngrok-url>
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: my-app-service
port:
name: http
4. Replace <ngrok-url> with the URL generated by ngrok. For example, if ngrok
generates the URL https://abc123.ngrok.io, you would replace <ngrok-url> with
abc123.ngrok.io
Note: ngrok generates a temporary URL that will expire after a certain period of time.
Permanent Solution:
you can consider using a cloud-based load balancer service like Amazon Elastic Load
Balancer or Google Cloud Load Balancing to expose your Ingress resource to the internet.