Fix collectd helm chart 29/78429/1
authorDileep Ranganathan <dileep.ranganathan@intel.com>
Wed, 13 Feb 2019 13:18:56 +0000 (05:18 -0800)
committerDileep Ranganathan <dileep.ranganathan@intel.com>
Wed, 13 Feb 2019 13:18:56 +0000 (05:18 -0800)
Fix collectd prometheus integration by adding correct labels.
Added template helper function for helm chart.
Updated Chart appVersion, NOTES.

Initial Helm charts for CollectD, Prometheus Operator,
Kafka Strimzi operator, Rook Ceph Operator.

Change-Id: I511fc415bf2f2ab4b92d7501f3d3a1e6b6f82581
Issue-ID: ONAPARC-366
Signed-off-by: Dileep Ranganathan <dileep.ranganathan@intel.com>
vnfs/DAaaS/collectd-helm/Chart.yaml
vnfs/DAaaS/collectd-helm/templates/NOTES.txt
vnfs/DAaaS/collectd-helm/templates/_helpers.tpl
vnfs/DAaaS/collectd-helm/templates/service.yaml
vnfs/DAaaS/collectd-helm/values.yaml

index 9b51479..2206284 100644 (file)
@@ -13,6 +13,7 @@
 # limitations under the License.
 
 apiVersion: v1
+appVersion: "0.1.0"
 description: Collectd Helm Chart
 name: collectd
 version: 0.1.0
index 3ad21a5..d96bc7d 100644 (file)
@@ -1 +1,2 @@
-1. Collect Charts
+1. Collect Charts has been installed
+2. Collectd prometheus metrics endpoint {{ .Values.collectd_prometheus.service.port}}
index f0d83d2..b5e9808 100644 (file)
@@ -14,3 +14,12 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
 {{- $name := default .Chart.Name .Values.nameOverride -}}
 {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
 {{- end -}}
+
+{{/* Workaround for https://github.com/helm/helm/issues/3117 */}}
+{{- define "rangeskipempty" -}}
+{{- range $key, $value := . }}
+{{- if $value }}
+{{ $key }}: {{ $value }}
+{{- end }}
+{{- end }}
+{{- end }}
\ No newline at end of file
index 6ae6f09..b4231af 100644 (file)
@@ -8,10 +8,9 @@ metadata:
 spec:
   ports:
   - name: collectd-prometheus
-    port: {{ .Values.prometheus_port }}
-    targetPort: collectd
+    port: {{ .Values.collectd_prometheus.service.port }}
+    protocol: TCP
+    targetPort: {{ .Values.collectd_prometheus.service.targetPort }}
   selector:
-    app: {{ template "name" . }}
-    collector: collectd
-    release: {{ .Release.Name }}
-  type: ClusterIP
+{{ include "rangeskipempty" .Values.collectd_prometheus.service.selector | indent 4 }}
+  type: ClusterIP
\ No newline at end of file
index 6a1138d..7c2eb66 100644 (file)
@@ -17,4 +17,10 @@ resources: {}
   # requests:
   #  cpu: 100m
   #  memory: 128Mi
-prometheus_port: 9103
+collectd_prometheus:
+  service:
+    port: 9103
+    targetPort: 9103
+    selector:
+      app: collectd
+      collector: collectd