-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eb2dc77
commit b72aeaf
Showing
44 changed files
with
3,491 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*~ | ||
# Various IDEs | ||
.vscode | ||
.project | ||
.idea/ | ||
*.tmproj | ||
OWNERS |
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,22 @@ | ||
apiVersion: v2 | ||
appVersion: 8.3.5 | ||
description: The leading tool for querying and visualizing time series and metrics. | ||
home: https://grafana.net | ||
icon: https://raw.githubusercontent.com/grafana/grafana/master/public/img/logo_transparent_400x.png | ||
kubeVersion: ^1.8.0-0 | ||
maintainers: | ||
- email: [email protected] | ||
name: zanhsieh | ||
- email: [email protected] | ||
name: rtluckie | ||
- email: [email protected] | ||
name: maorfr | ||
- email: [email protected] | ||
name: Xtigyro | ||
- email: [email protected] | ||
name: torstenwalter | ||
name: grafana | ||
sources: | ||
- https://github.com/grafana/grafana | ||
type: application | ||
version: 6.21.6-istio-compatible |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Leave this file empty to ensure that CI runs builds against the default configuration in values.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,53 @@ | ||
dashboards: | ||
my-provider: | ||
my-awesome-dashboard: | ||
# An empty but valid dashboard | ||
json: | | ||
{ | ||
"__inputs": [], | ||
"__requires": [ | ||
{ | ||
"type": "grafana", | ||
"id": "grafana", | ||
"name": "Grafana", | ||
"version": "6.3.5" | ||
} | ||
], | ||
"annotations": { | ||
"list": [ | ||
{ | ||
"builtIn": 1, | ||
"datasource": "-- Grafana --", | ||
"enable": true, | ||
"hide": true, | ||
"iconColor": "rgba(0, 211, 255, 1)", | ||
"name": "Annotations & Alerts", | ||
"type": "dashboard" | ||
} | ||
] | ||
}, | ||
"editable": true, | ||
"gnetId": null, | ||
"graphTooltip": 0, | ||
"id": null, | ||
"links": [], | ||
"panels": [], | ||
"schemaVersion": 19, | ||
"style": "dark", | ||
"tags": [], | ||
"templating": { | ||
"list": [] | ||
}, | ||
"time": { | ||
"from": "now-6h", | ||
"to": "now" | ||
}, | ||
"timepicker": { | ||
"refresh_intervals": ["5s"] | ||
}, | ||
"timezone": "", | ||
"title": "Dummy Dashboard", | ||
"uid": "IdcYQooWk", | ||
"version": 1 | ||
} | ||
datasource: Prometheus |
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,19 @@ | ||
dashboards: | ||
my-provider: | ||
my-awesome-dashboard: | ||
gnetId: 10000 | ||
revision: 1 | ||
datasource: Prometheus | ||
dashboardProviders: | ||
dashboardproviders.yaml: | ||
apiVersion: 1 | ||
providers: | ||
- name: 'my-provider' | ||
orgId: 1 | ||
folder: '' | ||
type: file | ||
updateIntervalSeconds: 10 | ||
disableDeletion: true | ||
editable: true | ||
options: | ||
path: /var/lib/grafana/dashboards/my-provider |
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,19 @@ | ||
podLabels: | ||
customLableA: Aaaaa | ||
imageRenderer: | ||
enabled: true | ||
env: | ||
RENDERING_ARGS: --disable-gpu,--window-size=1280x758 | ||
RENDERING_MODE: clustered | ||
podLabels: | ||
customLableB: Bbbbb | ||
networkPolicy: | ||
limitIngress: true | ||
limitEgress: true | ||
resources: | ||
limits: | ||
cpu: 1000m | ||
memory: 1000Mi | ||
requests: | ||
cpu: 500m | ||
memory: 50Mi |
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 @@ | ||
{} |
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,54 @@ | ||
1. Get your '{{ .Values.adminUser }}' user password by running: | ||
|
||
kubectl get secret --namespace {{ template "grafana.namespace" . }} {{ template "grafana.fullname" . }} -o jsonpath="{.data.admin-password}" | base64 --decode ; echo | ||
|
||
2. The Grafana server can be accessed via port {{ .Values.service.port }} on the following DNS name from within your cluster: | ||
|
||
{{ template "grafana.fullname" . }}.{{ template "grafana.namespace" . }}.svc.cluster.local | ||
{{ if .Values.ingress.enabled }} | ||
If you bind grafana to 80, please update values in values.yaml and reinstall: | ||
``` | ||
securityContext: | ||
runAsUser: 0 | ||
runAsGroup: 0 | ||
fsGroup: 0 | ||
|
||
command: | ||
- "setcap" | ||
- "'cap_net_bind_service=+ep'" | ||
- "/usr/sbin/grafana-server &&" | ||
- "sh" | ||
- "/run.sh" | ||
``` | ||
Details refer to https://grafana.com/docs/installation/configuration/#http-port. | ||
Or grafana would always crash. | ||
|
||
From outside the cluster, the server URL(s) are: | ||
{{- range .Values.ingress.hosts }} | ||
http://{{ . }} | ||
{{- end }} | ||
{{ else }} | ||
Get the Grafana URL to visit by running these commands in the same shell: | ||
{{ if contains "NodePort" .Values.service.type -}} | ||
export NODE_PORT=$(kubectl get --namespace {{ template "grafana.namespace" . }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "grafana.fullname" . }}) | ||
export NODE_IP=$(kubectl get nodes --namespace {{ template "grafana.namespace" . }} -o jsonpath="{.items[0].status.addresses[0].address}") | ||
echo http://$NODE_IP:$NODE_PORT | ||
{{ else if contains "LoadBalancer" .Values.service.type -}} | ||
NOTE: It may take a few minutes for the LoadBalancer IP to be available. | ||
You can watch the status of by running 'kubectl get svc --namespace {{ template "grafana.namespace" . }} -w {{ template "grafana.fullname" . }}' | ||
export SERVICE_IP=$(kubectl get svc --namespace {{ template "grafana.namespace" . }} {{ template "grafana.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') | ||
http://$SERVICE_IP:{{ .Values.service.port -}} | ||
{{ else if contains "ClusterIP" .Values.service.type }} | ||
export POD_NAME=$(kubectl get pods --namespace {{ template "grafana.namespace" . }} -l "app.kubernetes.io/name={{ template "grafana.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") | ||
kubectl --namespace {{ template "grafana.namespace" . }} port-forward $POD_NAME 3000 | ||
{{- end }} | ||
{{- end }} | ||
|
||
3. Login with the password from step 1 and the username: {{ .Values.adminUser }} | ||
|
||
{{- if not .Values.persistence.enabled }} | ||
################################################################################# | ||
###### WARNING: Persistence is disabled!!! You will lose your data when ##### | ||
###### the Grafana pod is terminated. ##### | ||
################################################################################# | ||
{{- end }} |
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,163 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "grafana.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "grafana.fullname" -}} | ||
{{- if .Values.fullnameOverride -}} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- $name := default .Chart.Name .Values.nameOverride -}} | ||
{{- if contains $name .Release.Name -}} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "grafana.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create the name of the service account | ||
*/}} | ||
{{- define "grafana.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create -}} | ||
{{ default (include "grafana.fullname" .) .Values.serviceAccount.name }} | ||
{{- else -}} | ||
{{ default "default" .Values.serviceAccount.name }} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{- define "grafana.serviceAccountNameTest" -}} | ||
{{- if .Values.serviceAccount.create -}} | ||
{{ default (print (include "grafana.fullname" .) "-test") .Values.serviceAccount.nameTest }} | ||
{{- else -}} | ||
{{ default "default" .Values.serviceAccount.nameTest }} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Allow the release namespace to be overridden for multi-namespace deployments in combined charts | ||
*/}} | ||
{{- define "grafana.namespace" -}} | ||
{{- if .Values.namespaceOverride -}} | ||
{{- .Values.namespaceOverride -}} | ||
{{- else -}} | ||
{{- .Release.Namespace -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "grafana.labels" -}} | ||
helm.sh/chart: {{ include "grafana.chart" . }} | ||
{{ include "grafana.selectorLabels" . }} | ||
{{- if or .Chart.AppVersion .Values.image.tag }} | ||
app.kubernetes.io/version: {{ .Values.image.tag | default .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- if .Values.extraLabels }} | ||
{{ toYaml .Values.extraLabels }} | ||
{{- end }} | ||
{{- end -}} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "grafana.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "grafana.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end -}} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "grafana.imageRenderer.labels" -}} | ||
helm.sh/chart: {{ include "grafana.chart" . }} | ||
{{ include "grafana.imageRenderer.selectorLabels" . }} | ||
{{- if or .Chart.AppVersion .Values.image.tag }} | ||
app.kubernetes.io/version: {{ .Values.image.tag | default .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end -}} | ||
|
||
{{/* | ||
Selector labels ImageRenderer | ||
*/}} | ||
{{- define "grafana.imageRenderer.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "grafana.name" . }}-image-renderer | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end -}} | ||
|
||
{{/* | ||
Looks if there's an existing secret and reuse its password. If not it generates | ||
new password and use it. | ||
*/}} | ||
{{- define "grafana.password" -}} | ||
{{- $secret := (lookup "v1" "Secret" (include "grafana.namespace" .) (include "grafana.fullname" .) ) -}} | ||
{{- if $secret -}} | ||
{{- index $secret "data" "admin-password" -}} | ||
{{- else -}} | ||
{{- (randAlphaNum 40) | b64enc | quote -}} | ||
{{- end -}} | ||
{{- end -}} | ||
{{/* | ||
Return the appropriate apiVersion for rbac. | ||
*/}} | ||
{{- define "grafana.rbac.apiVersion" -}} | ||
{{- if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1" }} | ||
{{- print "rbac.authorization.k8s.io/v1" -}} | ||
{{- else -}} | ||
{{- print "rbac.authorization.k8s.io/v1beta1" -}} | ||
{{- end -}} | ||
{{- end -}} | ||
{{/* | ||
Return the appropriate apiVersion for ingress. | ||
*/}} | ||
{{- define "grafana.ingress.apiVersion" -}} | ||
{{- if and (.Capabilities.APIVersions.Has "networking.k8s.io/v1") (semverCompare ">= 1.19-0" .Capabilities.KubeVersion.Version) -}} | ||
{{- print "networking.k8s.io/v1" -}} | ||
{{- else if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" -}} | ||
{{- print "networking.k8s.io/v1beta1" -}} | ||
{{- else -}} | ||
{{- print "extensions/v1beta1" -}} | ||
{{- end -}} | ||
{{- end -}} | ||
{{/* | ||
Return if ingress is stable. | ||
*/}} | ||
{{- define "grafana.ingress.isStable" -}} | ||
{{- eq (include "grafana.ingress.apiVersion" .) "networking.k8s.io/v1" -}} | ||
{{- end -}} | ||
{{/* | ||
Return if ingress supports ingressClassName. | ||
*/}} | ||
{{- define "grafana.ingress.supportsIngressClassName" -}} | ||
{{- or (eq (include "grafana.ingress.isStable" .) "true") (and (eq (include "grafana.ingress.apiVersion" .) "networking.k8s.io/v1beta1") (semverCompare ">= 1.18-0" .Capabilities.KubeVersion.Version)) -}} | ||
{{- end -}} | ||
{{/* | ||
Return if ingress supports pathType. | ||
*/}} | ||
{{- define "grafana.ingress.supportsPathType" -}} | ||
{{- or (eq (include "grafana.ingress.isStable" .) "true") (and (eq (include "grafana.ingress.apiVersion" .) "networking.k8s.io/v1beta1") (semverCompare ">= 1.18-0" .Capabilities.KubeVersion.Version)) -}} | ||
{{- end -}} |
Oops, something went wrong.