Folllow below steps to create a Nginx Ingress controller,deploy a app and point your domain to the new service through ingress
Steps for GCP
gcloud config set project kubernetes-interview-questions
gcloud container clusters create cluster-1
--zone us-central1-c --num-nodes=3
gcloud container clusters get-credentials cluster-1 --zone us-central1-c --project kubernetes-interview-questions
ACCOUNT=$(gcloud info --format='value(config.account)')
kubectl create clusterrolebinding owner-cluster-admin-binding
--clusterrole cluster-admin
--user $ACCOUNT
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-0.31.1/deploy/static/provider/cloud/deploy.yaml
kubectl get pods -n ingress-nginx
kubectl apply -f https://raw.githubusercontent.com/UmarFarooqkadri/kubernetes-ingress-nginx/master/nginx-ingress.yaml
Note: The annotations under the labels are very important for integrating with the nginx controller deployment.
kubectl get svc -n ingress-nginx
Step 1: create a namespace named dev
kubectl create namespace dev
kubectl create -f https://raw.githubusercontent.com/UmarFarooqkadri/kubernetes-ingress-nginx/master/hello-app.yaml
kubectl get deployments -n dev
kubectl create -f https://raw.githubusercontent.com/UmarFarooqkadri/kubernetes-ingress-nginx/master/hello-app-service.yaml
kubectl get svc -n dev
kubectl apply -f https://raw.githubusercontent.com/UmarFarooqkadri/kubernetes-ingress-nginx/master/ingress.yaml
Note: Replace test.apps.example.info with your domain name
#Describe created ingress object created to check the configurations.
kubectl describe ingress -n dev
Below is the original article which has been useful to read and understand about ingress
https://devopscube.com/setup-ingress-kubernetes-nginx-controller/