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

Fix cloud proxy entrypoint by avoiding modifying a RO directory (Configmap mount directory) #2027

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion k8s/cloud/base/proxy_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ spec:
- name: certs
mountPath: /certs
- name: nginx-config
mountPath: /usr/local/openresty/nginx/conf
mountPath: /usr/local/openresty/nginx/conf.d
securityContext:
allowPrivilegeEscalation: false
capabilities:
Expand Down
36 changes: 18 additions & 18 deletions k8s/cloud/base/proxy_nginx_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ data:
etag on;
expires 60m;
add_header Cache-Control "public";
include /usr/local/openresty/nginx/conf/headers_common.conf;
include /usr/local/openresty/nginx/conf.d/headers_common.conf;

pixie_api.conf: |-
location /api/ {
Expand Down Expand Up @@ -232,7 +232,7 @@ data:
ssl_certificate /certs/tls.crt;
ssl_certificate_key /certs/tls.key;

include /usr/local/openresty/nginx/conf/pixie_health_check.conf;
include /usr/local/openresty/nginx/conf.d/pixie_health_check.conf;

if ($http_x_forwarded_proto = "http") {
return 404;
Expand All @@ -250,10 +250,10 @@ data:
listen 56000 ssl http2;
server_name @PL_DOMAIN_NAME@ *.cluster.local;

include /usr/local/openresty/nginx/conf/pixie_compression.conf;
include /usr/local/openresty/nginx/conf/pixie_vars.conf;
include /usr/local/openresty/nginx/conf/pixie_server_defaults.conf;
include /usr/local/openresty/nginx/conf/pixie_api.conf;
include /usr/local/openresty/nginx/conf.d/pixie_compression.conf;
include /usr/local/openresty/nginx/conf.d/pixie_vars.conf;
include /usr/local/openresty/nginx/conf.d/pixie_server_defaults.conf;
include /usr/local/openresty/nginx/conf.d/pixie_api.conf;

if ($http_x_forwarded_proto = "http") {
return 307 https://$host$request_uri;
Expand All @@ -276,13 +276,13 @@ data:
server_name work.@PL_DOMAIN_NAME@;

error_page 404 = @error404;
include /usr/local/openresty/nginx/conf/pixie_compression.conf;
include /usr/local/openresty/nginx/conf/pixie_vars.conf;
include /usr/local/openresty/nginx/conf/pixie_server_defaults.conf;
include /usr/local/openresty/nginx/conf/pixie_health_check.conf;
include /usr/local/openresty/nginx/conf/pixie_api.conf;
include /usr/local/openresty/nginx/conf/headers_common.conf;
include /usr/local/openresty/nginx/conf/private/*.conf;
include /usr/local/openresty/nginx/conf.d/pixie_compression.conf;
include /usr/local/openresty/nginx/conf.d/pixie_vars.conf;
include /usr/local/openresty/nginx/conf.d/pixie_server_defaults.conf;
include /usr/local/openresty/nginx/conf.d/pixie_health_check.conf;
include /usr/local/openresty/nginx/conf.d/pixie_api.conf;
include /usr/local/openresty/nginx/conf.d/headers_common.conf;
include /usr/local/openresty/nginx/conf.d/private/*.conf;

# Disable caching by default.
add_header Cache-Control "no-store";
Expand Down Expand Up @@ -342,14 +342,14 @@ data:
location ~ ^/static(/.*)$ {
gzip_static off;
root /assets;
include /usr/local/openresty/nginx/conf/pixie_cache.conf;
include /usr/local/openresty/nginx/conf/pixie_filter.conf;
include /usr/local/openresty/nginx/conf.d/pixie_cache.conf;
include /usr/local/openresty/nginx/conf.d/pixie_filter.conf;
try_files $1 "/index.html";
}

location /auth-complete {
root /assets;
include /usr/local/openresty/nginx/conf/pixie_filter.conf;
include /usr/local/openresty/nginx/conf.d/pixie_filter.conf;
try_files $uri "/index.html";
}

Expand All @@ -368,8 +368,8 @@ data:
listen 56000 ssl http2;
server_name segment.@PL_DOMAIN_NAME@;

include /usr/local/openresty/nginx/conf/pixie_compression.conf;
include /usr/local/openresty/nginx/conf/pixie_vars.conf;
include /usr/local/openresty/nginx/conf.d/pixie_compression.conf;
include /usr/local/openresty/nginx/conf.d/pixie_vars.conf;

set $segment_cdn "cdn.segment.com";

Expand Down
2 changes: 1 addition & 1 deletion src/cloud/proxy/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# SPDX-License-Identifier: Apache-2.0

if [ -n "$PL_DOMAIN_NAME" ]; then
sed -e "s/[@]PL_DOMAIN_NAME[@]/$PL_DOMAIN_NAME/" /usr/local/openresty/nginx/conf/nginx.conf.tmpl > /usr/local/openresty/nginx/conf/nginx.conf
sed -e "s/[@]PL_DOMAIN_NAME[@]/$PL_DOMAIN_NAME/" /usr/local/openresty/nginx/conf.d/nginx.conf.tmpl > /usr/local/openresty/nginx/conf/nginx.conf
else
echo "PL_DOMAIN_NAME undefined, exiting"
exit 1
Expand Down
Loading