Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
system-charts
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Rancher商店
system-charts
Commits
7085404a
Commit
7085404a
authored
Feb 19, 2019
by
Frank Mai
Committed by
orangedeng
Feb 20, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge hooks-configmap.yaml into nginx-configmap.yaml of Grafana
parent
c2bc5b9f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
55 deletions
+45
-55
deployment.yaml
...onitoring/v0.0.2/charts/grafana/templates/deployment.yaml
+11
-10
hooks-configmap.yaml
...ring/v0.0.2/charts/grafana/templates/hooks-configmap.yaml
+0
-44
nginx-configmap.yaml
...ring/v0.0.2/charts/grafana/templates/nginx-configmap.yaml
+34
-1
No files found.
charts/rancher-monitoring/v0.0.2/charts/grafana/templates/deployment.yaml
View file @
7085404a
...
...
@@ -29,7 +29,7 @@ spec:
{{
toYaml .Values.resources.inits | indent 10
}}
{{
- end
}}
volumeMounts
:
-
name
:
grafana-
static-hooks
-
name
:
grafana-
nginx
mountPath
:
/run.sh
subPath
:
copy-datasource-plugin-json.sh
-
name
:
grafana-static-contents
...
...
@@ -37,14 +37,14 @@ spec:
-
name
:
grafana-init-plugin-json-modify
image
:
{{
template "system_default_registry" .
}}{{
.Values.image.tool.repository
}}
:{{ .Values.image.tool.tag }}
command
:
-
/
usr/bin/modify-datasource-plugin-jso
n.sh
-
/
ru
n.sh
{{
- if and .Values.resources .Values.resources.inits
}}
resources
:
{{
toYaml .Values.resources.inits | indent 10
}}
{{
- end
}}
volumeMounts
:
-
name
:
grafana-
static-hooks
mountPath
:
/
usr/bin/modify-datasource-plugin-jso
n.sh
-
name
:
grafana-
nginx
mountPath
:
/
ru
n.sh
subPath
:
modify-datasource-plugin-json.sh
-
name
:
grafana-static-contents
mountPath
:
/host
...
...
@@ -128,10 +128,6 @@ spec:
securityContext
:
fsGroup
:
472
volumes
:
-
name
:
grafana-static-hooks
configMap
:
name
:
{{
template "app.hooks.fullname" .
}}
defaultMode
:
0777
-
name
:
grafana-static-contents
emptyDir
:
{}
-
name
:
grafana-storage
...
...
@@ -143,12 +139,17 @@ spec:
{{
- end
}}
-
name
:
grafana-nginx
configMap
:
defaultMode
:
438
name
:
{{
template "app.nginx.fullname" .
}}
items
:
-
key
:
nginx.conf
mode
:
438
path
:
nginx.conf
name
:
{{
template "app.nginx.fullname" .
}}
-
key
:
copy-datasource-plugin-json.sh
mode
:
0777
path
:
copy-datasource-plugin-json.sh
-
key
:
modify-datasource-plugin-json.sh
mode
:
0777
path
:
modify-datasource-plugin-json.sh
-
name
:
grafana-dashboards
configMap
:
name
:
{{
template "app.dashboards.fullname" .
}}
...
...
charts/rancher-monitoring/v0.0.2/charts/grafana/templates/hooks-configmap.yaml
deleted
100644 → 0
View file @
c2bc5b9f
apiVersion
:
v1
kind
:
ConfigMap
metadata
:
labels
:
app
:
{{
template "app.name" .
}}
chart
:
{{
template "app.version" .
}}
heritage
:
{{
.Release.Service
}}
release
:
{{
.Release.Name
}}
name
:
{{
template "app.hooks.fullname" .
}}
data
:
copy-datasource-plugin-json.sh
:
|-
#!/bin/bash
srcpath="/usr/share/grafana/public/app/plugins/datasource/prometheus/plugin.json"
dstpath="/host/grafana/raw-plugin.json"
if [[ -f $srcpath ]] && [[ -d /host ]]; then
mkdir -p /host/grafana
cp -f $srcpath $dstpath
exit 0
fi
exit 1
modify-datasource-plugin-json.sh: |-
#!/bin/sh
srcpath="/host/grafana/raw-plugin.json"
dstpath="/host/grafana/plugin.json"
if [ -f $srcpath ] && [ -d /host ]; then
mkdir -p /host/grafana
token=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)
cat $srcpath | K8S_BEARERTOKEN="Bearer $token" jq 'to_entries | . + [{"key":"routes","value":[{"path":"api/v1","url":"{{ .Values.prometheusDatasourceURL }}/api/v1","headers":[{"name":"Authorization","content":env.K8S_BEARERTOKEN}]}]}] | from_entries' > $dstpath
exit 0
fi
exit 1
charts/rancher-monitoring/v0.0.2/charts/grafana/templates/nginx-configmap.yaml
View file @
7085404a
...
...
@@ -9,10 +9,43 @@ metadata:
release
:
{{
.Release.Name
}}
component
:
nginx
data
:
copy-datasource-plugin-json.sh
:
|-
#!/bin/bash
srcpath="/usr/share/grafana/public/app/plugins/datasource/prometheus/plugin.json"
dstpath="/host/grafana/raw-plugin.json"
if [[ -f $srcpath ]] && [[ -d /host ]]; then
mkdir -p /host/grafana
cp -f $srcpath $dstpath
exit 0
fi
exit 1
modify-datasource-plugin-json.sh: |-
#!/bin/sh
srcpath="/host/grafana/raw-plugin.json"
dstpath="/host/grafana/plugin.json"
if [ -f $srcpath ] && [ -d /host ]; then
mkdir -p /host/grafana
token=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)
cat $srcpath | K8S_BEARERTOKEN="Bearer $token" jq 'to_entries | . + [{"key":"routes","value":[{"path":"api/v1","url":"{{ .Values.prometheusDatasourceURL }}/api/v1","headers":[{"name":"Authorization","content":env.K8S_BEARERTOKEN}]}]}] | from_entries' > $dstpath
exit 0
fi
exit 1
nginx.conf: |-
user nginx;
worker_processes auto;
error_log /dev/
null
warn;
error_log /dev/
stdout
warn;
pid /var/run/nginx.pid;
events {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment