Skip to content

Generate per-backend directors for multi-endpoint backends #11

@jensens

Description

@jensens

Problem

When a backend spec has multiple endpoints (e.g. a Kubernetes Service with multiple pods), the generator creates individual backend definitions like thumbor_0, thumbor_1, etc. But there is no director that groups them under the backend name.

VCL snippets cannot reference thumbor.backend() because no such director exists. Users must hardcode thumbor_0 which is fragile and breaks with endpoint changes.

Current behavior

backend thumbor_0 { .host = "10.42.5.171"; .port = "8888"; }
backend thumbor_1 { .host = "10.42.12.89"; .port = "8888"; }

No director for thumbor.

Expected behavior

backend thumbor_0 { .host = "10.42.5.171"; .port = "8888"; }
backend thumbor_1 { .host = "10.42.12.89"; .port = "8888"; }

sub vcl_init {
    new thumbor = directors.round_robin();
    thumbor.add_backend(thumbor_0);
    thumbor.add_backend(thumbor_1);
}

VCL snippets can then use thumbor.backend().

Architecture reference

This aligns with the existing shard director pattern in vcl_init.vcl.tmpl but extends it to per-backend directors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions