Skip to content

Commit 96cf642

Browse files
author
Vishnu Attur
authored
Merge pull request #113 from rajaSahil/Add-Service
fix(helm): Pass listen-address flag through arguments and install service.
2 parents 08c3b3b + 0cb1c74 commit 96cf642

File tree

8 files changed

+67
-2
lines changed

8 files changed

+67
-2
lines changed

.github/workflows/chart-lint-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
run: ct lint --config ct.yaml
4646

4747
- name: Create kind cluster
48-
uses: helm/kind-action@v1.1.0
48+
uses: helm/kind-action@v1.2.0
4949
if: steps.list-changed.outputs.changed == 'true'
5050
with:
5151
config: buildscripts/kind_config.yaml

deploy/helm/charts/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v2
22
name: lvm-localpv
33
description: CSI Driver for dynamic provisioning of LVM Persistent Local Volumes.
4-
version: 0.6.1
4+
version: 0.6.2
55
appVersion: 0.6.0
66
icon: https://raw.githubusercontent.com/cncf/artwork/master/projects/openebs/icon/color/openebs-icon-color.png
77
home: http://www.openebs.io/

deploy/helm/charts/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ The following table lists the configurable parameters of the OpenEBS LVM Localpv
7979
| `lvmPlugin.image.repository`| Image repository for openebs-lvm-plugin| `openebs/lvm-driver`|
8080
| `lvmPlugin.image.pullPolicy`| Image pull policy for openebs-lvm-plugin| `IfNotPresent`|
8181
| `lvmPlugin.image.tag`| Image tag for openebs-lvm-plugin| `0.6.0`|
82+
| `lvmPlugin.metricsPort`| The TCP port number used for exposing lvm-metrics | `9500`|
8283
| `lvmNode.driverRegistrar.image.registry`| Registry for csi-node-driver-registrar image| `k8s.gcr.io/`|
8384
| `lvmNode.driverRegistrar.image.repository`| Image repository for csi-node-driver-registrar| `sig-storage/csi-node-driver-registrar`|
8485
| `lvmNode.driverRegistrar.image.pullPolicy`| Image pull policy for csi-node-driver-registrar| `IfNotPresent`|
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{{- if .Values.lvmPlugin.metricsPort }}
2+
apiVersion: v1
3+
kind: Service
4+
metadata:
5+
name: {{ template "lvmlocalpv.fullname" . }}-node-service
6+
labels:
7+
{{- include "lvmlocalpv.lvmNode.labels" . | nindent 4 }}
8+
spec:
9+
clusterIP: None
10+
ports:
11+
- name: metrics
12+
port: {{ .Values.lvmPlugin.metricsPort }}
13+
targetPort: {{ .Values.lvmPlugin.metricsPort }}
14+
selector:
15+
{{- with .Values.lvmNode.podLabels }}
16+
{{ toYaml . }}
17+
{{- end }}
18+
{{- end }}

deploy/helm/charts/templates/lvm-node.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ spec:
7575
- "--riops-per-gb=$(RIOPS_PER_GB)"
7676
- "--wiops-per-gb=$(WIOPS_PER_GB)"
7777
{{- end }}
78+
{{- if .Values.lvmPlugin.metricsPort }}
79+
- "--listen-address=$(METRICS_LISTEN_ADDRESS)"
80+
{{- end }}
7881
env:
7982
- name: OPENEBS_NODE_ID
8083
valueFrom:
@@ -96,6 +99,10 @@ spec:
9699
- name: WIOPS_PER_GB
97100
value: {{ .Values.lvmPlugin.ioLimits.writeIopsPerGB }}
98101
{{- end }}
102+
{{- if .Values.lvmPlugin.metricsPort }}
103+
- name: METRICS_LISTEN_ADDRESS
104+
value: :{{ .Values.lvmPlugin.metricsPort }}
105+
{{- end }}
99106
volumeMounts:
100107
- name: plugin-dir
101108
mountPath: /plugin

deploy/helm/charts/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ lvmPlugin:
132132
containerRuntime: containerd
133133
readIopsPerGB: ""
134134
writeIopsPerGB: ""
135+
# The TCP port number used for exposing lvm-metrics.
136+
# If not set, service will not be created to expose metrics endpoint to serviceMonitor and listen-address flag will not be set.
137+
metricsPort: 9500
135138

136139
role: openebs-lvm
137140

deploy/lvm-operator.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,6 +1357,7 @@ spec:
13571357
- "--nodeid=$(OPENEBS_NODE_ID)"
13581358
- "--endpoint=$(OPENEBS_CSI_ENDPOINT)"
13591359
- "--plugin=$(OPENEBS_NODE_DRIVER)"
1360+
- "--listen-address=$(METRICS_LISTEN_ADDRESS)"
13601361
env:
13611362
- name: OPENEBS_NODE_ID
13621363
valueFrom:
@@ -1368,6 +1369,8 @@ spec:
13681369
value: agent
13691370
- name: LVM_NAMESPACE
13701371
value: openebs
1372+
- name: METRICS_LISTEN_ADDRESS
1373+
value: :9500
13711374
volumeMounts:
13721375
- name: plugin-dir
13731376
mountPath: /plugin
@@ -1396,3 +1399,18 @@ spec:
13961399
path: /var/lib/kubelet/
13971400
type: Directory
13981401
---
1402+
1403+
apiVersion: v1
1404+
kind: Service
1405+
metadata:
1406+
name: openebs-lvm-node-service
1407+
labels:
1408+
name: openebs-lvm-node
1409+
spec:
1410+
clusterIP: None
1411+
ports:
1412+
- name: metrics
1413+
port: 9500
1414+
targetPort: 9500
1415+
selector:
1416+
app: openebs-lvm-node

deploy/yamls/lvm-driver.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -988,6 +988,7 @@ spec:
988988
- "--nodeid=$(OPENEBS_NODE_ID)"
989989
- "--endpoint=$(OPENEBS_CSI_ENDPOINT)"
990990
- "--plugin=$(OPENEBS_NODE_DRIVER)"
991+
- "--listen-address=$(METRICS_LISTEN_ADDRESS)"
991992
env:
992993
- name: OPENEBS_NODE_ID
993994
valueFrom:
@@ -999,6 +1000,8 @@ spec:
9991000
value: agent
10001001
- name: LVM_NAMESPACE
10011002
value: openebs
1003+
- name: METRICS_LISTEN_ADDRESS
1004+
value: :9500
10021005
volumeMounts:
10031006
- name: plugin-dir
10041007
mountPath: /plugin
@@ -1027,3 +1030,18 @@ spec:
10271030
path: /var/lib/kubelet/
10281031
type: Directory
10291032
---
1033+
1034+
apiVersion: v1
1035+
kind: Service
1036+
metadata:
1037+
name: openebs-lvm-node-service
1038+
labels:
1039+
name: openebs-lvm-node
1040+
spec:
1041+
clusterIP: None
1042+
ports:
1043+
- name: metrics
1044+
port: 9500
1045+
targetPort: 9500
1046+
selector:
1047+
app: openebs-lvm-node

0 commit comments

Comments
 (0)