Skip to content

Commit ac0569e

Browse files
committed
Fix invalid ingress-dns references and ingress
1 parent b2e2b27 commit ac0569e

File tree

2 files changed

+22
-24
lines changed

2 files changed

+22
-24
lines changed

deploy/addons/ingress-dns/README.md

+19-19
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,25 @@ DNS service for ingress controllers running on your minikube server
66
## Overview
77

88
### 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,
1919
remove, and renamed. I call it the `/ets/hosts` pollution problem.
2020

2121
### Solution
2222
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:
2828

2929
```text
3030
#bash:~$ nslookup myservice.test $(minikube ip)
@@ -58,7 +58,7 @@ nameserver 192.168.99.169
5858
search_order 1
5959
timeout 5
6060
```
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
6262
corresponding ip address
6363

6464
If you have multiple minikube ips you must configure multiple files
@@ -78,7 +78,7 @@ Replace `192.168.99.169` with your minikube ip
7878
If your linux OS uses `systemctl` run the following commands
7979
```bash
8080
sudo resolvconf -u
81-
systemctl disable --now resolvconf.service
81+
systemctl disable --now resolvconf.service
8282
```
8383

8484
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
161161

162162
## TODO
163163
- 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
165165
`minikube addons disable ingress-dns`
166166

167167
## Contributors
@@ -171,5 +171,5 @@ sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.pli
171171

172172
| Image | Source | Owner |
173173
| :--- | :--- | :--- |
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
175175
| [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

deploy/addons/ingress-dns/example/example.yaml

+3-5
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,19 @@ kind: Ingress
3838
metadata:
3939
name: example-ingress
4040
namespace: kube-system
41-
annotations:
42-
nginx.ingress.kubernetes.io/rewrite-target: /$1
4341
spec:
4442
rules:
4543
- host: hello-john.test
4644
http:
4745
paths:
48-
- path: /|/(.+)
46+
- path: /
4947
backend:
5048
serviceName: hello-world-app
5149
servicePort: 80
5250
- host: hello-jane.test
5351
http:
5452
paths:
55-
- path: /|/(.+)
53+
- path: /
5654
backend:
5755
serviceName: hello-world-app
5856
servicePort: 80
@@ -79,4 +77,4 @@ spec:
7977
protocol: TCP
8078
type: NodePort
8179
selector:
82-
app: hello-world-app
80+
app: hello-world-app

0 commit comments

Comments
 (0)