Commit 67da9f85 by Guangbo Chen

added grafana and update prometheus chart

parent f444b18d
description: Grafana instance for kube-prometheus
engine: gotpl
maintainers:
- email: weiwei.inf@gmail.com
name: Wei Wei
- email: vglafirov@gmail.com
name: Vladimir Glafirov
icon: https://raw.githubusercontent.com/grafana/grafana/master/public/img/logo_transparent_400x.png
name: grafana
sources:
- https://github.com/coreos/prometheus-operator
version: 0.0.30
appVersion: 5.1.2
kubeVersion: "^1.8.0-0"
## Configuration
Parameter | Description | Default
--- | --- | ---
`routePrefix` | Prefix used to register routes | `"/"`
`auth.anonymous.enabled` | If true, enable anonymous authentication | `true`
`adminUser` | Grafana admin user name | `admin`
`adminPassword` | Grafana admin user password | `admin`
`image.repository` | Image | `grafana/grafana`
`image.tag` | Image tag | `4.4.1`
`extraVars` | Pass extra environment variables to the Grafana container. | `{}`
`grafanaWatcher.repository` | Image | `quay.io/coreos/grafana-watcher`
`grafanaWatcher.tag` | Image tag | `v0.0.8`
`ingress.enabled` | If true, Grafana Ingress will be created | `false`
`ingress.annotations` | Annotations for Grafana Ingress | `{}`
`ingress.labels` | Labels for Grafana Ingress | `{}`
`ingress.hosts` | Grafana Ingress fully-qualified domain names | `[]`
`ingress.tls` | TLS configuration for Grafana Ingress | `[]`
`nodeSelector` | Node labels for pod assignment | `{}`
`resources` | Pod resource requests & limits | `{}`
`service.annotations` | Annotations to be added to the Grafana Service | `{}`
`service.clusterIP` | Cluster-internal IP address for Grafana Service | `""`
`service.externalIPs` | List of external IP addresses at which the Grafana Service will be available | `[]`
`service.loadBalancerIP` | External IP address to assign to Grafana Service | `""`
`service.loadBalancerSourceRanges` | List of client IPs allowed to access Grafana Service | `[]`
`service.nodePort` | Port to expose Grafana Service on each node | `30902`
`service.type` | Grafana Service type | `ClusterIP`
`storageSpec` | Grafana StorageSpec for persistent data | `{}`
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
```
Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example,
> **Tip**: You can use the default [values.yaml](values.yaml)
> **Tip**: On GCE If you want to use `Ingress.enabled=true`, you must put `service.type=NodePort`
# Grafana
Grafana is an open source, feature rich metrics dashboard and graph editor for Graphite, Elasticsearch, OpenTSDB, Prometheus and InfluxDB.
categories:
- dashboard
questions:
- variable: defaultImage
default: "true"
description: "Use default Docker image"
label: Use Default Image
type: boolean
show_subquestion_if: false
group: "Container Images"
subquestions:
- variable: image.repository
default: "grafana/grafana"
description: "Grafana image name"
type: string
label: Grafana Image Name
- variable: image.tag
default: "5.0.0"
description: "Grafana image tag"
type: string
label: Grafana Image Tag
- variable: grafanaWatcher.image.repository
default: "appropriate/curl"
description: "Grafana Watcher image name"
type: string
label: Grafana Watcher Image Name
- variable: grafanaWatcher.image.tag
default: "latest"
description: "Grafana Watcher image tag"
type: string
label: Grafana Watcher Image Tag
# grafana configurations
- variable: adminUser
default: "admin"
description: "Grafana admin username"
type: string
group: "Grafana Settings"
label: Grafana Admin Username
required: true
- variable: adminPassword
default: ""
description: "Grafana admin password"
type: password
group: "Grafana Settings"
label: Grafana Admin Password
- variable: auth.anonymous.enabled
default: true
description: "Allow anonymous user to view the dashboard"
type: boolean
group: "Grafana Settings"
label: Anonymous Access
- variable: persistence.enabled
default: "false"
description: "Enable persistent volume for Grafana"
type: boolean
required: true
label: Grafana Persistent Volume Enabled
show_subquestion_if: true
group: "Grafana Settings"
subquestions:
- variable: persistence.size
default: "8Gi"
description: "Grafana Persistent Volume Size"
type: string
label: Grafana Volume Size
required: true
- variable: persistence.storageClass
default: ""
description: "If undefined or set to null, using the default storageClass. Defaults to null."
type: storageclass
label: Storage Class for Grafana
- variable: ingress.enabled
default: "true"
description: "Expose grafana using Layer 7 Load Balancer - ingress"
type: boolean
label: Expose Grafana using Layer 7 Load Balancer
show_subquestion_if: true
group: "Service and Load Balancing"
required: true
subquestions:
- variable: ingress.hosts[0]
default: "xip.io"
description: "Hostname to your grafana installation"
type: hostname
required: true
label: Hostname
- variable: server.type
default: "NodePort"
description: "Grafana service type"
type: enum
group: "Service and Load Balancing"
options:
- "ClusterIP"
- "NodePort"
required: true
label: Grafana Service Type
show_subquestion_if: "NodePort"
show_if: "ingress.enabled=false"
subquestions:
- variable: service.nodePort
default: ""
description: "NodePort http port(to set explicitly, choose port between 30000-32767)"
type: int
min: 30000
max: 32767
show_if: "ingress.enabled=false"
label: Grafana NodePort Number
{{ $routePrefix := .Values.routePrefix }}
1. Get your '{{ .Values.adminUser }}' user password by running:
kubectl get secret --namespace {{ .Release.Namespace }} {{ template "grafana.fullname" . }} -o jsonpath="{.data.password}" | base64 --decode ; echo
2. The Grafana server can be accessed via port 80 on the following DNS name from within your cluster:
{{ template "grafana.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local
{{ if .Values.ingress.enabled }}
From outside the cluster, the server URL(s) are:
{{- range $host := .Values.ingress.hosts }}
http://{{ $host }}{{ $routePrefix }}
{{- 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 {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "grafana.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.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 {{ .Release.Namespace }} -w {{ template "grafana.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "grafana.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo http://$SERVICE_IP:80
{{ else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "grafana.fullname" . }}" -o jsonpath="{.items[0].metadata.name}")
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 3000
{{- end }}
{{- end }}
3. Login with the password from step 1 and the username: {{ .Values.adminUser }}
{{- if .Values.storageSpec }}
{{- else }}
#################################################################################
###### WARNING: Persistence is disabled!!! You will lose your data when #####
###### the Grafana pod is terminated. #####
#################################################################################
{{- end }}
{{/* 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" -}}
{{- $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 -}}
{{/*
Create a fully qualified server name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "grafana.server.fullname" -}}
{{- printf "%s-%s" .Release.Name "grafana" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
apiVersion: v1
kind: ConfigMap
metadata:
labels:
app: {{ template "grafana.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: "{{ .Release.Service }}"
release: "{{ .Release.Name }}"
name: {{ template "grafana.server.fullname" . }}
data:
{{- if .Values.serverDashboardFiles }}
{{ toYaml .Values.serverDashboardFiles | indent 2 }}
{{ end }}
{{- if .Values.keepOriginalDashboards }}
{{ (.Files.Glob "dashboards/k8s/*.json").AsConfig | indent 2 }}
{{- end }}
{{- if .Values.dataSource }}
{{ toYaml .Values.dataSource | indent 2 }}
{{- end }}
{{- if .Values.keepOriginalDatasources }}
prometheus-datasource.json: |+
{
"access": "proxy",
"basicAuth": false,
"name": "prometheus",
"type": "prometheus",
"url": "http://{{ printf "%s-%s" .Release.Name "server" }}:{{ .Values.prometheusPort }}"
}
{{- end }}
apiVersion: v1
kind: ConfigMap
metadata:
labels:
app: {{ template "grafana.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: "{{ .Release.Service }}"
release: "{{ .Release.Name }}"
name: {{ template "grafana.server.fullname" . }}-resources
data:
{{- if .Values.keepOriginalDashboards }}
{{ (.Files.Glob "dashboards/k8s-resources/*.json").AsConfig | indent 2 }}
{{- end }}
apiVersion: apps/v1beta1
kind: Deployment
metadata:
labels:
app: {{ template "grafana.fullname" . }}
chart: "{{.Chart.Name}}-{{.Chart.Version}}"
heritage: "{{ .Release.Service }}"
release: "{{ .Release.Name }}"
name: {{ template "grafana.server.fullname" . }}
spec:
replicas: 1
template:
metadata:
annotations:
{{- range $key, $value := .Values.annotations }}
{{ $key }}: {{ $value }}
{{- end }}
labels:
app: {{ template "grafana.fullname" . }}
release: "{{ .Release.Name }}"
spec:
containers:
- name: grafana
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
env:
- name: GF_AUTH_BASIC_ENABLED
value: "true"
- name: GF_AUTH_ANONYMOUS_ENABLED
value: "{{ .Values.auth.anonymous.enabled }}"
- name: GF_SECURITY_ADMIN_USER
valueFrom:
secretKeyRef:
name: {{ template "grafana.server.fullname" . }}
key: user
- name: GF_SECURITY_ADMIN_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "grafana.server.fullname" . }}
key: password
{{- if .Values.extraVars }}
{{ toYaml .Values.extraVars | indent 8 }}
{{- end }}
volumeMounts:
- name: grafana-storage
mountPath: /var/lib/grafana
{{- if .Values.mountGrafanaConfig }}
- name: grafana-config
mountPath: /etc/grafana
{{- end }}
ports:
- name: web
containerPort: 3000
readinessProbe:
httpGet:
path: /api/health
port: 3000
periodSeconds: 1
timeoutSeconds: 1
successThreshold: 1
failureThreshold: 10
resources:
requests:
memory: 100Mi
cpu: 100m
limits:
memory: 200Mi
cpu: 200m
- name: grafana-watcher
image: {{ .Values.grafanaWatcher.repository }}:{{ .Values.grafanaWatcher.tag }}
args:
- '--watch-dir=/var/grafana-dashboards'
- '--watch-dir=/var/grafana-dashboards/k8s'
- '--watch-dir=/var/grafana-dashboards/k8s-resources'
- '--grafana-url=http://127.0.0.1:3000'
{{- range .Values.serverDashboardConfigmaps }}
- '--watch-dir=/var/additional-dashboards/{{ . }}'
{{- end }}
env:
- name: GRAFANA_USER
valueFrom:
secretKeyRef:
name: {{ template "grafana.server.fullname" . }}
key: user
- name: GRAFANA_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "grafana.server.fullname" . }}
key: password
resources:
requests:
memory: "16Mi"
cpu: "50m"
limits:
memory: "32Mi"
cpu: "100m"
volumeMounts:
- name: grafana-dashboards-k8s
mountPath: /var/grafana-dashboards/k8s
- name: grafana-dashboards-resources
mountPath: /var/grafana-dashboards/k8s-resources
{{- range .Values.serverDashboardConfigmaps }}
- name: {{ . }}
mountPath: /var/additional-dashboards/{{ . }}
{{- end }}
{{- if .Values.nodeSelector }}
nodeSelector:
{{ toYaml .Values.nodeSelector | indent 4 }}
{{- end }}
{{- if .Values.global.rbacEnable }}
serviceAccountName: {{ template "grafana.server.fullname" . }}
{{- end }}
{{- if .Values.tolerations }}
tolerations:
{{ toYaml .Values.tolerations | indent 8 }}
{{- end }}
volumes:
- name: grafana-storage
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ template "grafana.server.fullname" . }}
{{- else }}
emptyDir: {}
{{- end }}
- name: grafana-dashboards-k8s
configMap:
name: {{ template "grafana.server.fullname" . }}
- name: grafana-dashboards-resources
configMap:
name: {{ template "grafana.server.fullname" . }}-resources
{{- if .Values.mountGrafanaConfig }}
- name: grafana-config
hostPath:
path: /etc/grafana
type: Directory
{{- end }}
{{- range .Values.serverDashboardConfigmaps }}
- name: {{ . }}
configMap:
name: {{ . }}
{{- end }}
{{- if .Values.ingress.enabled -}}
{{- $serviceName := include "grafana.fullname" . }}
{{- $routePrefix := .Values.routePrefix }}
{{- $releaseName := .Release.Name }}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
{{- if .Values.ingress.annotations }}
annotations:
{{ toYaml .Values.ingress.annotations | indent 4 }}
{{- end }}
labels:
app: {{ template "grafana.name" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: "{{ .Release.Service }}"
release: "{{ .Release.Name }}"
{{- if .Values.ingress.labels }}
{{ toYaml .Values.ingress.labels | indent 4 }}
{{- end }}
name: {{ template "grafana.fullname" . }}
spec:
rules:
{{- range $host := .Values.ingress.hosts }}
- host: {{ $host }}
http:
paths:
- path: "{{ $routePrefix }}"
backend:
serviceName: {{ printf "%s-%s" $releaseName "grafana" | trunc 63 }}
servicePort: 80
{{- end -}}
{{- if .Values.ingress.tls }}
tls:
{{ toYaml .Values.ingress.tls | indent 4 }}
{{- end }}
{{- end }}
{{- if .Values.global.rbacEnable }}
{{- if .Values.global.pspEnable }}
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
labels:
app: {{ template "grafana.fullname" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
name: psp-{{ template "grafana.server.fullname" . }}
rules:
- apiGroups: ['extensions']
resources: ['podsecuritypolicies']
verbs: ['use']
resourceNames:
- {{ template "grafana.server.fullname" . }}
{{- end }}
{{- end }}
{{- if .Values.global.rbacEnable }}
{{- if .Values.global.pspEnable }}
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
labels:
app: {{ template "grafana.fullname" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
name: psp-{{ template "grafana.server.fullname" . }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: psp-{{ template "grafana.server.fullname" . }}
subjects:
- kind: ServiceAccount
name: {{ template "grafana.server.fullname" . }}
namespace: {{ .Release.Namespace }}
{{- end }}
{{- end }}
{{- if .Values.global.pspEnable }}
apiVersion: extensions/v1beta1
kind: PodSecurityPolicy
metadata:
labels:
app: {{ template "grafana.fullname" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
name: {{ template "grafana.server.fullname" . }}
spec:
privileged: false
# Required to prevent escalations to root.
# allowPrivilegeEscalation: false
# This is redundant with non-root + disallow privilege escalation,
# but we can provide it for defense in depth.
#requiredDropCapabilities:
# - ALL
# Allow core volume types.
volumes:
- 'configMap'
- 'emptyDir'
- 'projected'
- 'secret'
- 'downwardAPI'
- 'persistentVolumeClaim'
- 'hostPath'
hostNetwork: true
hostIPC: false
hostPID: true
hostPorts:
- min: 0
max: 65535
runAsUser:
# Permits the container to run with root privileges as well.
rule: 'RunAsAny'
seLinux:
# This policy assumes the nodes are using AppArmor rather than SELinux.
rule: 'RunAsAny'
supplementalGroups:
rule: 'MustRunAs'
ranges:
# Forbid adding the root group.
- min: 0
max: 65535
fsGroup:
rule: 'MustRunAs'
ranges:
# Forbid adding the root group.
- min: 0
max: 65535
readOnlyRootFilesystem: false
{{- end }}
{{- if .Values.persistence.enabled }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
labels:
app: {{ template "grafana.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: "{{ .Release.Service }}"
release: "{{ .Release.Name }}"
name: {{ template "grafana.server.fullname" . }}
spec:
accessModes:
- {{ .Values.persistence.accessMode }}
{{- if .Values.persistence.storageClass }}
{{- if (eq "-" .Values.persistence.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: "{{ .Values.persistence.storageClass }}"
{{- end }}
{{- end }}
storageClassName: {{ .Values.persistence.class }}
resources:
requests:
storage: {{ .Values.persistence.size | quote }}
{{- end }}
apiVersion: v1
kind: Secret
metadata:
labels:
app: {{ template "grafana.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: "{{ .Release.Service }}"
release: "{{ .Release.Name }}"
name: {{ template "grafana.server.fullname" . }}
type: Opaque
data:
{{- if .Values.adminPassword }}
password: {{ .Values.adminPassword | b64enc | quote }}
{{- else }}
password: {{ randAlphaNum 10 | b64enc | quote }}
{{- end }}
user: {{ .Values.adminUser | b64enc | quote }}
{{- if .Values.global.rbacEnable }}
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app: {{ template "grafana.fullname" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
name: {{ template "grafana.server.fullname" . }}
{{- end }}
apiVersion: v1
kind: Service
metadata:
labels:
app: {{ template "grafana.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: "{{ .Release.Service }}"
release: "{{ .Release.Name }}"
name: {{ template "grafana.server.fullname" . }}
{{- if .Values.service.annotations }}
annotations:
{{ toYaml .Values.service.annotations | indent 4 }}
{{- end }}
spec:
ports:
- name: "http"
port: 80
protocol: TCP
targetPort: 3000
{{- if .Values.service.nodePort }}
nodePort: {{ .Values.service.nodePort }}
{{- end }}
selector:
app: {{ template "grafana.fullname" . }}
type: "{{ .Values.service.type }}"
{{- if contains "LoadBalancer" .Values.service.type }}
{{- if .Values.service.loadBalancerIP }}
loadBalancerIP: {{ .Values.service.loadBalancerIP }}
{{- end -}}
{{- if .Values.service.loadBalancerSourceRanges}}
loadBalancerSourceRanges:
{{- range .Values.service.loadBalancerSourceRanges }}
- {{ . }}
{{- end }}
{{- end -}}
{{- end -}}
nodeSelector: {}
## Tolerations for use with node taints
## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
##
tolerations: {}
# - key: "key"
# operator: "Equal"
# value: "value"
# effect: "NoSchedule"
annotations: {}
## If true, create & use RBAC resources resp. Pod Security Policies
##
global:
rbacEnable: true
pspEnable: true
## Pass extra environment variables to the Grafana container.
##
# extraVars:
# - name: EXTRA_VAR_1
# value: extra-var-value-1
# - name: EXTRA_VAR_2
# value: extra-var-value-2
extraVars:
## Change to true override Grafana's default config.
## Make sure grafana.ini is present on /etc/grafana
mountGrafanaConfig: false
adminUser: "admin"
adminPassword: "admin"
service:
## Annotations to be added to the Service
##
annotations: {}
## Cluster-internal IP address for Alertmanager Service
##
clusterIP: ""
## List of external IP addresses at which the Alertmanager Service will be available
##
externalIPs: []
## External IP address to assign to Alertmanager Service
## Only used if service.type is 'LoadBalancer' and supported by cloud provider
##
loadBalancerIP: ""
## List of client IPs allowed to access Alertmanager Service
## Only used if service.type is 'LoadBalancer' and supported by cloud provider
##
loadBalancerSourceRanges: []
## Port to expose on each node
## Only used if service.type is 'NodePort'
##
# nodePort: 30902
## Service type
##
type: ClusterIP
## Grafana Docker image
##
image:
repository: grafana/grafana
tag: 5.0.0
grafanaWatcher:
repository: quay.io/coreos/grafana-watcher
tag: v0.0.8
persistence:
enabled: false
## data Persistent Volume Storage Class
## If defined, storageClassName: <storageClass>
## If set to "-", storageClassName: "", which disables dynamic provisioning
## If undefined (the default) or set to null, no storageClassName spec is
## set, choosing the default provisioner. (gp2 on AWS, standard on
## GKE, AWS & OpenStack)
##
# storageClass: "-"
##
## If you want to reuse an existing claim, you can pass the name of the PVC using
## the existingClaim variable
# existingClaim: your-claim
accessMode: ReadWriteOnce
size: 10Gi
resources: {}
# requests:
# memory: 400Mi
ingress:
## If true, Grafana Ingress will be created
##
enabled: false
## Annotations for Alertmanager Ingress
##
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
## Labels to be added to the Ingress
##
labels: {}
## Hostnames.
## Must be provided if Ingress is enabled.
##
# hosts:
# - grafana.domain.com
hosts: []
## TLS configuration for Alertmanager Ingress
## Secret must be manually created in the namespace
##
tls: []
# - secretName: alertmanager-general-tls
# hosts:
# - alertmanager.example.com
# Set datasource in beginning
dataSource: {}
## A list of additional configmaps that contain -dashboard.json and/or -datasource.json files
## that should be imported into grafana.
serverDashboardConfigmaps: []
serverDashboardFiles: {}
## Keep the Dashboards that are defined in this HELM chart
keepOriginalDashboards: true
## Keep the Datasources that are defined in this HELM chart
keepOriginalDatasources: true
auth:
anonymous:
enabled: "true"
prometheusPort: 80
......@@ -19,3 +19,5 @@
.project
.idea/
*.tmproj
app-readme.md
questions.yml
## Prometheus 2.x
## Introduction
Prometheus version 2.x has made changes to alertmanager, storage and recording rules. Check out the migration guide [here](https://prometheus.io/docs/prometheus/2.0/migration/)
Users of this chart will need to update their alerting rules to the new format before they can upgrade.
## Upgrading from previous chart versions.
As of version 5.0, this chart uses Prometheus 2.1. This version of prometheus introduces a new data format and is not compatible with prometheus 1.x. It is recommended to install this as a new release, as updating existing releases will not work. See the [prometheus docs](https://prometheus.io/docs/prometheus/latest/migration/#storage) for instructions on retaining your old data.
### Example migration
Assuming you have an existing release of the prometheus chart, named `prometheus-old`. In order to update to prometheus 2.1 while keeping your old data do the following:
1. Update the `prometheus-old` release. Disable scraping on every component besides the prometheus server, similar to the configuration below:
```
alertmanager:
enabled: false
alertmanagerFiles:
alertmanager.yml: ""
kubeStateMetrics:
enabled: false
nodeExporter:
enabled: false
pushgateway:
enabled: false
server:
extraArgs:
storage.local.retention: 720h
serverFiles:
alerts: ""
prometheus.yml: ""
rules: ""
```
1. Deploy a new release of the chart with version 5.0+ using prometheus 2.x. In the values.yaml set the scrape config as usual, and also add the `prometheus-old` instance as a remote-read target.
```
prometheus.yml:
...
remote_read:
- url: http://prometheus-old/api/v1/read
...
```
Old data will be available when you query the new prometheus instance.
This chart bootstraps a [Prometheus](https://prometheus.io/) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
## Configuration
......@@ -213,21 +169,6 @@ Parameter | Description | Default
`serverFiles.prometheus.yml` | Prometheus server scrape configuration | example configuration
`networkPolicy.enabled` | Enable NetworkPolicy | `false` |
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
```console
$ helm install stable/prometheus --name my-release \
--set server.terminationGracePeriodSeconds=360
```
Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example,
```console
$ helm install stable/prometheus --name my-release -f values.yaml
```
> **Tip**: You can use the default [values.yaml](values.yaml)
### RBAC Configuration
Roles and RoleBindings resources will be created automatically for `server` and `kubeStateMetrics` services.
......
# Prometheus
[Prometheus](https://prometheus.io/), a [Cloud Native Computing Foundation](https://cncf.io/) project, is a systems and service monitoring system. It collects metrics from configured targets at given intervals, evaluates rule expressions, displays the results, and can trigger alerts if some condition is observed to be true.
## Introduction
This chart bootstraps a [Prometheus](https://prometheus.io/) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
dependencies:
- name: grafana
repository: http://127.0.0.1:8879/charts
version: 0.0.30
digest: sha256:462f46402e046ae71c9adaef166fb8188f55f655b69e941eb611e779f86e7125
generated: 2018-05-23T15:51:49.33100566+08:00
dependencies:
dependencies:
- name: grafana
version: 0.0.30
repository: "http://127.0.0.1:8879/charts"
condition: grafana.enabled
tags:
- grafana
......@@ -24,6 +24,8 @@ rules:
- persistentvolumeclaims
- persistentvolumes
- endpoints
- secrets
- configmaps
verbs:
- list
- watch
......
......@@ -15,7 +15,7 @@ data:
{{ $key }}: |
{{ toYaml $value | default "{}" | indent 4 }}
{{- if eq $key "prometheus.yml" -}}
{{- if $root.Values.alertmanager.enabled -}}
{{- if $root.Values.alertmanager.enabled }}
alerting:
alertmanagers:
- kubernetes_sd_configs:
......
......@@ -80,6 +80,9 @@ spec:
{{- if .Values.server.baseURL }}
- --web.external-url={{ .Values.server.baseURL }}
{{- end }}
{{- if .Values.server.enableAdminApi }}
- --web.enable-admin-api
{{- end }}
ports:
- containerPort: 9090
readinessProbe:
......
......@@ -252,8 +252,8 @@ kubeStateMetrics:
## kube-state-metrics container image
##
image:
repository: k8s.gcr.io/kube-state-metrics
tag: v1.2.0
repository: quay.io/coreos/kube-state-metrics
tag: v1.3.1
pullPolicy: IfNotPresent
## kube-state-metrics container arguments
......@@ -423,6 +423,10 @@ server:
## Maybe same with Ingress host name
baseURL: ""
## This flag controls access to the administrative HTTP API which includes functionality such as deleting time
## series. This is disabled by default.
enableAdminApi: false
## Additional Prometheus server container arguments
##
extraArgs: {}
......@@ -587,7 +591,7 @@ server:
pushgateway:
## If false, pushgateway will not be installed
##
enabled: true
enabled: false
## pushgateway container name
##
......@@ -963,3 +967,109 @@ networkPolicy:
## Enable creation of NetworkPolicy resources.
##
enabled: false
## Define Grafana Configurations
##
grafana:
enabled: true
replicas: 1
adminUser: "admin"
adminPassword: "admin"
image:
repository: grafana/grafana
tag: 5.0.0
grafanaWatcher:
repository: quay.io/coreos/grafana-watcher
tag: v0.0.8
auth:
anonymous:
enabled: "true"
prometheusPort: 80
persistence:
enabled: false
## data Persistent Volume Storage Class
## If defined, storageClassName: <storageClass>
## If set to "-", storageClassName: "", which disables dynamic provisioning
## If undefined (the default) or set to null, no storageClassName spec is
## set, choosing the default provisioner. (gp2 on AWS, standard on
## GKE, AWS & OpenStack)
##
# storageClass: "-"
##
## If you want to reuse an existing claim, you can pass the name of the PVC using
## the existingClaim variable
# existingClaim: your-claim
accessMode: ReadWriteOnce
size: 10Gi
ingress:
## If true, Grafana Ingress will be created
##
enabled: false
## Annotations for Alertmanager Ingress
##
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
## Labels to be added to the Ingress
##
labels: {}
## Hostnames.
## Must be provided if Ingress is enabled.
##
# hosts:
# - grafana.domain.com
hosts: []
## TLS configuration for Alertmanager Ingress
## Secret must be manually created in the namespace
##
tls: []
# - secretName: alertmanager-general-tls
# hosts:
# - alertmanager.example.com
#
service:
## Annotations to be added to the Service
##
annotations: {}
## Cluster-internal IP address for Alertmanager Service
##
clusterIP: ""
## List of external IP addresses at which the Alertmanager Service will be available
##
externalIPs: []
## External IP address to assign to Alertmanager Service
## Only used if service.type is 'LoadBalancer' and supported by cloud provider
##
loadBalancerIP: ""
## List of client IPs allowed to access Alertmanager Service
## Only used if service.type is 'LoadBalancer' and supported by cloud provider
##
loadBalancerSourceRanges: []
## Port to expose on each node
## Only used if service.type is 'NodePort'
##
# nodePort: 30902
## Service type
##
type: ClusterIP
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment