-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
patch nginx-config file with values from 102.0.1+up40.1.2 fix the tar time check warnng fetch rancher/shell v0.1.18, both rancher-monitoring-crd and rancher-monitoring are using it Signed-off-by: Jian Wang <w13915984028@gmail.com> (cherry picked from commit 9d9576c)
- Loading branch information
1 parent
e52fd93
commit bba02ba
Showing
6 changed files
with
139 additions
and
9 deletions.
There are no files selected for viewing
90 changes: 90 additions & 0 deletions
90
pkg/config/templates/patch/rancher-monitoring/102.0.0+up40.1.2/nginx-config.yaml
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,90 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: grafana-nginx-proxy-config | ||
namespace: {{ template "grafana.namespace" . }} | ||
labels: | ||
{{- include "grafana.labels" . | nindent 4 }} | ||
data: | ||
nginx.conf: |- | ||
worker_processes auto; | ||
error_log /dev/stdout warn; | ||
pid /var/cache/nginx/nginx.pid; | ||
events { | ||
worker_connections 1024; | ||
} | ||
http { | ||
include /etc/nginx/mime.types; | ||
log_format main '[$time_local - $status] $remote_addr - $remote_user $request ($http_referer)'; | ||
proxy_connect_timeout 10; | ||
proxy_read_timeout 180; | ||
proxy_send_timeout 5; | ||
proxy_buffering off; | ||
proxy_cache_path /var/cache/nginx/cache levels=1:2 keys_zone=my_zone:100m inactive=1d max_size=10g; | ||
map $http_upgrade $connection_upgrade { | ||
default upgrade; | ||
'' close; | ||
} | ||
server { | ||
listen 8080; | ||
access_log off; | ||
gzip on; | ||
gzip_min_length 1k; | ||
gzip_comp_level 2; | ||
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript image/jpeg image/gif image/png; | ||
gzip_vary on; | ||
gzip_disable "MSIE [1-6]\."; | ||
proxy_set_header Host $host; | ||
location /api/dashboards { | ||
proxy_pass http://localhost:3000; | ||
} | ||
location /api/search { | ||
proxy_pass http://localhost:3000; | ||
sub_filter_types application/json; | ||
sub_filter_once off; | ||
} | ||
location /api/live/ { | ||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection $connection_upgrade; | ||
proxy_set_header Host $http_host; | ||
proxy_pass http://localhost:3000; | ||
} | ||
location / { | ||
proxy_cache my_zone; | ||
proxy_cache_valid 200 302 1d; | ||
proxy_cache_valid 301 30d; | ||
proxy_cache_valid any 5m; | ||
proxy_cache_bypass $http_cache_control; | ||
add_header X-Proxy-Cache $upstream_cache_status; | ||
add_header Cache-Control "public"; | ||
proxy_pass http://localhost:3000/; | ||
sub_filter_once off; | ||
sub_filter '"appSubUrl":""' '"appSubUrl":"/api/v1/namespaces/{{ template "grafana.namespace" . }}/services/http:{{ template "grafana.fullname" . }}:{{ .Values.service.port }}/proxy"'; | ||
sub_filter ':"/avatar/' ':"avatar/'; | ||
if ($request_filename ~ .*\.(?:js|css|jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm)$) { | ||
expires 90d; | ||
} | ||
rewrite ^/k8s/clusters/.*/proxy(.*) /$1 break; | ||
} | ||
} | ||
} |
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,34 @@ | ||
#!/bin/bash | ||
|
||
patch_rancher_monitoring_chart() | ||
{ | ||
local chart_dir=$1 #${CHARTS_DIR} | ||
local monitoring_version=$2 #MONITORING_VERSION | ||
local pkg_monitoring_path=$3 #${PKG_PATCH_MONITORING_PATH} | ||
local cwd=$(pwd) | ||
|
||
if [ ! -d "${pkg_monitoring_path}/${monitoring_version}" ]; then | ||
echo "NOTE: there is no related path: ${pkg_monitoring_path}/${monitoring_version} to patch, SKIP" | ||
return 0 | ||
fi | ||
|
||
cd ${chart_dir} | ||
tar zxf rancher-monitoring-${monitoring_version}.tgz --warning=no-timestamp | ||
|
||
local nm="./rancher-monitoring/charts/grafana/templates/nginx-config.yaml" | ||
echo "patch $nm, original file" | ||
ls -alth "$nm" || echo "file $nm is not found" | ||
rm -f "$nm" | ||
cp -f ${pkg_monitoring_path}/${monitoring_version}/nginx-config.yaml "$nm" | ||
echo "patched file" | ||
ls -alth "$nm" | ||
|
||
# remove existing chart | ||
rm -f ${chart_dir}/rancher-monitoring-${monitoring_version}.tgz | ||
|
||
# helm pack new | ||
helm package rancher-monitoring | ||
echo "finish patch ranch-monitoring chart" | ||
cd $cwd | ||
} | ||
|
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 |
---|---|---|
@@ -1 +1 @@ | ||
MONITORING_VERSION=100.1.0+up19.0.3 | ||
MONITORING_VERSION=102.0.0+up40.1.2 |