kashalls / external-dns-unifi-webhook

External-DNS Webhook to manage UniFi DNS Records
Apache License 2.0
93 stars 5 forks source link

Failed to connect to plugin api: Get \"http://localhost:8888\": #39

Closed passie closed 2 months ago

passie commented 2 months ago

Bug Description

I'm doing a very basic installation according to the readme. Though i'm getting the following error message when deploying

time="2024-06-28T06:20:44Z" level=debug msg="Failed to connect to plugin api: Get \"http://localhost:8888\": dial tcp [::1]:8888: connect: connection refused"

For your information. I'm running a UDM SE

ExternalDNS Configuration

fullnameOverride: external-dns-unifi
logLevel: debug
provider:
  name: webhook
  webhook:
    image:
      repository: ghcr.io/kashalls/external-dns-unifi-webhook
      tag: v0.2.0 # replace with a versioned release tag
    env:
      - name: UNIFI_HOST
        value: https://10.0.0.1 # replace with the address to your UniFi router
      - name: UNIFI_USER
        valueFrom:
          secretKeyRef:
            name: external-dns-unifi-secret
            key: username
      - name: UNIFI_PASS
        valueFrom:
          secretKeyRef:
            name: external-dns-unifi-secret
            key: password
      - name: LOG_LEVEL
        value: debug
    livenessProbe:
      httpGet:
        path: /healthz
        port: http-wh-metrics
      initialDelaySeconds: 10
      timeoutSeconds: 5
    readinessProbe:
      httpGet:
        path: /readyz
        port: http-wh-metrics
      initialDelaySeconds: 10
      timeoutSeconds: 5
extraArgs:
  - --ignore-ingress-tls-spec
policy: sync
sources: ["ingress", "service"]
txtOwnerId: default
txtPrefix: k8s.
domainFilters: ["somedomain.com"] # replace with your domain

ExternalDNS Logs

time="2024-06-28T06:26:04Z" level=debug msg="Failed to connect to plugin api: Get \"http://localhost:8888\": dial tcp [::1]:8888: connect: connection refused"
time="2024-06-28T06:26:04Z" level=debug msg="Failed to connect to plugin api: Get \"http://localhost:8888\": dial tcp [::1]:8888: connect: connection refused"
time="2024-06-28T06:26:05Z" level=debug msg="Failed to connect to plugin api: Get \"http://localhost:8888\": dial tcp [::1]:8888: connect: connection refused"
time="2024-06-28T06:26:06Z" level=debug msg="Failed to connect to plugin api: Get \"http://localhost:8888\": dial tcp [::1]:8888: connect: connection refused"

Webhook Logs

Error from server (BadRequest): container "webhook" in pod "external-dns-unifi-5884599f48-24glg" is waiting to start: CreateContainerConfigError

UniFiOS Version

3.2.12

UniFi Network Version

??

ExternalDNS Version

v0.2.0

Search

Code of Conduct

kashalls commented 2 months ago

The error above basically says that ExternalDNS wasn't able to access the webhook (probably because the webhook container is stuck waiting to be created).

Did you create a secret and ensure it exists in Kubernetes that contains your secret name external-dns-unifi-secret with username & password keys? Don't forget to check and make sure that external-dns and the secret are running in the same namespace.

passie commented 2 months ago

You where correct. I made a mistake with creating the secret. My bad. Thank you for your quick reply

kashalls commented 2 months ago

You where correct. I made a mistake with creating the secret. My bad. Thank you for your quick reply

All good! Let me know if you encounter more problems, I don't mind helping out.