@@ -6,25 +6,25 @@ DNS service for ingress controllers running on your minikube server
6
6
## Overview
7
7
8
8
### Problem
9
- When running minikube locally you are highly likely to want to run your services on an ingress controller so that you
10
- don't have to use minikube tunnel or NodePorts to access your services. While NodePort might be ok in a lot of
11
- circumstances in order to test some features an ingress is necessary. Ingress controllers are great because you can
12
- define your entire architecture in something like a helm chart and all your services will be available. There is only
13
- 1 problem. That is that your ingress controller works basically off of dns and while running minikube that means that
14
- your local dns names like ` myservice.test ` will have to resolve to ` $(minikube ip) ` not really a big deal except the
15
- only real way to do this is to add an entry for every service in your ` /etc/hosts ` file. This gets messy for obvious
16
- reasons. If you have a lot of services running that each have their own dns entry then you have to set those up
17
- manually. Even if you automate it you then need to rely on the host operating system storing configurations instead of
18
- storing them in your cluster. To make it worse it has to be constantly maintained and updated as services are added,
9
+ When running minikube locally you are highly likely to want to run your services on an ingress controller so that you
10
+ don't have to use minikube tunnel or NodePorts to access your services. While NodePort might be ok in a lot of
11
+ circumstances in order to test some features an ingress is necessary. Ingress controllers are great because you can
12
+ define your entire architecture in something like a helm chart and all your services will be available. There is only
13
+ 1 problem. That is that your ingress controller works basically off of dns and while running minikube that means that
14
+ your local dns names like ` myservice.test ` will have to resolve to ` $(minikube ip) ` not really a big deal except the
15
+ only real way to do this is to add an entry for every service in your ` /etc/hosts ` file. This gets messy for obvious
16
+ reasons. If you have a lot of services running that each have their own dns entry then you have to set those up
17
+ manually. Even if you automate it you then need to rely on the host operating system storing configurations instead of
18
+ storing them in your cluster. To make it worse it has to be constantly maintained and updated as services are added,
19
19
remove, and renamed. I call it the ` /ets/hosts ` pollution problem.
20
20
21
21
### Solution
22
22
What if you could just access your local services magically without having to edit your ` /etc/hosts ` file? Well now you
23
- can. This addon acts as a DNS service that runs inside your kubernetes cluster. All you have to do is install the
24
- service and add the ` $(minikube ip) ` as a DNS server on your host machine. Each time the dns service is queried an
25
- API call is made to the kubernetes master service for a list of all the ingresses. If a match is found for the name a
26
- response is given with an IP address as the ` $(minikube ip) ` . So for example lets say my minikube ip address is
27
- ` 192.168.99.106 ` and I have an ingress controller with the name of ` myservice.test ` then I would get a result like so:
23
+ can. This addon acts as a DNS service that runs inside your kubernetes cluster. All you have to do is install the
24
+ service and add the ` $(minikube ip) ` as a DNS server on your host machine. Each time the dns service is queried an
25
+ API call is made to the kubernetes master service for a list of all the ingresses. If a match is found for the name a
26
+ response is given with an IP address as the ` $(minikube ip) ` . So for example lets say my minikube ip address is
27
+ ` 192.168.99.106 ` and I have an ingress controller with the name of ` myservice.test ` then I would get a result like so:
28
28
29
29
``` text
30
30
#bash:~$ nslookup myservice.test $(minikube ip)
@@ -58,7 +58,7 @@ nameserver 192.168.99.169
58
58
search_order 1
59
59
timeout 5
60
60
```
61
- Replace ` 192.168.99.169 ` with your minikube ip and ` profilename ` is the name of the minikube profile for the
61
+ Replace ` 192.168.99.169 ` with your minikube ip and ` profilename ` is the name of the minikube profile for the
62
62
corresponding ip address
63
63
64
64
If you have multiple minikube ips you must configure multiple files
@@ -78,7 +78,7 @@ Replace `192.168.99.169` with your minikube ip
78
78
If your linux OS uses ` systemctl ` run the following commands
79
79
``` bash
80
80
sudo resolvconf -u
81
- systemctl disable --now resolvconf.service
81
+ systemctl disable --now resolvconf.service
82
82
```
83
83
84
84
If your linux does not use ` systemctl ` run the following commands
@@ -161,7 +161,7 @@ sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.pli
161
161
162
162
## TODO
163
163
- Add a service that runs on the host OS which will update the files in ` /etc/resolver ` automatically
164
- - Start this service when running ` minikube addons enable ingress-dns ` and stop the service when running
164
+ - Start this service when running ` minikube addons enable ingress-dns ` and stop the service when running
165
165
` minikube addons disable ingress-dns `
166
166
167
167
## Contributors
@@ -171,5 +171,5 @@ sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.pli
171
171
172
172
| Image | Source | Owner |
173
173
| :--- | :--- | :--- |
174
- | [ nginx- ingress] ( https://hub.docker.com/r/nginx /nginx-ingress ) | [ ingress-nginx] ( https://github.com/kubernetes/ingress-nginx ) | Nginx
174
+ | [ ingress-nginx ] ( https://quay.io/repository/kubernetes-ingress-controller /nginx-ingress-controller ) | [ ingress-nginx] ( https://github.com/kubernetes/ingress-nginx ) | Kubernetes ingress-nginx
175
175
| [ minikube-ingress-dns] ( https://hub.docker.com/r/cryptexlabs/minikube-ingress-dns ) | [ minikube-ingress-dns] ( https://gitlab.com/cryptexlabs/public/development/minikube-ingress-dns ) | Cryptex Labs
0 commit comments