Skip to content

Draft: custom serivce#139

Draft
nigoroll wants to merge 1 commit into8.0from
8.0_custom_service
Draft

Draft: custom serivce#139
nigoroll wants to merge 1 commit into8.0from
8.0_custom_service

Conversation

@nigoroll
Copy link
Copy Markdown
Owner

This is a draft of an idea to generalize #138, implementing #132

As of this initial comment, there is no implementation, just a proposed VCC interface.

My expectation would be that this should allow to share code with the existing service implementation (which queries SRV records), because the resulting structure should be identical.

Copying the central example from the VCC draft, this would implement:

  acl ip6 { "::"/0; }

  sub vcl_init {
    new mysrv = dynamic.custom_service();
    mysrv.add_preferred("my.backend.example.com", acl=ip6);
  }

as a shorthand of

  acl ip6 { "::"/0; }

  sub vcl_init {
    new mysrv = dynamic.custom_service();
    mysrv.add("my.backend.example.com", if=match, acl=ip6, priority=0);
    mysrv.add("my.backend.example.com", if=nomatch, acl=ip6, priority=1);
  }

with .add() allowing for fine grained control, enabling other use cases, like preferring a local datacenter over a remote one.

Note that the proposal also includes support for the weight attribute, such that multiple A/AAAA/CNAME records can be added for load balancing.

@nigoroll nigoroll marked this pull request as draft March 27, 2026 17:12
@thomasklinger1234
Copy link
Copy Markdown

thomasklinger1234 commented Apr 2, 2026

@nigoroll just a follow up questions on this design:

from my reading on SRV records, it should already contain the priority and weight per entry. so I would assume that anyone using SRV records with libvmod-dynamic would handle preferences at the DNS server level.

so the point of this proposal is to mimick the way that SRV records are designed but bring the concept to A/AAAA/CNAME records, right?

@nigoroll
Copy link
Copy Markdown
Owner Author

nigoroll commented Apr 2, 2026

so the point of this proposal is to mimick the way that SRV records are designed but bring the concept to A/AAAA/CNAME records, right?

Exactly that, with the intend of improving code reuse / avoid duplication, while also implementing a proven concept.

@thomasklinger1234
Copy link
Copy Markdown

  acl ip6 { "::"/0; }

  sub vcl_init {
    new mysrv = dynamic.custom_service();
    mysrv.add_preferred("my.backend.example.com", acl=ip6);
  }

sounds alright to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants