-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] Configuring backend from Service (ExternalName) or with ext ip:port #84
Comments
Right now, the backends are chosen by the In regard to your selector question, that should only happen when there are no pods matching the selector. Double check how you're setting backend:
port: 2034
selector:
app: varnish-backend To test, you can use |
Based on your feedback, I was able get real backends in backends.vcl and also "X-Varnish-Cache: HIT" in the response. The problem was due to the backend.port referring to the service port (80) rather then pod hostport (8180). This was causing readiness check to fail. Thanks a lot for your help. Should I create the feature request for supporting a Service backend, in particular services that are running outside varnish's cluster ? I think this will be a very useful addition since caching aims to reduce external roundtrips and origin processing. |
@kmathewmk, I'm glad you were able to get things going. TBH, it's been so long since we wrote the selection code (which I didn't write) that I don't recall why decisions were made. I vaguely recall watching services being a problem because you don't get updates when the endpoints change or something like that. Maybe you just watch the endpoints themselves? So there's some research to be done there. I think there are two choices here:
Either way there needs to be something that runs outside the operator to obtain and update the endpoint IPs. Am I missing anything here? Maybe a better way to do it? Otherwise, I think I may have just talked myself into thinking this should be something maintained outside of the operator. I'm definitely open to hearing more (hopefully better :) ) ideas. |
@cin sorry for the delayed response. |
Trying out varnish-operator, I see that the backends are generated dynamically from the pods. I would like to know if it is possible to specify an ExternalName Service as a backend or bunch of ip:port external to the cluster running varnish.
Additionally, when I try to get specify the pods using backend.selector.app, the varnish cluster pods in the sts have only the default/dummy backend resulting in "HTTP/1.1 503 No backends configured". How can one troubleshoot the processing of the backend configuration? "logLevel: debug" does not seem to produce any additional logs for this case.
Any help/guidance is much appreciated.
The text was updated successfully, but these errors were encountered: