mirror of
https://github.com/Expand-sys/awx-on-k3s
synced 2025-12-16 14:02:15 +11:00
fix: add instruction to restart CoreDNS
This commit is contained in:
parent
43e08250d1
commit
97b1e45633
1 changed files with 27 additions and 6 deletions
33
README.md
33
README.md
|
|
@ -32,7 +32,7 @@ An example implementation of AWX on single node K3s using AWX Operator, with eas
|
||||||
- [Use Ansible Runner](#use-ansible-runner)
|
- [Use Ansible Runner](#use-ansible-runner)
|
||||||
- [Additional Configuration for AWX](#additional-configuration-for-awx)
|
- [Additional Configuration for AWX](#additional-configuration-for-awx)
|
||||||
- [Configure AWX to use Git Repository with Self-Signed Certificate](#configure-awx-to-use-git-repository-with-self-signed-certificate)
|
- [Configure AWX to use Git Repository with Self-Signed Certificate](#configure-awx-to-use-git-repository-with-self-signed-certificate)
|
||||||
- [Expose your /etc/hosts to K3s](#expose-your-etchosts-to-k3s)
|
- [Expose your /etc/hosts to Pods on K3s](#expose-your-etchosts-to-pods-on-k3s)
|
||||||
|
|
||||||
## Environment
|
## Environment
|
||||||
|
|
||||||
|
|
@ -365,7 +365,7 @@ See [📝`runner/README.md`](runner) for instructions.
|
||||||
- Press `Edit` and scroll down to `Extra Environment Variables`, then add `"GIT_SSL_NO_VERIFY": "True"` in `{}`
|
- Press `Edit` and scroll down to `Extra Environment Variables`, then add `"GIT_SSL_NO_VERIFY": "True"` in `{}`
|
||||||
- Press `Save`
|
- Press `Save`
|
||||||
|
|
||||||
### Expose your /etc/hosts to K3s
|
### Expose your /etc/hosts to Pods on K3s
|
||||||
|
|
||||||
If we don't have a DNS server and are using `/etc/hosts`, we will need to do some additional tasks to get the Pods on K3s to resolve names according to `/etc/hosts`.
|
If we don't have a DNS server and are using `/etc/hosts`, we will need to do some additional tasks to get the Pods on K3s to resolve names according to `/etc/hosts`.
|
||||||
|
|
||||||
|
|
@ -376,9 +376,11 @@ One easy way to do this is to use `dnsmasq`.
|
||||||
1. Add entries to `/etc/hosts` on your K3s host. Note that the IP addresses have to be replaced with your K3s host's one.
|
1. Add entries to `/etc/hosts` on your K3s host. Note that the IP addresses have to be replaced with your K3s host's one.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo echo "192.168.0.100 awx.example.com" >> /etc/hosts
|
sudo tee -a /etc/hosts <<EOF
|
||||||
sudo echo "192.168.0.100 registry.example.com" >> /etc/hosts
|
192.168.0.100 awx.example.com
|
||||||
sudo echo "192.168.0.100 git.example.com" >> /etc/hosts
|
192.168.0.100 registry.example.com
|
||||||
|
192.168.0.100 git.example.com
|
||||||
|
EOF
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Install and start `dnsmasq` with default configuration.
|
2. Install and start `dnsmasq` with default configuration.
|
||||||
|
|
@ -407,8 +409,27 @@ One easy way to do this is to use `dnsmasq`.
|
||||||
'/etc/rancher/k3s/resolv.conf' \ 👈👈👈
|
'/etc/rancher/k3s/resolv.conf' \ 👈👈👈
|
||||||
```
|
```
|
||||||
|
|
||||||
5. Restart K3s.
|
5. Restart K3s and CoreDNS. The K3s service can be safely restarted without affecting the running resources.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo systemctl restart k3s
|
sudo systemctl restart k3s
|
||||||
|
kubectl -n kube-system delete pod -l k8s-app=kube-dns
|
||||||
|
```
|
||||||
|
|
||||||
|
6. Ensure that your hostname can be resolved as defined in `/etc/hosts`.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ kubectl run -it --rm --restart=Never busybox --image=busybox:1.28 -- nslookup git.example.com
|
||||||
|
Server: 10.43.0.10
|
||||||
|
Address 1: 10.43.0.10 kube-dns.kube-system.svc.cluster.local
|
||||||
|
|
||||||
|
Name: git.example.com
|
||||||
|
Address 1: 192.168.0.100
|
||||||
|
pod "busybox" deleted
|
||||||
|
```
|
||||||
|
|
||||||
|
7. If you update your `/etc/hosts`, restarting `dnsmasq` is required.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo systemctl restart dnsmasq
|
||||||
```
|
```
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue