Skip to content

Commit

Permalink
fix(ndm-exporters): changed exporter service common label (#647)
Browse files Browse the repository at this point in the history
* changed exporter service to use common label
* bumped chart version
* fix alignment in exporter services
* fix indentation problem with the ndm ds, operators and exporters templates

Signed-off-by: Abhishek Agarwal <[email protected]>
  • Loading branch information
Abhishek Agarwal authored Nov 26, 2021
1 parent beb21ae commit 669c5f6
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 25 deletions.
8 changes: 3 additions & 5 deletions deploy/helm/charts/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ If release name contains chart name it will be used as a full name.
{{- end }}

{{- define "openebs-ndm.exporter.name" -}}
{{- $ndmName := default .Chart.Name .Values.ndmExporter.nameOverride | trunc 63 | trimSuffix "-" }}
{{- $ndmName := .Chart.Name | trunc 63 | trimSuffix "-" }}
{{- $componentName := "exporter" | trunc 63 | trimSuffix "-" }}
{{- printf "%s-%s" $ndmName $componentName | trunc 63 | trimSuffix "-" }}
{{- end }}
Expand Down Expand Up @@ -193,7 +193,7 @@ Create labels for ndm operator component
Create match labels for ndm cluster exporter deployment
*/}}
{{- define "openebs-ndm.cluster-exporter.matchLabels" -}}
app: {{ template "openebs-ndm.cluster-exporter.name" . }}
app: {{ template "openebs-ndm.exporter.name" . }}
release: {{ .Release.Name }}
component: {{ default (include "openebs-ndm.cluster-exporter.name" .) .Values.ndmExporter.clusterExporter.componentName }}
{{- end -}}
Expand All @@ -202,7 +202,6 @@ component: {{ default (include "openebs-ndm.cluster-exporter.name" .) .Values.nd
Create component labels for ndm cluster exporter component
*/}}
{{- define "openebs-ndm.cluster-exporter.componentLabels" -}}
name: {{ template "openebs-ndm.exporter.name" . }}
openebs.io/component-name: {{ default (include "openebs-ndm.cluster-exporter.name" .) .Values.ndmExporter.clusterExporter.componentName }}
{{- end -}}

Expand All @@ -220,7 +219,7 @@ Create labels for ndm cluster exporter component
Create match labels for ndm node exporter deployment
*/}}
{{- define "openebs-ndm.node-exporter.matchLabels" -}}
app: {{ template "openebs-ndm.node-exporter.name" . }}
app: {{ template "openebs-ndm.exporter.name" . }}
release: {{ .Release.Name }}
component: {{ default (include "openebs-ndm.node-exporter.name" .) .Values.ndmExporter.nodeExporter.componentName }}
{{- end -}}
Expand All @@ -229,7 +228,6 @@ component: {{ default (include "openebs-ndm.node-exporter.name" .) .Values.ndmEx
Create component labels for ndm node exporter component
*/}}
{{- define "openebs-ndm.node-exporter.componentLabels" -}}
name: {{ template "openebs-ndm.exporter.name" . }}
openebs.io/component-name: {{ default (include "openebs-ndm.node-exporter.name" .) .Values.ndmExporter.nodeExporter.componentName }}
{{- end -}}

Expand Down
4 changes: 2 additions & 2 deletions deploy/helm/charts/templates/cluster-exporter-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ spec:
targetPort: {{ .Values.ndmExporter.clusterExporter.metricsPort }}
selector:
{{- with .Values.ndmExporter.clusterExporter.podLabels }}
{{ toYaml . }}
{{- end }}
{{ toYaml . }}
{{- end }}
{{- end }}
6 changes: 3 additions & 3 deletions deploy/helm/charts/templates/cluster-exporter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ spec:
metadata:
labels:
{{- include "openebs-ndm.cluster-exporter.labels" . | nindent 8 }}
{{- with .Values.ndmExporter.clusterExporter.podLabels }}
{{ toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.ndmExporter.clusterExporter.podLabels }}
{{ toYaml . }}
{{- end }}
spec:
serviceAccountName: {{ template "openebs-ndm.serviceAccountName" . }}
containers:
Expand Down
2 changes: 1 addition & 1 deletion deploy/helm/charts/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ spec:
labels:
{{- include "openebs-ndm.labels" . | nindent 8 }}
{{- with .Values.ndm.podLabels}}
{{ toYaml . | nindent 8 }}
{{ toYaml . }}
{{- end}}
spec:
serviceAccountName: {{ template "openebs-ndm.serviceAccountName" . }}
Expand Down
2 changes: 1 addition & 1 deletion deploy/helm/charts/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
labels:
{{- include "openebs-ndm.operator.labels" . | nindent 8 }}
{{- with .Values.ndmOperator.podLabels}}
{{ toYaml . | nindent 8 }}
{{ toYaml . }}
{{- end}}
spec:
serviceAccountName: {{ template "openebs-ndm.serviceAccountName" . }}
Expand Down
4 changes: 2 additions & 2 deletions deploy/helm/charts/templates/node-exporter-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ spec:
targetPort: {{ .Values.ndmExporter.nodeExporter.metricsPort }}
selector:
{{- with .Values.ndmExporter.nodeExporter.podLabels }}
{{ toYaml . }}
{{- end }}
{{ toYaml . }}
{{- end }}
{{- end }}
6 changes: 3 additions & 3 deletions deploy/helm/charts/templates/node-exporter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ spec:
metadata:
labels:
{{- include "openebs-ndm.node-exporter.labels" . | nindent 8 }}
{{- with .Values.ndmExporter.nodeExporter.podLabels }}
{{ toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.ndmExporter.nodeExporter.podLabels }}
{{ toYaml . }}
{{- end }}
spec:
serviceAccountName: {{ template "openebs-ndm.serviceAccountName" . }}
containers:
Expand Down
6 changes: 2 additions & 4 deletions deploy/ndm-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -725,8 +725,7 @@ metadata:
name: ndm-cluster-exporter-service
namespace: openebs
labels:
name: openebs-ndm-exporter
component: openebs-ndm-cluster-exporter
app: openebs-ndm-exporter
spec:
clusterIP: None
ports:
Expand Down Expand Up @@ -790,8 +789,7 @@ metadata:
name: ndm-node-exporter-service
namespace: openebs
labels:
name: openebs-ndm-exporter
component: openebs-ndm-node-exporter
app: openebs-ndm-exporter
spec:
clusterIP: None
ports:
Expand Down
3 changes: 1 addition & 2 deletions deploy/yamls/ndm-cluster-exporter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ metadata:
name: ndm-cluster-exporter-service
namespace: openebs
labels:
name: openebs-ndm-exporter
component: openebs-ndm-cluster-exporter
app: openebs-ndm-exporter
spec:
clusterIP: None
ports:
Expand Down
3 changes: 1 addition & 2 deletions deploy/yamls/ndm-node-exporter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ metadata:
name: ndm-node-exporter-service
namespace: openebs
labels:
name: openebs-ndm-exporter
component: openebs-ndm-node-exporter
app: openebs-ndm-exporter
spec:
clusterIP: None
ports:
Expand Down

0 comments on commit 669c5f6

Please sign in to comment.