From dfa28efbfab6acc3ff637f7cbe797ad77b7dcd5f Mon Sep 17 00:00:00 2001 From: jose5918 Date: Thu, 16 Mar 2017 16:37:59 -0700 Subject: [PATCH] [stable/grafana] Add option to use LoadBalancerIP (#635) * Adds option to use LoadBalancerIP for Grafana Changes made: - Adds option to specify LoadBalancerIP if user chooses LoadBalancer service type - Adds option for loadBalancerSourceRanges - Updates README.md and chart version * [stable/grafana] bump chart version to 0.2.3 * [stable/grafana] bump chart version to 0.2.5 * [stable/grafana] add examples to values.yaml This makes it clearer how these values have to be configured --- stable/grafana/Chart.yaml | 2 +- stable/grafana/README.md | 6 ++++-- stable/grafana/templates/svc.yaml | 12 +++++++++++- stable/grafana/values.yaml | 16 ++++++++++++++++ 4 files changed, 32 insertions(+), 4 deletions(-) diff --git a/stable/grafana/Chart.yaml b/stable/grafana/Chart.yaml index 867614a6e3..05667af05a 100755 --- a/stable/grafana/Chart.yaml +++ b/stable/grafana/Chart.yaml @@ -1,5 +1,5 @@ name: grafana -version: 0.2.4 +version: 0.2.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 diff --git a/stable/grafana/README.md b/stable/grafana/README.md index 01ebdc9f64..2dbe3e9360 100644 --- a/stable/grafana/README.md +++ b/stable/grafana/README.md @@ -5,7 +5,7 @@ ## TL;DR; ```console -$ helm install incubator/grafana +$ helm install stable/grafana ``` ## Installing the Chart @@ -31,7 +31,7 @@ The command removes all the Kubernetes components associated with the chart and | Parameter | Description | Default | |---------------------------------------|-------------------------------------|---------------------------------------------------| -| `server.image` | Container image to run | grafana/grafana | +| `server.image` | Container image to run | grafana/grafana:latest | | `server.adminUser` | Admin user username | admin | | `server.adminPassword` | Admin user password | admin | | `server.persistentVolume.enabled` | Create a volume to store data | true | @@ -39,3 +39,5 @@ The command removes all the Kubernetes components associated with the chart and | `server.persistentVolume.storageClass`| Type of persistent volume claim | `nil` (uses alpha storage class annotation) | | `server.persistentVolume.accessMode` | ReadWriteOnce or ReadOnly | [ReadWriteOnce] | | `server.resources` | Server resource requests and limits | requests: {cpu: 100m, memory: 100Mi} | +| `server.serviceType` | ClusterIP, NodePort, or LoadBalancer| ClusterIP | +| `server.setDatasource.enabled` | Creates grafana datasource with job | false | diff --git a/stable/grafana/templates/svc.yaml b/stable/grafana/templates/svc.yaml index f11295a0df..af08c59fe4 100644 --- a/stable/grafana/templates/svc.yaml +++ b/stable/grafana/templates/svc.yaml @@ -18,4 +18,14 @@ spec: app: {{ template "fullname" . }} component: "{{ .Values.server.name }}" type: "{{ .Values.server.serviceType }}" - +{{- if contains "LoadBalancer" .Values.server.serviceType }} + {{- if .Values.server.loadBalancerIP }} + loadBalancerIP: {{ .Values.server.loadBalancerIP }} + {{- end -}} + {{- if .Values.server.loadBalancerSourceRanges}} + loadBalancerSourceRanges: + {{- range .Values.server.loadBalancerSourceRanges }} + - {{ . }} + {{- end }} + {{- end -}} +{{- end -}} diff --git a/stable/grafana/values.yaml b/stable/grafana/values.yaml index 5b2a4e7b5a..5e9fa59c99 100644 --- a/stable/grafana/values.yaml +++ b/stable/grafana/values.yaml @@ -94,6 +94,22 @@ server: ## serviceType: ClusterIP + ## Load balancer IP address + ## Is not required, but allows for static address with + ## serviceType LoadBalancer. + ## If not supported by cloud provider, this field is ignored. + ## Default: nil + ## + # loadBalancerIP: 130.211.x.x + + ## This will restrict traffic through the cloud-provider load-balancer + ## to the specified client IPs. + ## If not supported by cloud provider, this field is ignored. + ## Default: nil + ## + # loadBalancerSourceRanges: + # - 0.0.0.0/0 + ## Grafana local config path ## Default '/etc/grafana' ##