-
Notifications
You must be signed in to change notification settings - Fork 0
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
Adding support for proxy cache #38
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
d298b90
Draft: adding support for proxy cache
5fe974a
Update default image to 2.2.2; add cache; update HPA
a47fd06
additional updates
9ffa248
Add icon to pass lint
9d524c0
remove readonly root file system of nginx pod
de2f9fc
Update selector labels
8ea8aff
bump version
adab9de
fix names
999d9d8
updates
5f7aa81
updated docs
32baa84
doc updates
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
{{- if .Values.cache.enable }} | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ .Release.Name }}-nginx | ||
data: | ||
nginx.conf: | | ||
pid /tmp/nginx.pid; | ||
events { | ||
worker_connections 1024; | ||
} | ||
http { | ||
proxy_cache_path /tmp/nginx_cache levels=1:2 keys_zone=my_cache:10m max_size=1g | ||
inactive=60m use_temp_path=off; | ||
client_body_temp_path /tmp/client_temp; | ||
proxy_temp_path /tmp/proxy_temp_path; | ||
fastcgi_temp_path /tmp/fastcgi_temp; | ||
uwsgi_temp_path /tmp/uwsgi_temp; | ||
scgi_temp_path /tmp/scgi_temp; | ||
server { | ||
listen 8080; | ||
server_name localhost; | ||
location /v1/policy/list { | ||
include cache_config.conf; | ||
include common_proxy.conf; | ||
proxy_cache_key "$request_uri|$http_x_whylabs_organization"; | ||
} | ||
location /v1/organizations/managed-organizations { | ||
include cache_config.conf; | ||
include common_proxy.conf; | ||
proxy_cache_key "$request_uri|$http_x_whylabs_organization"; | ||
} | ||
location /v1/policy { | ||
include cache_config.conf; | ||
include common_proxy.conf; | ||
proxy_cache_key "$request_uri|$http_x_whylabs_organization"; | ||
} | ||
location /v1/api-key/validate { | ||
include cache_config.conf; | ||
include common_proxy.conf; | ||
proxy_cache_key "$request_uri|$http_x_api_key"; | ||
} | ||
location / { | ||
include common_proxy.conf; | ||
} | ||
} | ||
} | ||
cache_config.conf: | | ||
proxy_cache my_cache; | ||
proxy_cache_valid 200 403 {{ .Values.cache.duration }}; | ||
proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; | ||
add_header X-Cache-Status $upstream_cache_status always; | ||
common_proxy.conf: | | ||
proxy_pass https://{{ .Values.cache.endpoint }}; | ||
proxy_set_header Host {{ .Values.cache.endpoint }}; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
proxy_set_header Accept $http_accept; | ||
proxy_set_header Accept-Encoding $http_accept_encoding; | ||
proxy_set_header X-API-Key $http_x_api_key; | ||
proxy_set_header X-WhyLabs-Organization $http_x_whylabs_organization; | ||
{{- end }} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It looks like these are just duplicated from 0.4?