|
21 | 21 |
|
22 | 22 | ## ⛵ Deployment
|
23 | 23 |
|
| 24 | +### Gathering your credentials |
| 25 | + |
| 26 | +<details> |
| 27 | +<summary>UniFi Api Key - Network v9.0.0+</summary> |
| 28 | +<br> |
| 29 | +1. Open your UniFi Console's Network Settings and go to `Settings > Control Plane > Admins & Users`. |
| 30 | + |
| 31 | +2. Selecting your user to operate under. Whenever we modify the DNS Records, this user will show up under `System Log > Admin Activity` |
| 32 | + |
| 33 | +3. Go under `Control Plane API Key` and click `Create New`. You can set the name to whatever you want, and the expiration to whatever you feel like. |
| 34 | + |
| 35 | +4. Create a Kubernetes secret called `external-dns-unifi-secret` that will hold your `UNIFI_API_KEY` with their respected values from Step 3. |
| 36 | + |
| 37 | +```yaml |
| 38 | +--- |
| 39 | +apiVersion: v1 |
| 40 | +kind: Secret |
| 41 | +metadata: |
| 42 | + name: external-dns-unifi-secret |
| 43 | +data: |
| 44 | + api-key: <your-api-key> |
| 45 | +``` |
| 46 | +</details> |
| 47 | +
|
| 48 | +<details> |
| 49 | +<summary>Username & Password (Deprecated)</summary> |
| 50 | +<br> |
24 | 51 | 1. Open your UniFi Console's Network Settings and go to `Settings > Control Plane > Admins & Users`.
|
25 | 52 |
|
26 |
| -2a. If you are running `UniFi Network v9.0.0` or greater, you can create an `Api Key` by selecting your user, going under `Control Plane API Key` and clicking `Create New`. Set the name to whatever you want, and the expiration to whatever you feel like commiting to. You can set `UNIFI_API_KEY` to this key. |
| 53 | +2. Select `Create New Admin`. |
27 | 54 |
|
28 |
| -2b. Otherwise, create a local user with a password in your UniFi OS, this user only needs read/write access to the UniFi Network appliance. |
| 55 | +3. In the menu that appears, enable `Restrict to Local Access Only`. Deselect `Use a Predefined Role`. Set `Network: Site Admin`. All other selections can be set to `None`. Click `Create`. |
29 | 56 |
|
30 |
| -3. Add the ExternalDNS Helm repository to your cluster. |
| 57 | +4. Create a Kubernetes secret called `external-dns-unifi-secret` that holds the `username` and `password` with their respected values from Step 3. |
| 58 | + |
| 59 | +```yaml |
| 60 | +--- |
| 61 | +apiVersion: v1 |
| 62 | +kind: Secret |
| 63 | +metadata: |
| 64 | + name: external-dns-unifi-secret |
| 65 | +data: |
| 66 | + username: <your-username> |
| 67 | + password: <your-password> |
| 68 | +``` |
| 69 | +</details> |
| 70 | + |
| 71 | +### Installing the provider |
| 72 | + |
| 73 | +1. Add the ExternalDNS Helm repository to your cluster. |
31 | 74 |
|
32 | 75 | ```sh
|
33 | 76 | helm repo add external-dns https://kubernetes-sigs.github.io/external-dns/
|
34 | 77 | ```
|
35 | 78 |
|
36 |
| -4. Create a Kubernetes secret called `external-dns-unifi-secret` that holds either `api-key` or the `username` and `password` with their respected values from step 2. |
| 79 | +2. Deploy your `external-dns-unifi-secret` secret that holds your authentication credentials from either of the |
37 | 80 |
|
38 |
| -5. Create the helm values file, for example `external-dns-unifi-values.yaml`: |
| 81 | +3. Create the helm values file, for example `external-dns-unifi-values.yaml`: |
39 | 82 |
|
40 | 83 | ```yaml
|
41 | 84 | fullnameOverride: external-dns-unifi
|
|
51 | 94 | value: https://192.168.1.1 # replace with the address to your UniFi router/controller
|
52 | 95 | - name: UNIFI_EXTERNAL_CONTROLLER
|
53 | 96 | value: "false"
|
54 |
| - - name: UNIFI_USER |
55 |
| - valueFrom: |
56 |
| - secretKeyRef: |
57 |
| - name: external-dns-unifi-secret |
58 |
| - key: username |
59 |
| - - name: UNIFI_PASS |
| 97 | + - name: UNIFI_API_KEY |
60 | 98 | valueFrom:
|
61 | 99 | secretKeyRef:
|
62 | 100 | name: external-dns-unifi-secret
|
63 |
| - key: password |
| 101 | + key: api-key |
64 | 102 | - name: LOG_LEVEL
|
65 | 103 | value: *logLevel
|
66 | 104 | livenessProbe:
|
|
84 | 122 | domainFilters: ["example.com"] # replace with your domain
|
85 | 123 | ```
|
86 | 124 |
|
87 |
| -6. Install the Helm chart |
| 125 | +4. Install the Helm chart |
88 | 126 |
|
89 | 127 | ```sh
|
90 |
| - helm install external-dns-unifi external-dns/external-dns -f external-dns-unifi-values.yaml --version 1.14.3 -n external-dns |
| 128 | + helm install external-dns-unifi external-dns/external-dns -f external-dns-unifi-values.yaml --version 1.15.0 -n external-dns |
91 | 129 | ```
|
92 | 130 |
|
93 | 131 | ## Configuration
|
|
0 commit comments