-
Notifications
You must be signed in to change notification settings - Fork 179
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
Serve robots.txt for Prow #4365
Conversation
/hold |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to host robts.txt on a gcp bucket and proxy request there? We can simply mount this file in to nginx container and treat nginx as ordinary http server not revers proxy? Without proxying we can store robots.txt in our test-infra repo and have it versioned and deployed along with other prow components and configuration. robots.txt content can be provided as config map.
It'd also need to populate some kind of ConfigMap reloader which would restart the instance once the configmap changes. Maybe instead of using nginx the better approach would be writing simple agent based on |
I don't think this file will change often. But simple k8s command implemented to run as postsubmit when file change will do the trick. This could be added eventualy as extension configreloader. |
If creating simple ConfigMap watcher will be enough then I see no sense in introducing another ProwJob. |
Right, @Ressetkk could you please share why introducing simple ConfigMap watcher has more sense than another ProwJob? |
Of course:
|
I agree that using ConfigMap is a simpler approach but I avoided it so we won't need a ConfigMap reloader. |
I would go with writing simple go server with the ConfigMap watch capability instead of external reloader |
One last remark - k8s automatically updates the mounted configmaps as volumes, so if robots.txt is updated in cluster then the Mounted ConfigMap files will also update. With that you can go with simple server that hosts only robots.txt file and the ConfigMap mounted as a volume without thinking about reloading the ConfigMap. |
We don't need to write anything new for this task. All pieces we need are in place. @ammarlakis please check: Line 36 in 1808bb8
https://github.com/kubernetes/test-infra/tree/master/prow/plugins/updateconfig This plugin should do the job for updating config-map in a cluster. With last comment from Kamil your done. You don't need anything else. |
@Ressetkk I see the minimalistic approach you propose, but it does not bring much benefit considering the cost of maintaining code (even a simple one), and the cost of losing the features nginx provides and we may use in the future, like reverse proxy or hosting other static files with complicated path rules or response manipulation. |
I missed the point that we were talking about updating the robots.txt ConfigMap and was thinking about updating the nginx configuration ConfigMap. I'll update the PR according to your comments. |
/unhold |
b795a8e
to
b1478b3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we change directory name from static_files to static-files as this is rather convention used in prow directory?
Static-files should be placed in a directory like web-server-content to indicate purpose/destination of this static files.
Please add some short README.md with explanation why we have this robots.txt, how and where it's used. How to update it.
Why we need empty index.html? Nginx requires it to start? If yes, describe it in README.md
39e156a
to
ca147d6
Compare
Signed-off-by: Ammar Lakis <[email protected]>
Signed-off-by: Ammar Lakis <[email protected]>
Signed-off-by: Ammar Lakis <[email protected]>
ca147d6
to
4c4af18
Compare
/test pre-main-test-infra-validate-image-url-helper |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please extend operational documentation how to work with this component.
Signed-off-by: Ammar Lakis <[email protected]>
Signed-off-by: Ammar Lakis <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check my suggestion.
Co-authored-by: Przemek Pokrywka <[email protected]>
/test pre-test-infra-validate-scripts |
Co-authored-by: Aleksandra Simeonova <[email protected]>
@ammarlakis: Updated the
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Description
Changes proposed in this pull request:
Other approaches considered:
Related issue(s)