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

Support Config Generation #71

Merged
merged 6 commits into from
Mar 25, 2022
Merged

Support Config Generation #71

merged 6 commits into from
Mar 25, 2022

Conversation

pleshakov
Copy link
Contributor

@pleshakov pleshakov commented Mar 17, 2022

This PR adds a new component - Generator - for generating NGINX
config.

UPDATE: example log output:

{"level":"info","ts":1647553393.865566,"logger":"eventLoop","msg":"Processing a change","host":"cafe.example.com"}
{Op:1 Host:{Value:cafe.example.com PathRouteGroups:[{Path:/ Routes:[{MatchIdx:0 RuleIdx:0 Source:0xc0002e2480}]} {Path:/coffee Routes:[{MatchIdx:0 RuleIdx:0 Source:0xc00040c780}]} {Path:/tea Routes:[{MatchIdx:0 RuleIdx:0 Source:0xc00040d380}]}]}}
server {
        server_name cafe.example.com;


        location / {
                proxy_set_header Host $host;
                proxy_pass http://unix:/var/lib/nginx/nginx-502-server.sock;
        }

        location /coffee {
                proxy_set_header Host $host;
                proxy_pass http://10.96.114.34:80;
        }

        location /tea {
                proxy_set_header Host $host;
                proxy_pass http://10.96.239.145:80;
        }

}

This commit adds a new component - Generator - for generating NGINX
config.
internal/events/loop.go Outdated Show resolved Hide resolved
internal/events/loop_test.go Outdated Show resolved Hide resolved
internal/events/loop_test.go Show resolved Hide resolved
internal/nginx/config/generator_test.go Show resolved Hide resolved
internal/nginx/config/generator_test.go Show resolved Hide resolved
internal/nginx/config/generator_test.go Outdated Show resolved Hide resolved
internal/nginx/config/template.go Show resolved Hide resolved
@pleshakov
Copy link
Contributor Author

example of reported warning:

{"level":"info","ts":1648080976.7375154,"logger":"eventLoop","msg":"got warning while generating config","kind":"HTTPRoute","namespace":"default","name":"cafe","warning":"service default/main cannot be resolved: service default/main doesn't exist"}

@pleshakov pleshakov merged commit fe0175f into main Mar 25, 2022
@pleshakov pleshakov deleted the config-generation branch March 25, 2022 18:25
@pammecrandall pammecrandall added the enhancement New feature or request label Aug 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants