Skip to content
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

warning: master confd[346010]: WARNING Found no templates #874

Open
ZhaoHaoRu opened this issue May 12, 2023 · 0 comments
Open

warning: master confd[346010]: WARNING Found no templates #874

ZhaoHaoRu opened this issue May 12, 2023 · 0 comments

Comments

@ZhaoHaoRu
Copy link

ZhaoHaoRu commented May 12, 2023

I try to use confd to help me dynamically reload nginx.conf, but when I try to start confd, I encounter this warning: "Found no templates"

Here are my config files:

the template-resource file:
/etc/confd/conf.d/nginx.toml, the content is:

[template]
src = "/etc/confd/templates/nginx.tmpl"
dest = "/etc/nginx/conf.d/nginx.conf"
keys = ["/service"]

the template file:
etc/confd/templates/nginx.tmpl, the content is:

server {
    listen 80;
    location / {
        set $service_name "{{getv "/service_name"}}";
        set $service_path "{{getv "/service_path"}}";
        set $servie_port "{{getv "/service_port"}}";
        proxy_pass http://$service_name:$servie_port$service_path;
    }
}

the nginx config file:
/etc/nginx/conf.d/nginx.conf, the content is:

events {
    worker_connections 1024;
}

http {
    server {
        listen 1080;
        location / {
            set $service_name "default-service";
            set $service_path "/default-path";
            set $service_port "80";
            proxy_pass http://$service_name:$service_port$service_path;
        }
    }

    include /etc/nginx/conf.d/*.conf;
}

my os: ubuntu 20.04
my nginx version: nginx/1.18.0
my confd version: 0.16.0

start command: confd -backend etcd -node http://localhost:2380 -config-file /etc/confd/conf.d/nginx.toml

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

No branches or pull requests

1 participant