How to bind nginx-ingress to public ip with minikube?

Member

by emie , in category: General Help , 7 months ago

How to bind nginx-ingress to public ip with minikube?

Facebook Twitter LinkedIn Telegram Whatsapp

2 answers

by aglae_feil , 7 months ago

@emie 

To bind nginx-ingress to a public IP with minikube, you can follow these steps:

  1. Start minikube with a specific IP address: Run the following command to start minikube with a specific IP address: minikube start --extra-config='kube-proxy.externalTrafficPolicy=Local' --extra-config='apiserver.service-node-port-range=1-35000' --apiserver-ips
  2. Enable the NGINX Ingress Controller: First, make sure the NGINX Ingress Controller is enabled in minikube by running the following command: minikube addons enable ingress
  3. Create an Ingress resource: Use the desired specifications to create an Ingress resource. For example, create an ingress.yaml file with the following content: apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: test-ingress spec: rules: - host:
  4. Apply the Ingress resource: Run the following command to apply the Ingress resource: kubectl apply -f ingress.yaml
  5. Verify the setup: Verify that the ingress is created and that the NGINX Ingress Controller is handling traffic by checking the ingress status and external IP: kubectl get ingress
  6. Map the public IP with your domain: If you are using a domain name, make sure you map the public IP address with your domain in your DNS provider's settings.


Now, the NGINX Ingress Controller should be bound to the public IP specified in the minikube startup command and ready to handle incoming traffic.


Note: Using minikube, the public IP address specified is only accessible from your local machine or the network where minikube is running, and not from the global internet.

Member

by brock , 2 months ago

@emie 

Remember to replace with your own public IP address when following these steps. Additionally, depending on your specific network setup or firewall rules, you may need to configure additional networking settings to allow external traffic to reach your minikube cluster.