Open jb6925 opened 3 years ago
@jb6925 This should works:
resty --http-conf 'resolver 172.31.0.10' /kong/spec/jwtcache_test.lua
Thanks @doujiang24. The resolver was added to the configuration but now I'm unable to override the default .
ie
nginx: [emerg] "resolver" directive is duplicate in /tmp/resty_rCLHKZYDlc/conf/nginx.conf:172
Is it possible to override the resolver? Or is there a way to set the resolver local=on;
?
Okay, after checking the source code:
--ns IP
, specify a custom name server (multiple instances are supported)/etc/resolv.conf
if no ns specified.So, I think 1 should work then.
Also, I'm a bit confused, does nameserver 172.31.0.10
already exists in the /etc/resolv.conf
file?
@doujiang24 yes it does.
my /etc/resolv.conf
nameserver 172.31.0.10
search gitlab-runners.svc.cluster.local svc.cluster.local cluster.local xxxx.yy.zzzz.internal bb.aaaa.internal google.internal
options ndots:5
using the --ns
parameter i'm back to my original error.
redis could not be resolved (3: Host not found)
is it possible that the search
isn't be used?
is it possible that the search isn't be used?
Hi @jb6925, currentlly resolver local=on;
does not use the search
field in /etc/resolv.conf
.
I'm running a unit test with resty in a kubernetes cluster.
resty /kong/spec/jwtcache_test.lua --http-conf 'resolver 172.31.0.10' --main-conf 'resolver 172.31.0.10'
This test uses "resty.redis" to try to connect to a redis instance that is deployed as a service.
Error:
redis could not be resolved (3: Host not found)
Should this work? I'm not really looking up a proxy address in nginx.
Thanks for your time in looking at this issue.