Skip to content

Commit

Permalink
Cutover external-dns-unifi to API key (#3496)
Browse files Browse the repository at this point in the history
* feat(external-dns): cut to API key instead of user/pass

* feat(external-dns): new release
  • Loading branch information
joryirving authored Jan 10, 2025
1 parent 4760eb2 commit 30ba288
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: &name external-dns-unifi-secret
name: &name external-dns-unifi
spec:
secretStoreRef:
kind: ClusterSecretStore
Expand All @@ -13,8 +13,7 @@ spec:
template:
engineVersion: v2
data:
EXTERNAL_DNS_UNIFI_USER: "{{ .EXTERNAL_DNS_UNIFI_USER }}"
EXTERNAL_DNS_UNIFI_PASS: "{{ .EXTERNAL_DNS_UNIFI_PASS }}"
EXTERNAL_DNS_UNIFI_API_KEY: "{{ .EXTERNAL_DNS_UNIFI_API_KEY }}"
dataFrom:
- extract:
key: unifi
17 changes: 6 additions & 11 deletions kubernetes/main/apps/network/external-dns/unifi/helmrelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,15 @@ spec:
webhook:
image:
repository: ghcr.io/kashalls/external-dns-unifi-webhook
tag: v0.3.4@sha256:28dc00c7a21f9571d43181fcc0dd3de59e291741f27bc075d7e06378876b2974
tag: v0.4.0@sha256:f71f9e64f723a1af77e9ecdcbaef2db2095721d33b385baee1848d0bf09d44e7
env:
- name: UNIFI_HOST
value: https://192.168.1.1
- name: UNIFI_USER
- name: UNIFI_API_KEY
valueFrom:
secretKeyRef:
name: &secret external-dns-unifi-secret
key: EXTERNAL_DNS_UNIFI_USER
- name: UNIFI_PASS
valueFrom:
secretKeyRef:
name: *secret
key: EXTERNAL_DNS_UNIFI_PASS
name: &secret external-dns-unifi
key: EXTERNAL_DNS_UNIFI_API_KEY
# - name: LOG_LEVEL
# value: "debug"
livenessProbe:
Expand All @@ -63,8 +58,8 @@ spec:
triggerLoopOnEvent: true
policy: sync
sources: ["ingress", "service"]
txtOwnerId: main
txtPrefix: k8s.main.
txtOwnerId: ${CLUSTER}
txtPrefix: k8s.${CLUSTER}.
domainFilters: ["${SECRET_DOMAIN}"]
serviceMonitor:
enabled: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: &name external-dns-unifi-secret
name: &name external-dns-unifi
spec:
secretStoreRef:
kind: ClusterSecretStore
Expand All @@ -13,8 +13,7 @@ spec:
template:
engineVersion: v2
data:
EXTERNAL_DNS_UNIFI_USER: "{{ .EXTERNAL_DNS_UNIFI_USER }}"
EXTERNAL_DNS_UNIFI_PASS: "{{ .EXTERNAL_DNS_UNIFI_PASS }}"
EXTERNAL_DNS_UNIFI_API_KEY: "{{ .EXTERNAL_DNS_UNIFI_API_KEY }}"
dataFrom:
- extract:
key: unifi
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,15 @@ spec:
webhook:
image:
repository: ghcr.io/kashalls/external-dns-unifi-webhook
tag: v0.3.4@sha256:28dc00c7a21f9571d43181fcc0dd3de59e291741f27bc075d7e06378876b2974
tag: v0.4.0@sha256:f71f9e64f723a1af77e9ecdcbaef2db2095721d33b385baee1848d0bf09d44e7
env:
- name: UNIFI_HOST
value: https://192.168.1.1
- name: UNIFI_USER
- name: UNIFI_API_KEY
valueFrom:
secretKeyRef:
name: &secret external-dns-unifi-secret
key: EXTERNAL_DNS_UNIFI_USER
- name: UNIFI_PASS
valueFrom:
secretKeyRef:
name: *secret
key: EXTERNAL_DNS_UNIFI_PASS
name: &secret external-dns-unifi
key: EXTERNAL_DNS_UNIFI_API_KEY
# - name: LOG_LEVEL
# value: "debug"
livenessProbe:
Expand All @@ -63,8 +58,8 @@ spec:
triggerLoopOnEvent: true
policy: sync
sources: ["ingress", "service"]
txtOwnerId: utility
txtPrefix: k8s.utility.
txtOwnerId: ${CLUSTER}
txtPrefix: k8s.${CLUSTER}.
domainFilters: ["${SECRET_DOMAIN}"]
serviceMonitor:
enabled: true
Expand Down

0 comments on commit 30ba288

Please sign in to comment.