Skip to content

Commit 1f96cff

Browse files
authored
Fix cloud proxy entrypoint by avoiding modifying a RO directory (Configmap mount directory) (#2027)
Summary: Fix cloud proxy entrypoint by avoiding modifying a RO directory (Configmap mount directory) This bug was introduced between 0a44b36 and c3e0fba on #2018 when the individual file mounts were changed to a directory mount. Deploying the cloud proxy from main results in the following error: ``` $ kubectl -n plc logs cloud-proxy-5df85487bf-hrglr Defaulted container "cloud-proxy-server" out of: cloud-proxy-server, envoy /scripts/entrypoint.sh: line 20: can't create /usr/local/openresty/nginx/conf/nginx.conf: Read-only file system ``` When I originally tested the final change, I must have only looked at the resulting directory and missed that the pod was crashing. This issue was detected during the 0.1.8 cloud prerelease testing. Relevant Issues: #2017 #2013 Type of change: /kind bugfix Test Plan: Verified that the cloud proxy image starts up successfully Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
1 parent 2704ade commit 1f96cff

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

k8s/cloud/base/proxy_deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ spec:
7979
- name: certs
8080
mountPath: /certs
8181
- name: nginx-config
82-
mountPath: /usr/local/openresty/nginx/conf
82+
mountPath: /usr/local/openresty/nginx/conf.d
8383
securityContext:
8484
allowPrivilegeEscalation: false
8585
capabilities:

k8s/cloud/base/proxy_nginx_config.yaml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ data:
8585
etag on;
8686
expires 60m;
8787
add_header Cache-Control "public";
88-
include /usr/local/openresty/nginx/conf/headers_common.conf;
88+
include /usr/local/openresty/nginx/conf.d/headers_common.conf;
8989
9090
pixie_api.conf: |-
9191
location /api/ {
@@ -232,7 +232,7 @@ data:
232232
ssl_certificate /certs/tls.crt;
233233
ssl_certificate_key /certs/tls.key;
234234
235-
include /usr/local/openresty/nginx/conf/pixie_health_check.conf;
235+
include /usr/local/openresty/nginx/conf.d/pixie_health_check.conf;
236236
237237
if ($http_x_forwarded_proto = "http") {
238238
return 404;
@@ -250,10 +250,10 @@ data:
250250
listen 56000 ssl http2;
251251
server_name @PL_DOMAIN_NAME@ *.cluster.local;
252252
253-
include /usr/local/openresty/nginx/conf/pixie_compression.conf;
254-
include /usr/local/openresty/nginx/conf/pixie_vars.conf;
255-
include /usr/local/openresty/nginx/conf/pixie_server_defaults.conf;
256-
include /usr/local/openresty/nginx/conf/pixie_api.conf;
253+
include /usr/local/openresty/nginx/conf.d/pixie_compression.conf;
254+
include /usr/local/openresty/nginx/conf.d/pixie_vars.conf;
255+
include /usr/local/openresty/nginx/conf.d/pixie_server_defaults.conf;
256+
include /usr/local/openresty/nginx/conf.d/pixie_api.conf;
257257
258258
if ($http_x_forwarded_proto = "http") {
259259
return 307 https://$host$request_uri;
@@ -276,13 +276,13 @@ data:
276276
server_name work.@PL_DOMAIN_NAME@;
277277
278278
error_page 404 = @error404;
279-
include /usr/local/openresty/nginx/conf/pixie_compression.conf;
280-
include /usr/local/openresty/nginx/conf/pixie_vars.conf;
281-
include /usr/local/openresty/nginx/conf/pixie_server_defaults.conf;
282-
include /usr/local/openresty/nginx/conf/pixie_health_check.conf;
283-
include /usr/local/openresty/nginx/conf/pixie_api.conf;
284-
include /usr/local/openresty/nginx/conf/headers_common.conf;
285-
include /usr/local/openresty/nginx/conf/private/*.conf;
279+
include /usr/local/openresty/nginx/conf.d/pixie_compression.conf;
280+
include /usr/local/openresty/nginx/conf.d/pixie_vars.conf;
281+
include /usr/local/openresty/nginx/conf.d/pixie_server_defaults.conf;
282+
include /usr/local/openresty/nginx/conf.d/pixie_health_check.conf;
283+
include /usr/local/openresty/nginx/conf.d/pixie_api.conf;
284+
include /usr/local/openresty/nginx/conf.d/headers_common.conf;
285+
include /usr/local/openresty/nginx/conf.d/private/*.conf;
286286
287287
# Disable caching by default.
288288
add_header Cache-Control "no-store";
@@ -342,14 +342,14 @@ data:
342342
location ~ ^/static(/.*)$ {
343343
gzip_static off;
344344
root /assets;
345-
include /usr/local/openresty/nginx/conf/pixie_cache.conf;
346-
include /usr/local/openresty/nginx/conf/pixie_filter.conf;
345+
include /usr/local/openresty/nginx/conf.d/pixie_cache.conf;
346+
include /usr/local/openresty/nginx/conf.d/pixie_filter.conf;
347347
try_files $1 "/index.html";
348348
}
349349
350350
location /auth-complete {
351351
root /assets;
352-
include /usr/local/openresty/nginx/conf/pixie_filter.conf;
352+
include /usr/local/openresty/nginx/conf.d/pixie_filter.conf;
353353
try_files $uri "/index.html";
354354
}
355355
@@ -368,8 +368,8 @@ data:
368368
listen 56000 ssl http2;
369369
server_name segment.@PL_DOMAIN_NAME@;
370370
371-
include /usr/local/openresty/nginx/conf/pixie_compression.conf;
372-
include /usr/local/openresty/nginx/conf/pixie_vars.conf;
371+
include /usr/local/openresty/nginx/conf.d/pixie_compression.conf;
372+
include /usr/local/openresty/nginx/conf.d/pixie_vars.conf;
373373
374374
set $segment_cdn "cdn.segment.com";
375375

src/cloud/proxy/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# SPDX-License-Identifier: Apache-2.0
1818

1919
if [ -n "$PL_DOMAIN_NAME" ]; then
20-
sed -e "s/[@]PL_DOMAIN_NAME[@]/$PL_DOMAIN_NAME/" /usr/local/openresty/nginx/conf/nginx.conf.tmpl > /usr/local/openresty/nginx/conf/nginx.conf
20+
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
2121
else
2222
echo "PL_DOMAIN_NAME undefined, exiting"
2323
exit 1

0 commit comments

Comments
 (0)