Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

Commit

Permalink
Fixes #12: Add Pi-hole configuration to the cluster, with usage instr…
Browse files Browse the repository at this point in the history
…uctions.
  • Loading branch information
geerlingguy committed May 26, 2020
1 parent b6ce33a commit 3f948d0
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Once that's done, there will be variety of applications running on your cluster:
| Drupal | http://drupal.10.0.100.74.nip.io/ | N/A |
| Wordpress | http://wordpress.10.0.100.74.nip.io/ | N/A |
| Minecraft | (`kubectl get service -n minecraft`) | See EULA in [Minecraft chart repo](https://github.com/helm/charts/tree/master/stable/minecraft) |
| Pi-hole | http://pi.hole/ | See [pihole role README](roles/pihole/README.md) |
## Caveats
Expand Down
3 changes: 3 additions & 0 deletions main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,6 @@

- role: minecraft
tags: ['minecraft']

- role: pihole
tags: ['pihole']
21 changes: 21 additions & 0 deletions roles/pihole/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Pi-hole Setup

## Admin UI Setup

To access the Pi-hole admin UI, you'll need to point the hostname `pi.hole` at the IP address of the Pi where ingress is routed. You can find that IP address by running the following `kubectl` command:

```
# kubectl get ing -n pihole
NAME HOSTS ADDRESS PORTS AGE
pihole chart-example.local,pi.hole 10.0.100.99 80 55s
```

Take the value of the `ADDRESS` and add a line like the following to your `/etc/hosts` file:

10.0.100.99 pi.hole

Then you can access `http://pi.hole/` in your browser and view the admin UI.

## DNS setup

TODO.
6 changes: 6 additions & 0 deletions roles/pihole/meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
collections:
- community.kubernetes

dependencies:
- geerlingguy.helm
40 changes: 40 additions & 0 deletions roles/pihole/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
- name: Create pihole namespace.
k8s:
name: pihole
api_version: v1
kind: Namespace
state: present

- name: Add mojo2600 chart repo.
helm_repository:
name: mojo2600
repo_url: "https://mojo2600.github.io/pihole-kubernetes/"

- name: Deploy pihole Helm chart.
helm:
name: pihole
chart_ref: mojo2600/pihole
chart_version: '1.7.6'
release_namespace: pihole
state: present
values:
persistentVolumeClaim:
enabled: true
ingress:
enabled: true
serviceTCP:
loadBalancerIP: '10.0.100.99'
type: LoadBalancer
serviceUDP:
loadBalancerIP: '10.0.100.99'
type: LoadBalancer
resources:
limits:
cpu: 200m
memory: 256Mi
requests:
cpu: 100m
memory: 128Mi
# If using in the real world, set up admin.existingSecret instead.
adminPassword: admin

0 comments on commit 3f948d0

Please sign in to comment.