From 889a729f4ddf1b55e960b33fe09a34a14d73e80c Mon Sep 17 00:00:00 2001
From: Xiang Dai <764524258@qq.com>
Date: Tue, 12 Feb 2019 07:31:27 +0800
Subject: [PATCH] Fix helm install error (#305)

* update helm values yaml

- set persistence.enabled as 'false' as default since there is no pv as
default

- set persistence.storageClassName as 'default' since even if pv exists, pvc
still need storageClassName:

```
  Normal  FailedBinding  8s (x4 over 35s)  persistentvolume-controller  no persistent volumes available for this claim and no storage class is set
```

Signed-off-by: Xiang Dai <764524258@qq.com>

* helm: delete duplicate empty blank

Signed-off-by: Xiang Dai <764524258@qq.com>
---
 production/helm/README.md                          |  2 +-
 production/helm/templates/loki/deployment.yaml     |  2 +-
 .../helm/templates/promtail/clusterrole.yaml       |  2 +-
 production/helm/templates/promtail/daemonset.yaml  |  2 +-
 production/helm/values.yaml                        | 14 ++++++++------
 5 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/production/helm/README.md b/production/helm/README.md
index 2e204ef3..36b55906 100644
--- a/production/helm/README.md
+++ b/production/helm/README.md
@@ -26,7 +26,7 @@ $ helm install . -n loki --namespace <YOUR-NAMESPACE>
 To install Grafana on your cluster with helm, use the following command:
 
 ```bash
-$ helm install stable/grafana -n loki-grafana -f grafana.yaml --namespace <YOUR-NAMESPACE> 
+$ helm install stable/grafana -n loki-grafana -f grafana.yaml --namespace <YOUR-NAMESPACE>
 ```
 
 To get the admin password for the Grafana pod, run the following command:
diff --git a/production/helm/templates/loki/deployment.yaml b/production/helm/templates/loki/deployment.yaml
index d8dab036..c8dc8bf1 100644
--- a/production/helm/templates/loki/deployment.yaml
+++ b/production/helm/templates/loki/deployment.yaml
@@ -40,7 +40,7 @@ spec:
         - name: {{ .Chart.Name }}
           image: "{{ .Values.loki.image.repository }}:{{ .Values.loki.image.tag }}"
           imagePullPolicy: {{ .Values.loki.image.pullPolicy }}
-          args: 
+          args:
             - "-config.file=/etc/loki/loki.yaml"
           volumeMounts:
             - name: config
diff --git a/production/helm/templates/promtail/clusterrole.yaml b/production/helm/templates/promtail/clusterrole.yaml
index 84bff8d2..8a1f2070 100644
--- a/production/helm/templates/promtail/clusterrole.yaml
+++ b/production/helm/templates/promtail/clusterrole.yaml
@@ -19,6 +19,6 @@ rules:
   - nodes/proxy
   - services
   - endpoints
-  - pods  
+  - pods
   verbs: ["get", "watch", "list"]
 {{- end}}
\ No newline at end of file
diff --git a/production/helm/templates/promtail/daemonset.yaml b/production/helm/templates/promtail/daemonset.yaml
index 8da09af4..8e897b70 100644
--- a/production/helm/templates/promtail/daemonset.yaml
+++ b/production/helm/templates/promtail/daemonset.yaml
@@ -40,7 +40,7 @@ spec:
         - name: {{ .Chart.Name }}
           image: "{{ .Values.promtail.image.repository }}:{{ .Values.promtail.image.tag }}"
           imagePullPolicy: {{ .Values.promtail.image.pullPolicy }}
-          args: 
+          args:
             - "-config.file=/etc/promtail/promtail.yaml"
             - "-client.url=http://{{ template "loki.fullname" . }}:{{ .Values.loki.service.port }}/api/prom/push"
           volumeMounts:
diff --git a/production/helm/values.yaml b/production/helm/values.yaml
index 4f182706..ae55dfec 100644
--- a/production/helm/values.yaml
+++ b/production/helm/values.yaml
@@ -4,9 +4,9 @@ rbac:
 
 serviceAccount:
   create: true
-  name: 
+  name:
 
-loki: 
+loki:
   replicas: 1
   deploymentStrategy: RollingUpdate
 
@@ -58,13 +58,15 @@ loki:
 
   ## Enable persistence using Persistent Volume Claims
   ## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/
-  ##
+  ## If you set enabled as "True", you need :
+  ## - create a pv which above 10Gi and has same namespace with loki
+  ## - keep storageClassName same with below setting
   persistence:
-    enabled: true
+    enabled: false
     accessModes:
       - ReadWriteOnce
     size: 10Gi
-    # storageClassName: default
+    storageClassName: default
     # annotations: {}
     # subPath: ""
     # existingClaim:
@@ -97,7 +99,7 @@ promtail:
 
   image:
     repository: grafana/promtail
-    tag: master 
+    tag: master
     pullPolicy: IfNotPresent
 
   service:
-- 
GitLab