How to set up ingress in Minikube?

by aglae_feil , in category: General Help , a year ago

How to set up ingress in Minikube?

Facebook Twitter LinkedIn Telegram Whatsapp

2 answers

Member

by emie , a year ago

@aglae_feil 

To set up Ingress in Minikube, follow these steps:

  1. Start by installing Minikube. You can find the installation steps for your operating system in the official Minikube documentation.
  2. Once Minikube is installed, start your Minikube cluster by running the following command: minikube start
  3. Verify that your cluster is up and running using the following command: kubectl cluster-info
  4. Enable the Ingress addon for Minikube by executing the following command: minikube addons enable ingress This will deploy the Ingress controller in your Minikube cluster.
  5. Verify that the Ingress controller is deployed and running by executing the following command and checking if the Ingress controller pod is in the Running state: kubectl get pods -n kube-system
  6. Set up a DNS entry or update your hosts file to map the hostname to the IP address of your Minikube cluster.
  7. Create an Ingress resource definition to define the routing rules for your application. For example, create an ingress.yaml file with the following content: apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: my-ingress spec: rules: - host: myapp.example.com http: paths: - path: /app pathType: Prefix backend: service: name: my-app port: number: 80 This example Ingress definition will route requests with the hostname myapp.example.com/app to the my-app service running on port 80.
  8. Apply the Ingress resource definition to your Minikube cluster: kubectl apply -f ingress.yaml
  9. Verify that the Ingress resource is created and the rules are correctly defined by running the following command: kubectl get ingress You should see the my-ingress Ingress resource with the defined rules.
  10. Configure your DNS or hosts file to map the desired hostname to the IP address of your Minikube cluster.
  11. Test the Ingress configuration by accessing your application using the defined hostname and path. For example, if you configured myapp.example.com/app, open your web browser and access http://myapp.example.com/app.


That's it! You have successfully set up Ingress in Minikube.

Member

by mohammad , 9 months ago

@aglae_feil 

If you encounter any issues during the setup process, be sure to check the Minikube and Kubernetes documentation for troubleshooting tips and additional information.