Skip to content

Rules Not automatically removed after resource deletion #126

@kha7iq

Description

@kha7iq

After creating resource using HTTPRoute rules are created automatically in adguard. However, after removing the HTTPRoute resource from the cluster, I noticed that the associated filtering rules are not automatically removed.

Some additional details:
The external-dns policy is set to sync.
I attempted setting the environment variable ADGUARD_SET_IMPORTANT_FLAG=false, but there was no change in behavior.

Could you clarify if this behavior is expected, or if I'm missing something in the configuration?

HTTPRoute:

apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: whoami-http-route
  namespace: default
  annotations:
    external-dns.alpha.kubernetes.io/hostname: whoami.local
spec:
  parentRefs:
    - name: internal
      namespace: gateway
  hostnames:
    - "whoami.local"
  rules:
    - matches:
        - path:
            type: PathPrefix
            value: /
      backendRefs:
        - name: whoami
          port: 80

Filtring rules created:

|a-whoami.local^$dnsrewrite=NOERROR;TXT;"heritage=external-dns,external-dns/owner=default,external-dns/resource=httproute/default/whoami-http-route"
|whoami.local^$dnsrewrite=NOERROR;A;192.168.0.10
|whoami.local^$dnsrewrite=NOERROR;TXT;"heritage=external-dns,external-dns/owner=default,external-dns/resource=httproute/default/whoami-http-route"

Provider logs:

│ {"level":"debug","msg":"response code from GET request to filtering/status: 200","time":"2024-09-09T15:56:24Z"}                                                                             │
│ {"level":"debug","msg":"retrieved filtering rules: {UserRules:[|a-whoami.local^$dnsrewrite=NOERROR;TXT;\"heritage=external-dns,external-dns/owner=default,external-dns/resource=httpro │
│ {"level":"debug","msg":"found rule a-whoami.local 0 IN TXT  \"heritage=external-dns []","time":"2024-09-09T15:56:24Z"}                                                                 │
│ {"level":"debug","msg":"found rule block.local 0 IN A  192.168.0.10 []","time":"2024-09-09T15:56:24Z"}                                                                                 │
│ {"level":"debug","msg":"found rule block.local 0 IN TXT  \"heritage=external-dns []","time":"2024-09-09T15:56:24Z"}                                                                    │
│ {"level":"debug","msg":"found rule a-block.local 0 IN TXT  \"heritage=external-dns []","time":"2024-09-09T15:56:24Z"}                                                                  │
│ {"level":"debug","msg":"found rule whoami.local 0 IN A  192.168.0.10 []","time":"2024-09-09T15:56:24Z"}                                                                                │
│ {"level":"debug","msg":"found rule whoami.local 0 IN TXT  \"heritage=external-dns []","time":"2024-09-09T15:56:24Z"}                                                                   │
│ {"level":"debug","msg":"returning records count: 6","requestMethod":"GET","requestPath":"/records","time":"2024-09-09T15:56:24Z"}                                                           │
│ {"level":"debug","msg":"requesting adjust endpoints count: 1","time":"2024-09-09T15:56:24Z"}                                                                                                │
│ {"level":"debug","msg":"return adjust endpoints response, resultEndpointCount: 1","time":"2024-09-09T15:56:24Z"} 

Kubernetes version: v1.30.4
Gateway implementation: cilium
Cilium Version: 1.16.1
External-dns Version: 0.15.0
Provider Version: 7.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions