Create a namespace and keep all ingress resources there. Use Command in the Control plane server as below - kubectl create namespace my-ingress-space output will look - namespace/my-ingress-space created.
Configmap is required for NGINX ingress controller Use command - kubectl create configmap my-nginx-configuration -n my-ingress-space output will look - configmap/my-nginx-configuration created.
Use command - kubectl create serviceaccount my-ingress-serviceaccount -n my-ingress-space
Create rolebindings to bind role with service account.
kubectl get roles -n my-egress-space kubectl get rolebindings -n my-egress-space
Use command as - kubectl create -f ingress-controller.yaml Outout would be - deployment.apps/my-ingress-controller created You can check the status of the deployment with below. kubectl get pods -n ingress-space kubectl get pods -n ingress-space --watch
kubectl expose my-ingress-controller -n my-ingress-space --name ingress --port=80 --target-port=80 --type=NodePort
and it will expose it as service with output as - service/ingress exposed. You can use below command to get the service status- kubectl get svc -n my-ingress-space It will display - name, type,cluster-ip, ports etc. fields. By default it will choose default NodePort but if you want to change to specific NodePort, you can edit the deployment file and update. Let us edit the NodePort. kubectl edit svc ingress -n my-ingress-spacekubectl get pods -n app-space
kubectl get pods -n my-ingress-space kubectl logs pod-name -n app-space kubectl logs ingress-controll-pod-name -n my-ingress-spaceSometimes you might face issues that service call is coming due to too many redirects. To resolve it, you have update the annotation with sslredirect as false. kubectl edit ingress ingress-pay-report -n app-space
Next